Exemple #1
0
 public Tetromino(Gameboard parent)
 {
     Parent    = parent;
     Position  = Vector2.Zero;
     Blocks    = new List <Block>();
     SpinState = SpinState.Zero;
 }
Exemple #2
0
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            gameboard    = new Gameboard(gameboardTexture, new Vector2(WINDOW_WIDTH / 2 - 19 / 2 * Tetromino.WIDTH, WINDOW_HEIGHT / 2 - 25 / 2 * Tetromino.HEIGHT), new Vector2(19, 25));
            currentPiece = Tetromino.T(gameboard, redBlockTexture);
            gameboard.SetCurrentPiece(currentPiece);
        }
Exemple #3
0
 public TTetrimino(Gameboard parent, Texture2D texture)
     : base(parent)
 {
     Size   = new Vector2(2, 2);
     Blocks = new List <Block>()
     {
         new Block(this, texture, new Vector2(1, 0)),
         new Block(this, texture, new Vector2(0, 1)),
         new Block(this, texture, new Vector2(1, 1)),
         new Block(this, texture, new Vector2(2, 1))
     };
 }
Exemple #4
0
 public static Tetromino T(Gameboard parent, Texture2D texture)
 {
     return(new TTetrimino(parent, texture));
 }