예제 #1
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)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            spriteBatch.Begin();

            if (gameState == GameStates.TitleScreen)
            {
                spriteBatch.Draw(
                    titleScreen,
                    new Rectangle(0, 0, 800, 600),
                    Color.White);
            }

            if ((gameState == GameStates.Playing) ||
                (gameState == GameStates.WaveComplete) ||
                (gameState == GameStates.GameOver))
            {
                TileMap.Draw(spriteBatch);
                WeaponManager.Draw(spriteBatch);
                Player.Draw(spriteBatch);
                EnemyManager.Draw(spriteBatch);
                EffectsManager.Draw(spriteBatch);
                GoalManager.Draw(spriteBatch);

                checkPlayerDeath();

                spriteBatch.DrawString(
                    pericles14,
                    "Score: " + GameManager.Score.ToString(),
                    new Vector2(30, 5),
                    Color.White);

                spriteBatch.DrawString(
                    pericles14,
                    "Terminals Remaining: " +
                    GoalManager.ActiveTerminals,
                    new Vector2(520, 5),
                    Color.White);
            }

            if (gameState == GameStates.WaveComplete)
            {
                spriteBatch.DrawString(
                    pericles14,
                    "Beginning Wave " +
                    (GameManager.CurrentWave + 1).ToString(),
                    new Vector2(300, 300),
                    Color.White);
            }

            if (gameState == GameStates.GameOver)
            {
                spriteBatch.DrawString(
                    pericles14,
                    "G A M E O V E R!",
                    new Vector2(300, 300),
                    Color.White);
            }

            spriteBatch.End();

            base.Draw(gameTime);
        }