Esempio n. 1
0
  public static void DrawExp() {
    int denominator;
    int numerator;
    if (PlayerLevel < MAX_LEVEL) {
      denominator = EXP_LIST[PlayerLevel] - EXP_LIST[PlayerLevel - 1];
      numerator =
          CurrentExp
              - EXP_LIST[PlayerLevel - 1]; // Works when PlayerLeve = 1 because EXP_LIST[0] = 0
    } else {
      denominator = EXP_LIST[MAX_LEVEL];
      numerator = EXP_LIST[MAX_LEVEL];
    }
    DrawQuadTexAlpha(
        ExpBarBackground,
        0,
        HEIGHT - 32,
        ExpBarBackground.getImageWidth(),
        ExpBarBackground.getImageHeight(),
        .5f);
    DrawQuadTexAlpha(
        ExpBarForeground,
        0,
        HEIGHT - 32,
        ExpBarForeground.getImageWidth() * numerator / denominator,
        ExpBarForeground.getImageHeight(),
        .5f);
    DrawQuadTex(
        ExpBarBorder, 0, HEIGHT - 32, ExpBarBorder.getImageWidth(), ExpBarBorder.getImageHeight());

    Game.GameFont.drawString(WIDTH / 2, HEIGHT - 31, numerator + "/" + denominator, Color.white);
  }
Esempio n. 2
0
 public static void DrawLives() {
   Game.GameFont.drawString(
       WIDTH * .88f - 4, HEIGHT * .9f, "Lives: " + Integer.toString(Lives), Color.red);
 }
Esempio n. 3
0
 public static void DrawLevel() {
   Game.GameFont.drawString(
       WIDTH * .88f - 4, HEIGHT - 31, "Player Level: " + PlayerLevel, Color.white);
 }
Esempio n. 4
0
 public static void DrawCash() {
   Game.GameFont.drawString(
       WIDTH * .88f - 4, HEIGHT * .93f, "Cash: $" + Integer.toString(Cash), Color.green);
 }