internal void DropUnchecked(int distance) { // let piece fall Piece.Fall(distance); Board.PlaceUnchecked(Piece); Pieces.Push(new Piece(Piece)); // we need to remember the dropped pieces for the landing height feature (heuristic) Piece = null; // remove lines int lines = Board.RemoveLines(); Lines += lines; // calculate score Score += TetrisScore.GetSoftdropScore(distance); Score += TetrisScore.GetLineScore(lines, Level); if (NextPiece.HasValue) { Piece = new Piece(NextPiece.Value); NextPiece = Tetriminos.GetRandom(); } }
// returns the fallen distance of the piece public int Drop() { return(Drop(Tetriminos.GetRandom())); }
public bool FallAndLand() { return(FallAndLand(Tetriminos.GetRandom())); }
public bool FallAndLand(int distance) { return(FallAndLand(distance, Tetriminos.GetRandom())); }
public Piece() : this(Tetriminos.GetRandom()) { }