I've successfully recreated this (as much as intended upon doing so) and even added a few things. However, how would one go about creating a regenerating health bar (where the current hp variable would increase by 1 hp every, say, three seconds). Also, I'd like it if the hp bar would flash upon the current hp variable dropping. (It can't be dependent on the button, else it wouldn't work in a real situation.)
Personaly, I'd have two variables instead of one. hp and maxHp. That way when you put code it the bar you just say something like: this.scaleX = root.hp*(100/maxHp).
When you hit next level it could just say something like "maxHp += random(50);
hp = maxHp"
and for ninefd
"bar.gotoAndStop(hp)"
something like that, I'm not as good with as2 as as3.
Instead of scaling it, how would i go about making it change frame, i have a 100 frame hp bar that i have created some effects that i would prefer over a green box.
what if I don't want it to let the number go negative and instead, there will be a window appearing or nothing happens?
paolaruga123 2 months ago
You're using AS2, if I'm not mistaken, yes?
brandonrugzie 10 months ago
I've successfully recreated this (as much as intended upon doing so) and even added a few things. However, how would one go about creating a regenerating health bar (where the current hp variable would increase by 1 hp every, say, three seconds). Also, I'd like it if the hp bar would flash upon the current hp variable dropping. (It can't be dependent on the button, else it wouldn't work in a real situation.)
SSCeles 1 year ago
Best one i've seen! Keep up the good work (Y)
FuIIySick 1 year ago
ok! wen it reaches zero it goes 2 the next bar... how u do that?
Renkay141 2 years ago
Comment removed
Renkay141 2 years ago
Personaly, I'd have two variables instead of one. hp and maxHp. That way when you put code it the bar you just say something like: this.scaleX = root.hp*(100/maxHp).
When you hit next level it could just say something like "maxHp += random(50);
hp = maxHp"
and for ninefd
"bar.gotoAndStop(hp)"
something like that, I'm not as good with as2 as as3.
Overall, a pretty good tutorial.
TheLegendaryQ 2 years ago
Instead of scaling it, how would i go about making it change frame, i have a 100 frame hp bar that i have created some effects that i would prefer over a green box.
ninefd 2 years ago
@ninefd its hard but it makes sense its tru
Renkay141 2 years ago
@ninefd bar.gotoAndStop(Math.ceil(maxHealth/health*100));
adamkyler 1 year ago