Beispiel #1
0
        public override void Draw(GameTime gameTime)
        {
            float elapsedTime = (float)gameTime.ElapsedGameTime.TotalSeconds;

            for (int i = 0; i < enemies.Length; i++)
            {
                Enemy enemy = enemies[i];
                if (enemy.Active)
                {
                    cam.Draw(gameTime, "robot", spriteBatch, enemy.Position);
                }
            }

            base.Draw(gameTime);
        }
Beispiel #2
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            graphics.GraphicsDevice.Clear(Color.CornflowerBlue);

            spriteBatch.Begin();
            cam.Draw(gameTime, "enemy1", spriteBatch, new Vector2(50, 50));
            cam.Draw(gameTime, "enemy2", spriteBatch, new Vector2(150, 75));
            cam.Draw(gameTime, "enemy3", spriteBatch, new Vector2(70, 130));

            cam.Draw(gameTime, "complex1", spriteBatch, new Vector2(400, 50));
            cam.Draw(gameTime, "complex2", spriteBatch, new Vector2(400, 150));
            cam.Draw(gameTime, "complex3", spriteBatch, new Vector2(400, 250));
            cam.Draw(gameTime, "complex4", spriteBatch, new Vector2(400, 350));
            spriteBatch.End();

            base.Draw(gameTime);
        }
Beispiel #3
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            graphics.GraphicsDevice.Clear(Color.Black);

            spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive);

            cam.Draw(gameTime, "explosion", spriteBatch, new Vector2(32, 32));
            cam.Draw(gameTime, "explosion2", spriteBatch, new Vector2(40, 40));
            cam.Draw(gameTime, "explosion3", spriteBatch, new Vector2(64, 32));
            cam.Draw(gameTime, "explosion4", spriteBatch, new Vector2(64, 64));
            cam.Draw(gameTime, "explosion5", spriteBatch, new Vector2(28, 40));
            cam.Draw(gameTime, "explosion6", spriteBatch, new Vector2(40, 64));

            cam.Draw(gameTime, "bigexplosion", spriteBatch, new Vector2(150, 150));
            spriteBatch.End();


            base.Draw(gameTime);
        }
Beispiel #4
0
        public override void Draw(GameTime gameTime)
        {
            switch (simpleGame.State)
            {
            case SimpleGame.GameState.Scene:
            {
                foreach (Explosion explosion in explosions.Values)
                {
                    cam.Draw(gameTime, "explosion4", spriteBatch,
                             explosion.Position);
                }
                break;
            }

            case SimpleGame.GameState.StartMenu:
            {
                //we can add our explosions to make our title page pop
                cam.Draw(gameTime, "explosion", spriteBatch,
                         new Vector2(32, 32));
                cam.Draw(gameTime, "explosion2", spriteBatch,
                         new Vector2(40, 40));
                cam.Draw(gameTime, "explosion3", spriteBatch,
                         new Vector2(64, 32));
                cam.Draw(gameTime, "explosion4", spriteBatch,
                         new Vector2(64, 64));
                cam.Draw(gameTime, "explosion5", spriteBatch,
                         new Vector2(28, 40));
                cam.Draw(gameTime, "explosion6", spriteBatch,
                         new Vector2(40, 64));

                cam.Draw(gameTime, "explosion", spriteBatch,
                         new Vector2(432, 32));
                cam.Draw(gameTime, "explosion2", spriteBatch,
                         new Vector2(440, 40));
                cam.Draw(gameTime, "explosion3", spriteBatch,
                         new Vector2(464, 32));
                cam.Draw(gameTime, "explosion4", spriteBatch,
                         new Vector2(464, 64));
                cam.Draw(gameTime, "explosion5", spriteBatch,
                         new Vector2(428, 40));
                cam.Draw(gameTime, "explosion6", spriteBatch,
                         new Vector2(440, 64));

                cam.Draw(gameTime, "bigexplosion", spriteBatch,
                         new Vector2(250, 330));
                break;
            }
            }
            base.Draw(gameTime);
        }
Beispiel #5
0
        public override void Draw(GameTime gameTime)
        {
            cam.Draw(gameTime, CurrentAnimation, spriteBatch, Position);

            base.Draw(gameTime);
        }