Hi,
So I've finished adding HP/MP/EXP bars into my HUD, however, I have a problem, the EXP bar, after levelling up, doesn't go back to 0, and I THINK I know why;
Say at level 1, you need 10 EXP to level up, then at level 2 you need 30 EXP to level up,
The EXP Bar works throughout level 1, going up by the right amount, but when it gets to level 2, the bar sets itself 1/3 of the way into the bar (Hard to understand ?)
When I go into Status, I see it says I have 10 EXP, and need 30 EXP to level, so what the bar is showing me, is how much EXP I have, out of how much I need to level (10/30, 1/3 of the bar as said.)
Here's the code for the EXP bar;
If it can't be fixed, is there a way I can make it so once I level up, the current EXP is reset to 0 ? (Much like World of Warcraft, when you level up, your EXP goes back to 0),
Thanks.
So I've finished adding HP/MP/EXP bars into my HUD, however, I have a problem, the EXP bar, after levelling up, doesn't go back to 0, and I THINK I know why;
Say at level 1, you need 10 EXP to level up, then at level 2 you need 30 EXP to level up,
The EXP Bar works throughout level 1, going up by the right amount, but when it gets to level 2, the bar sets itself 1/3 of the way into the bar (Hard to understand ?)
When I go into Status, I see it says I have 10 EXP, and need 30 EXP to level, so what the bar is showing me, is how much EXP I have, out of how much I need to level (10/30, 1/3 of the bar as said.)
Here's the code for the EXP bar;
Code:
Â
 def draw_expbar(actor, x, y)
  back = Cache.system(Base)
  cw = back.width
  ch = back.height
  src_rect = Rect.new(0, 0, cw, ch)
  self.contents.blt(x, y, back, src_rect)
  return if actor.exp_s <= 0
  meter = Cache.system(EXP_Bar)
  cw = meter.width * actor.exp_s / actor.next_rest_exp_s
  ch = meter.height
  src_rect = Rect.new(0, 0, cw, ch)
  self.contents.blt(x, y, meter, src_rect)
 end
Â
If it can't be fixed, is there a way I can make it so once I level up, the current EXP is reset to 0 ? (Much like World of Warcraft, when you level up, your EXP goes back to 0),
Thanks.