コード例 #1
0
ファイル: Invaders.cs プロジェクト: timgarwood/invaders
        /// <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)
        {
            GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.Black);

            spriteBatch.Begin();

            var cameraPosition = Player.CalculateCamera(viewport);

            Background.DrawBackground(spriteBatch, cameraPosition, viewport);

            GameWorld.Draw(spriteBatch, cameraPosition, viewport);

            Hud.Draw(spriteBatch, viewport);

            if (GameState == GameStates.Paused)
            {
                CurrentMenu.Draw(spriteBatch, cameraPosition, viewport);
            }

            spriteBatch.End();

            base.Draw(gameTime);
        }