static void LockPiece(ref Tetromino piece, ComplexConsoleImage field) { for (byte x = 0; x < Tetromino.LENGTH; ++x) { for (byte y = 0; y < Tetromino.LENGTH; ++y) { var c = piece.Type[Tetromino.GetIndexByRotation(x, y, ref piece.rotation)]; if (c != ' ') { field[(ushort)(piece.x + x), (ushort)(piece.y + y)] = piece.Colour; field.SetGlyph((ushort)(piece.x + x), (ushort)(piece.y + y), c); } } } }
public static void Reset() { field = new ComplexConsoleImage(FIELD_HEIGHT - 1, FIELD_WIDTH - 1); GameOver = false; score = 0; }