void TryRotate(MovableGrid rotated) { MovableGrid[] moves = { rotated, rotated.MoveLeft(), rotated.MoveRight(), rotated.MoveLeft().MoveLeft(), rotated.MoveRight().MoveRight(), }; foreach (MovableGrid test in moves) { if (!(OutsideBoard(test) || HitAnotherBlock(test))) { fallingBlock = test; return; } } }
public void MoveLeft() { if (!IsFallingBlock()) { return; } TryMove(fallingBlock.MoveLeft()); }
void TryRotate(MovableGrid rotated) { MovableGrid[] moves = { rotated, rotated.MoveLeft(), // wallkick moves rotated.MoveRight(), rotated.MoveLeft().MoveLeft(), rotated.MoveRight().MoveRight(), }; foreach (MovableGrid test in moves) { if (!ConflictsWithBoard(test)) { fallingBlock = test; return; } } }
private void TryRotate(MovableGrid test) { MovableGrid[] moves = { test, test.MoveLeft(), test.MoveRight(), test.MoveLeft().MoveLeft(), test.MoveRight().MoveRight() }; foreach (MovableGrid move in moves) { if (!ConflictWithBoard(move)) { fallingBlock = move; return; } } }
private void TryRotate(MovableGrid rotated) { MovableGrid[] moves = { rotated, rotated.MoveLeft(), // wallkick moves rotated.MoveRight(), rotated.MoveLeft().MoveLeft(), rotated.MoveRight().MoveRight(), }; refreshTab(movingGrid, null); foreach (MovableGrid test in moves) { if (!ConflictsWithBoard(test)) { refreshTab(null, test); movingGrid = test; return; } } refreshTab(null, movingGrid); }
public void MoveLeft() { MovableGrid test = movingGrid.MoveLeft(); refreshTab(movingGrid, null); if (!ConflictsWithBoard(test)) { refreshTab(null, test); movingGrid = test; } else { refreshTab(null, movingGrid); } }