Hello I am very new to scratch and the forums.
I am very sorry if this has been asked before but I have been searching on the forums and other projects for a long time and they just made me even more confused.
My game is basically one character killing other creatures.
I want to know an easy way to make a health bar that (preferable) follows the enemy around as it moves. That will decrease by a different amount depending on what type of bullet the 'hero' character uses on it. sorry if its confusing but any ideas?
Also I have had to start my game from the start TWICE now because is said the key cannot be found file corrupt. I know how it happened just wondering if there's any way to fix it.
thank you for reading and if anyone has any suggestions then please comment.
Offline
just make a sprite of the health bar and set it to forever go to the enemies
Offline
You can make the health bar part of the sprite, so when you make a character just put a Healthbar above it. Then you make multiple costumes and ha e the sprite switch costumes when it gets hit. If its something stronger you can change its costume twice.
Offline
thankyou everyone for your help. I had sort of done what you said turkey3 but i had done it allot more complicated resulting in about 40 different scripts just for damage i have now changed it to your simpler method thank you.
Offline
Here's a gallery of health bar projects that you might find helpful
http://scratch.mit.edu/galleries/view/71750
Offline
Ok. You make a variable, then, add a health bar over the enemy's head. The script would look like this:
when gf clicked forever go to Enemy 1 change y by 50Whenever the bullet touches the enemy, the enemy would lose health points from the variable. Read the scripts in Street War for more details.
Last edited by Haiming (2012-03-14 20:57:12)
Offline
probably make a variable. If you say like: forever, if touching sprite: Arrow/bullet, change variable: Health by -1. Hope that helps!
Offline
Haiming the script that you suggested seem to just cause the health bar to go the the top of the enemy and then flash around a bit not sure why though. I think i am just going to make a health bar with different costumes and use . forever if lighting is touching enemy1 change costume.
and so on...
also could i just upload my game then take it down after so people can suggest how to improve it?
Offline
Sorry if this fails, but here goes
when gf clicked forever set x to [x position of npc] set y to [y position of npc] + [50] end...after lots and lots of editing, that works (kinda), so I think you get the picture.
Last edited by MrScoop (2012-03-18 12:20:51)
Offline
I programmed a health bar in my Skydiving game. Its is different than these:
http://scratch.mit.edu/projects/art-on-black/2041499
I used a seperate sprite that stamped black on a part of the background that was a health bar.
Download it to see what I mean.
Offline