Exemplo n.º 1
0
        public GameArea(Stats.Stats stats, ContentManager content, SoundControl soundControl)
        {
            texture      = content.Load <Texture2D>("field");
            bgPosition   = new Vector2(X + OFFSET_X, Y + OFFSET_Y);
            slots        = new BlockSlot[WIDTH, HEIGHT];
            this.content = content;
            this.stats   = stats;

            for (int i = 0; i < WIDTH; i++)
            {
                for (int j = 0; j < HEIGHT; j++)
                {
                    slots[i, j] = new BlockSlot(i, j, X, Y);
                }
            }

            tetrimino = new Tetrimino(Tetrimino.GenerateType(null), content, soundControl);
            PrepareNextTetrimino();
            canHold           = true;
            this.soundControl = soundControl;
        }
Exemplo n.º 2
0
 private void PrepareNextTetrimino()
 {
     next = Tetrimino.GenerateType(tetrimino.Type);
     stats.Next.Set(next);
 }