Esempio n. 1
0
        public Block(int[,] tileset, Color col, TetrisGameB g)
        {
            Game = g;
            this.SetLocation(new Point((Game.Width / 2) - 2, 0));
            Tiles      = tileset;
            BlockColor = col;

            Falling = true;
            Sprite  = new SpriteBatch(g.Gr);
        }
Esempio n. 2
0
        public Block(Point loc, int[,] tileset, Color col, TetrisGameB g)
        {
            Game = g;
            this.SetLocation(loc);
            Tiles      = tileset;
            BlockColor = col;

            Falling = true;
            Sprite  = new SpriteBatch(g.Gr);
        }
Esempio n. 3
0
        public Block(Block b, TetrisGameB g)
        {
            this.Game = g;
            this.SetLocation(b.Location);
            this.DrawingLocation = b.DrawingLocation;

            this.Sprite     = b.Sprite;
            this.Tiles      = b.Tiles;
            this.BlockColor = b.BlockColor;
            this.Falling    = true;
        }
Esempio n. 4
0
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.

            spriteBatch = new SpriteBatch(GraphicsDevice);
            //Random rnd = new Random();
            mainGame = new TetrisGameB(new Point(0, 0), 10, 20, 16, 3, GraphicsDevice);

            mainGame.ClearBoard();

            // TODO: use this.Content to load your game content here
        }
Esempio n. 5
0
        private void NewGame(object sender, TetrisGameB.GameOverEventArgs e)
        {
            mainGame = new TetrisGameB(e.gLoc, e.gWidth, e.gHeight, e.gTileSize, e.gSeed, e.gGr);

            running = true;
        }