This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-07-31 13:06:39

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Health Bar

How do you make a health bar? I would like to learn how you can make a health bar. If you could tell me it would be very helpful. Thanks!

Offline

 

#2 2011-07-31 13:30:30

Sidharth
Scratcher
Registered: 2007-12-14
Posts: 100+

Re: Health Bar

I made one here
Here's the .sprite file: http://www.mediafire.com/?k2y28dvt8668baa

To use: Change the slider for health (%)

If you use this, give credit if you like  smile

Last edited by Sidharth (2011-07-31 13:31:34)


http://www.danasoft.com/citysign.jpg

Offline

 

#3 2011-08-01 09:05:34

frizzlepuss893
Scratcher
Registered: 2011-06-10
Posts: 100+

Re: Health Bar

That's easy. Make different costumes for when  the health bar gets lower and lower health. So, the script might go like this, so for the bad guy, put in a script that says if touching player and attacking equals 2 (For kick. 1 for punch, probably), change health by (Whatever you want). Broadcast (Whatever you want). And for the health bar, put when i receive (Broadcast earlier) change costume # by (-1 or +1, depending on if your full health bar is top costume or bottom). Remember to put all the forms of the health bar and costumes in the right order.

Hope this helped.


"Wait, what?"-Frizzlepuss. Jumpathon 5! play now!
The scratch song! Congratulations scratch! 2 million projects!

Offline

 

#4 2011-08-01 16:38:25

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: Health Bar

frizzlepuss893 wrote:

That's easy. Make different costumes for when  the health bar gets lower and lower health. So, the script might go like this, so for the bad guy, put in a script that says if touching player and attacking equals 2 (For kick. 1 for punch, probably), change health by (Whatever you want). Broadcast (Whatever you want). And for the health bar, put when i receive (Broadcast earlier) change costume # by (-1 or +1, depending on if your full health bar is top costume or bottom). Remember to put all the forms of the health bar and costumes in the right order.

Hope this helped.

I found a more accurate way already

Offline

 

Board footer