Health Bar

9 posts

Flag Post

I was wondering what would be the easiest way to make a health bar move

 
Flag Post

The Shootorials cover this.

 
Flag Post

Or this

 
Flag Post

The shootorials are in as2 and the other one is confusing.

 
Flag Post

Step 1: Draw a box, typically black, to be the background

Step 1a: Draw a border around the black box.

Step 2: Draw another box directly on top of the black box, typically red, to represent the player’s health

Step 3: Set the scaleX of the red box to player.currentHealth / player.maxHealth every time the player’s health is increased or decreased.

 
Flag Post

Don’t forget to make the bar movieclip’s registration point on the left side if you want the bar to scale to the left when the player loses health.

 
Flag Post

Thank you I think I get the general jist of how to do it.

 
Flag Post
Originally posted by Draco18s:

Or this

^ Tutorial.
It uses AS2 in the code snippets, but it’s like 8 lines and trivial to convert to AS3.

 
Flag Post
Originally posted by Draco18s:
Originally posted by Draco18s:

Or this

^ Tutorial.
It uses AS2 in the code snippets, but it’s like 8 lines and trivial to convert to AS3.

You need to remember this is someone who doesn’t even know how to code a health bar- this may not be trivial to him/her.