Ejemplo n.º 1
0
        public override void Draw(GameTime gameTime)
        {
            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
            SpriteFont  font        = ScreenManager.Font;

            // Darken down any other screens that were drawn beneath the popup.
            ScreenManager.FadeBackBufferToBlack(TransitionAlpha * 4 / 3);

            // Fade the popup alpha during transitions.
            Color color = Color.White * TransitionAlpha;


            spriteBatch.Begin();

            spriteBatch.Draw(background, new Rectangle(0, 0, background.Width, background.Height), color);
            spriteBatch.Draw(menuTitle, new Rectangle(400 - (menuTitle.Width / 2), 100, menuTitle.Width, menuTitle.Height), color);

            int y = 0;

            if (got == gameOverType.COMPLETE)
            {
                spriteBatch.Draw(gameOver, new Rectangle(400 - gameOver.Width / (2 * 2), 200, gameOver.Width / 2, gameOver.Height / 2), color);
            }
            else
            {
                spriteBatch.Draw(gameOver, new Rectangle(400 - gameOver.Width / (2 * 2), 200, gameOver.Width / 2, gameOver.Height / 2), color);
            }



            spriteBatch.End();

            exitButton.Draw(spriteBatch);
            mouse.Draw(spriteBatch);
        }
Ejemplo n.º 2
0
        public void Draw(SpriteBatch spriteBatch)
        {
            _mouse.Draw(spriteBatch);

            if (bulletList != null)
            {
                foreach (Bullet b in bulletList)
                {
                    b.Draw(spriteBatch);
                }
            }


            pSprite.Draw(spriteBatch, _playerPos, _playerRot);

            spriteBatch.Begin();
            spriteBatch.Draw(_healthIn, new Rectangle(10, 10, _healthIn.Width / 2, _healthIn.Height / 2), Color.Gray);
            spriteBatch.Draw(_healthIn, new Rectangle(10, 10, (int)(_healthIn.Width / 2 * ((double)_health / 100)), _healthIn.Height / 2), Color.Red);
            spriteBatch.Draw(_healthOut, new Rectangle(10, 10, _healthOut.Width / 2, _healthOut.Height / 2), Color.White);
            spriteBatch.End();
        }
Ejemplo n.º 3
0
        public override void Draw(GameTime gameTime)
        {
            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
            SpriteFont  font        = ScreenManager.Font;

            ScreenManager.FadeBackBufferToBlack(TransitionAlpha * 0.6f);


            Color color = Color.White * TransitionAlpha;

            spriteBatch.Begin();
            spriteBatch.Draw(gradientTexture, new Rectangle((400 - gradientTexture.Width / 2), 200, gradientTexture.Width, gradientTexture.Height), color);
            spriteBatch.End();

            mouse.Draw(spriteBatch);
        }
Ejemplo n.º 4
0
        public override void Draw(GameTime gameTime)
        {
            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
            SpriteFont  font        = ScreenManager.Font;

            // Fade the popup alpha during transitions.
            Color color = Color.White * TransitionAlpha;

            spriteBatch.Begin();
            spriteBatch.Draw(zombie, new Rectangle(0, 10, zombie.Width, zombie.Height), Color.White);
            spriteBatch.Draw(title, new Rectangle((800 / 2) - (title.Width / 2), 120, title.Width, title.Height), Color.White);
            spriteBatch.End();

            easyButton.Draw(spriteBatch);
            hardButton.Draw(spriteBatch);
            mouse.Draw(spriteBatch);
        }
Ejemplo n.º 5
0
        public override void Draw(GameTime gameTime)
        {
            GraphicsDevice graphics    = ScreenManager.GraphicsDevice;
            SpriteBatch    spriteBatch = ScreenManager.SpriteBatch;

            spriteBatch.Begin();
            spriteBatch.Draw(zombie, new Rectangle(0, 10, zombie.Width, zombie.Height), Color.White);
            spriteBatch.Draw(title, new Rectangle(800 / 2 - title.Width / 2, 100, title.Width, title.Height), Color.White);
            spriteBatch.DrawString(font, name, new Vector2(800 / 2 - name.Length * 8, 300), Color.White);



            spriteBatch.End();

            contButton.Draw(spriteBatch);
            mouse.Draw(spriteBatch);
        }
Ejemplo n.º 6
0
        public override void Draw(GameTime gameTime)
        {
            GraphicsDevice graphics    = ScreenManager.GraphicsDevice;
            SpriteBatch    spriteBatch = ScreenManager.SpriteBatch;
            SpriteFont     font        = ScreenManager.Font;

            spriteBatch.Begin();

            spriteBatch.Draw(background, new Rectangle(0, 10, background.Width, background.Height), Color.White);
            spriteBatch.Draw(title, new Rectangle(800 / 2 - title.Width / 2, 100, title.Width, title.Height), Color.White);
            spriteBatch.Draw(instructions, new Rectangle(400 - instructions.Width / 2, 200, instructions.Width, instructions.Height), Color.White);
            spriteBatch.End();

            exitButton.Draw(spriteBatch);
            mouse.Draw(spriteBatch);
            player.DrawSimple(spriteBatch);
        }
Ejemplo n.º 7
0
        public override void Draw(GameTime gameTime)
        {
            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
            SpriteFont  font        = ScreenManager.Font;


            ScreenManager.FadeBackBufferToBlack(TransitionAlpha * 4 / 3);
            Color color = Color.White * TransitionAlpha;



            int diffBonus;

            if (gameDiff == GameDifficulty.EASY_MODE)
            {
                diffBonus = 1;
            }
            else
            {
                diffBonus = 2;
            }

            int totalScore = score + ((10 * lives) * diffBonus);

            player.score = totalScore;

            String scoreString = String.Format("Level Score        :   {0:00}" +
                                               "\nLives Left         :   {1:00}" +
                                               "\nDifficulty Bonus   :   {2:00}" +
                                               "\n\nTOTAL SCORE        :   {3:00}"
                                               , score, lives, diffBonus, totalScore);

            spriteBatch.Begin();


            spriteBatch.Draw(background, new Rectangle(0, 10, background.Width, background.Height), color);
            spriteBatch.DrawString(font, scoreString, new Vector2(800 / 2 - 150, 250), Color.White);
            spriteBatch.Draw(gameOver, new Rectangle(800 / 2 - gameOver.Width / 2, 100, gameOver.Width, gameOver.Height), color);

            spriteBatch.End();

            exitButton.Draw(spriteBatch);
            mouse.Draw(spriteBatch);
        }
Ejemplo n.º 8
0
        public override void Draw(GameTime gameTime)
        {
            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
            SpriteFont  font        = ScreenManager.Font;

            ScreenManager.FadeBackBufferToBlack(TransitionAlpha * 4 / 3);
            Color color = Color.White * TransitionAlpha;


            spriteBatch.Begin();

            spriteBatch.DrawString(font, "#", new Vector2(200, 200), Color.White);
            spriteBatch.DrawString(font, "Name", new Vector2(360, 200), Color.White);
            spriteBatch.DrawString(font, "Score", new Vector2(520, 200), Color.White);

            Color c = Color.White;

            for (int i = 0; i < 10; i++)
            {
                int y = 220 + (i + 1) * 25;
                int j = i + 1;

                if (p != null && p.score == highScores.scores[i] && p.name == highScores.names[i])
                {
                    c = Color.Red;
                }
                else
                {
                    c = Color.White;
                }

                spriteBatch.DrawString(font, j.ToString(), new Vector2(200, y), c);
                spriteBatch.DrawString(font, highScores.names[i].ToUpper(), new Vector2(360, y), c);
                spriteBatch.DrawString(font, highScores.scores[i].ToString(), new Vector2(520, y), c);
            }
            spriteBatch.Draw(zombie, new Rectangle(0, 10, zombie.Width, zombie.Height), Color.White);
            spriteBatch.Draw(banner, new Rectangle((800 / 2) - (banner.Width / 2), 100, banner.Width, banner.Height), Color.White);

            spriteBatch.End();

            exitButton.Draw(spriteBatch);
            mouse.Draw(spriteBatch);
        }
Ejemplo n.º 9
0
        public override void Draw(GameTime gameTime)
        {
            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
            SpriteFont  font        = ScreenManager.Font;

            // Fade the popup alpha during transitions.
            Color color = Color.White * TransitionAlpha;

            spriteBatch.Begin();
            spriteBatch.Draw(zombie, new Rectangle(0, 10, zombie.Width, zombie.Height), Color.White);
            spriteBatch.End();


            highscoresButton.Draw(spriteBatch);
            newGameButton.Draw(spriteBatch);
            exitButton.Draw(spriteBatch);
            helpButton.Draw(spriteBatch);
            mouse.Draw(spriteBatch);
        }