Пример #1
0
        private void DrawPlayerInfo()
        {
            int mag = 30;

            spriteBatch.DrawString(font, (mag - Player.CurrentBullet).ToString(), new Vector2(ScreenSize.X - 100, 0), Color.White);
            //Draw the bullet amount
            spriteBatch.Draw(Bar, new Rectangle((int)ScreenSize.X - 110, 35, 110, 15), new Rectangle(0, 45, Bar.Width, 44), Color.Gray);
            //Draw the box around the  reloading bar
            spriteBatch.Draw(Bar, new Rectangle((int)ScreenSize.X - 110, 35, 110, 15), new Rectangle(0, 0, Bar.Width, 44), Color.White);
            //Draw the box inside the reloading bar

            if (!paused)
            {
                if (Reloading)
                {
                    spriteBatch.Draw(Bar, new Rectangle((int)ScreenSize.X - 110, 36, (int)(110 * ((double)ReloadDelay / 50)), 13), new Rectangle(0, 45, Bar.Width, 44), Color.Blue);
                }
                //draw the reloading process
            }

            spriteBatch.Draw(Bar, new Rectangle(10, 35, 110, 15), new Rectangle(0, 45, Bar.Width, 44), Color.Gray);
            //Draw the box around the health bar
            spriteBatch.Draw(Bar, new Rectangle(10, 35, 110, 15), new Rectangle(0, 0, Bar.Width, 44), Color.White);
            //Draw the current health level based on the current Health
            spriteBatch.Draw(Bar, new Rectangle((int)10, 36, (int)(Player.Health + 10), 13), new Rectangle(0, 45, Bar.Width, 44), Color.Red);

            spriteBatch.DrawString(font, "Kills:" + BodiesCount.ToString(), new Vector2(ScreenSize.X - 150, ScreenSize.Y - 50), Color.Red);
        }
Пример #2
0
        private void DrawPauseMenu()
        {
            if (Player.Alive)
            {
                spriteBatch.DrawString(font, "Press ESC to resume", new Vector2(ScreenSize.X / 2 - 150, ScreenSize.Y / 2 - 50), Color.Salmon);
            }
            if (!Player.Alive)
            {
                spriteBatch.DrawString(font, "The zombies got you!, you have managed to kill " + BodiesCount.ToString() + " Zombies!", new Vector2(ScreenSize.X / 2 - 500, ScreenSize.Y / 2 - 100), Color.Red);
            }

            spriteBatch.DrawString(font, "Press Q to quit to menu", new Vector2(ScreenSize.X / 2 - 150, ScreenSize.Y / 2), Color.Salmon);
            spriteBatch.DrawString(font, "Press R to play again", new Vector2(ScreenSize.X / 2 - 150, ScreenSize.Y / 2 + 50), Color.Salmon);
        }