public void RotatePiece() { int NewRotation = Rotacion; if (NewRotation == 3) { NewRotation = 0; } else { NewRotation++; } Point[] SendPiece = new Point[4]; for (int i = 0; i < 4; i++) { SendPiece[i] = Forma[PiezaActual, NewRotation, i]; } if (!Playground.CheckCollisionMove(SendPiece, x, y)) { Available = false; Erase(x, y, PiezaActual); Rotacion = NewRotation; Sonidos.PlaySound(Sonidos.Sounds.Rotar); Draw(x, y, PiezaActual); Playground.SensibilizeCell(x, y, Height, Width); } else { Sonidos.PlaySound(Sonidos.Sounds.Topa); } }
public void MoveRight() { Point[] SendPiece = new Point[4]; for (int i = 0; i < 4; i++) { SendPiece[i] = Forma[PiezaActual, Rotacion, i]; } UpdatePieceDimentions(); if (x + Width != 11 && !Playground.CheckCollisionMove(SendPiece, x + 1, y)) { Available = false; Erase(x, y, PiezaActual); x++; Draw(x, y, PiezaActual); Playground.SensibilizeCell(x, y, Height, Width); } else { Sonidos.PlaySound(Sonidos.Sounds.Topa); } }