示例#1
0
文件: Game1.cs 项目: lja83/games
        /// <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();
            TileMap.Draw(spriteBatch);
            Player.Draw(spriteBatch);
            spriteBatch.End();

            base.Draw(gameTime);
        }
示例#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)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            // TODO: Add your drawing code here
            spriteBatch.Begin();
            TileMap.Draw(spriteBatch);
            Player.Draw(spriteBatch);
            EffectsManager.Draw(spriteBatch);
            spriteBatch.End();

            base.Draw(gameTime);
        }
示例#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)
        {
            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(arialFont, "Score: " + GameManager.Score.ToString(), new Vector2(30, 5), Color.White);
                spriteBatch.DrawString(arialFont, "Terminals Remaining: " + GoalManager.ActiveTerminals, new Vector2(520, 5), Color.White);
            }

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

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