Beispiel #1
0
        public void Draw(SpriteBatch spriteBatch)
        {
            if (!faderStart)
            {
                menu.Draw(spriteBatch);

                // player mon
                spriteBatch.Draw(game.level.player.pocketMonsters[0].sprite, new Rectangle(345, 300, 43, 38), Color.White);
                spriteBatch.DrawString(font, "Level: " + game.level.player.pocketMonsters[0].level.ToString(), new Vector2(390, 300), Color.Black);
                spriteBatch.DrawString(font, game.level.player.pocketMonsters[0].name, new Vector2(390, 320), Color.Black);
                spriteBatch.DrawString(font, game.level.player.pocketMonsters[0].currHealth.ToString() + "/" + game.level.player.pocketMonsters[0].MaxHP, new Vector2(350, 280), Color.Black);

                // enemy mon
                spriteBatch.Draw(enemyMon.sprite, new Rectangle(620, 200, 43, 38), Color.White);
                spriteBatch.DrawString(font, "Level: " + enemyMon.level.ToString(), new Vector2(665, 200), Color.Black);
                spriteBatch.DrawString(font, enemyMon.name, new Vector2(665, 120), Color.Black);
                spriteBatch.DrawString(font, enemyMon.currHealth.ToString() + "/" + enemyMon.MaxHP, new Vector2(625, 170), Color.Black);
            }

            if (faderStart)
            {
                spriteBatch.Draw(faderTexture, game.GraphicsDevice.Viewport.Bounds, new Color(Color.Black, (byte)MathHelper.Clamp(faderAlpha, 0, 255)));
                if (fadeIn)
                {
                    faderAlpha += faderAlphaIncrement;
                    if (faderAlpha >= 255)
                    {
                        fadeIn = false;
                    }
                }
                else
                {
                    faderAlpha -= faderAlphaIncrement;
                    if (faderAlpha <= 0)
                    {
                        fadeIn = true;
                    }
                }
                counter--;
            }
            if (counter <= 0)
            {
                faderStart = false;
            }
        }
 public void Draw(SpriteBatch spriteBatch)
 {
     game.level.Draw(spriteBatch);
     menu.Draw(spriteBatch);
 }