Пример #1
0
 /// <summary>
 /// Draws the player and his bullets
 /// </summary>
 /// <param name="rend">Renderer for drawing</param>
 public override void Draw(Renderer rend)
 {
     base.Draw(rend);
     foreach (Bullet b in ActiveBullets)
     {
         b.Draw(rend);
     }
 }
Пример #2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            prevKeyboardState = Keyboard.GetState();

            rend = new Renderer(GraphicsDevice);
            sManager = new EntityManager(GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height);

            base.Initialize();
        }
Пример #3
0
        public void Draw(Renderer rend)
        {
            // Draw the asteroids...
            foreach (Asteroid a in ActiveAsteroids)
            {
                a.Draw(rend);
            }

            //...the player...
            Player.Draw(rend);
        }
Пример #4
0
 /// <summary>
 /// Draws the entity.
 /// </summary>
 /// <param name="rend">Renderer to use for drawing</param>
 public virtual void Draw(Renderer rend)
 {
     rend.Draw(Body);
 }