Esempio n. 1
0
 private Piece CreatePiece(Tetromino next)
 {
     Score += ScorePerPiece;
     PieceCount++;
     return(new Piece(this, next)
     {
         Position = new VectorInt2(Width / 2, 0),
         Rotation = 0
     });
 }
Esempio n. 2
0
        public void Load(TetrisGameStateDto dto)
        {
            floor = Matrix2 <Tetromino> .Create(dto.Floor, Tetromino.GetByChar);

            State = dto.State;

            Active = new Piece(this, Tetromino.All.First(x => x.Name == dto.ActiveT))
            {
                Position = new VectorInt2(dto.ActiveX, dto.ActiveY),
                Rotation = dto.ActiveR
            };

            Speed = dto.Speed;
            Score = dto.Score;

            Next = Tetromino.GetByChar(dto.NextT);
        }
Esempio n. 3
0
 public Piece(TetrisGame game, Tetromino tetromino)
 {
     Game      = game;
     Tetromino = tetromino;
 }