//initilize the base state of the player. static public void Initalize(SpriteBatch sprite) { hpDisplay = new PrintText(font, 25, 25); currencyDisplay = new PrintText(font, 25, 50); spriteBatch = sprite; hpDisplay.Print(spriteBatch, "Hp: " + hp); currencyDisplay.Print(spriteBatch, "Coins: " + currency); }
//draws the hp and currency counters to the screen. public static void draw(SpriteBatch spriteBatch) { hpDisplay.Print(spriteBatch, "Hp: " + hp); currencyDisplay.Print(spriteBatch, "Coins: " + currency); if (hp < 1) { PrintText deathText = new PrintText(font, 600, 600); deathText.Print(spriteBatch, "Game Over please press esc to go back to the menu and select a new map"); } }