Added: 2 years ago
From: PivotyPivoty
Views: 1,638
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (10)

Sign In or Sign Up now to post a comment!
  • what if I don't want it to let the number go negative and instead, there will be a window appearing or nothing happens?

  • You're using AS2, if I'm not mistaken, yes?

  • 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.)

  • Best one i've seen! Keep up the good work (Y)

  • ok! wen it reaches zero it goes 2 the next bar... how u do that?

  • Comment removed

  • 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.

  • 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 its hard but it makes sense its tru

  • @ninefd bar.gotoAndStop(Math.ceil(maxH­ealth/health*100));

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more