Beispiel #1
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            TileDrawer.InitAssets(this);
            PlayerDrawer.InitAssets(this);
            EnemyDrawer.LoadAssets(this);

            screenPool = new ScreenPool(this);

            this.musicPlayer = new MusicPlayer(this);
            SoundPlayer.InitAssets(this);

            Animator.InitAssets(this);
            InfoDrawer.LoadAssets(this);
        }
Beispiel #2
0
        protected override void Update(GameTime gameTime)
        {
            DeltaUpdate = gameTime.ElapsedGameTime.Milliseconds;

            this.screenPool.CallGuiControlUpdates(this);

            if (this.screenPool.screenState == ScreenPool.ScreenState.Playing)
            {
                this.levelData.Update(this);
                PlayerDataManager.Update();
                EnemyDrawer.UpdateTicks(Minijam32.DeltaUpdate);
            }

            musicPlayer.Update(this);

            base.Update(gameTime);
        }
Beispiel #3
0
        public void DrawBelow(Minijam32 game, SpriteBatch batch)
        {
            //Tiles
            for (int x = tileGrid.GetLength(0) - 1; x >= 0; x--)
            {
                for (int y = tileGrid.GetLength(1) - 1; y >= 0; y--)
                {
                    TileDrawer.DrawTileAt(batch, tileGrid[x, y].type, new Point(x, y));
                }
            }

            //Bombs
            foreach (var location in this.plantedBombs.Keys)
            {
                int bombFuseCh = (int)(this.plantedBombs[location]);

                if (bombFuseCh > 1000)
                {
                    if ((bombFuseCh / 100) % 5 == 0)
                    {
                        TileDrawer.DrawTileAt(batch, TileData.Type.BombOne, location);
                    }
                    else
                    {
                        TileDrawer.DrawTileAt(batch, TileData.Type.BombTwo, location);
                    }
                }
                else
                {
                    if ((bombFuseCh / 100) % 2 == 0)
                    {
                        TileDrawer.DrawTileAt(batch, TileData.Type.BombOne, location);
                    }
                    else
                    {
                        TileDrawer.DrawTileAt(batch, TileData.Type.BombTwo, location);
                    }
                }
            }

            //Enemies
            foreach (var enemy in this.enemies)
            {
                EnemyDrawer.DrawThisTypeAt(batch, enemy);
            }
        }