How do you make health bars that are easy to use please help me
Offline
This isn't really an advanced topic, so this should be in All About Scratch.
Anyways, you wanna start out make a health bar sprite. Well, several of them. Each one a little less than the one before, so if the health goes down, the bar will go down.
Then, you want to make a variable called health. Then, there are many ways to go on. If it is a shooting game, you could make a script like <if>bullet<touching>player<brodcast lower> <--That's for the player
Then, for the health bar, you want to make a script like when green flag clicked, set costume to 1. Then <When I receive>lower<next costume>
This is a stupid way, it was just in my head.
Offline
oh well I'm sorry about the advanced topic, i am a complete newbie i just got the program yesterday and joined scratch today
Offline
and do you have any advice for like once reached the final costume which is death how it would stop and not go back to the beginning. that's what keeps happening to me.
this is what i have<when I receive[ broadcast for being hit<next costume>
what do i do so it switches from full bar to empty bar then do <stop all> at end
Offline
Well, you might want to make another sprite with the text like "You died" . That sprite, make the scripts when green flag clicked hide. When I receive "No Health" show and stop all. It's kind of hard for me to explain with text, so I will make a project template for you.
Offline
adriangl wrote:
Anyways, you wanna start out make a health bar sprite. Well, several of them.
No, you need to make costumes, there's no point in making lots of different sprites for each time you lose health.
Offline
WeirdF- I meant to say costumes, not sprites, sorry.
Waterbuddy- Your Health Bar Help Project
Offline
uhhh...
whats a pen health bar, i knowes about de pen tools, and health bar stuff, but what's pen health bar?
Offline
posted Wednesday, August 19, 2009
Thursday, August 20, 2009
(in other words tomorrow)
is when I'm officially posting my first game, and it uses stuff u guys posted to help me
stay tuned I will post a link soon...
Last edited by waterbuddy16 (2009-08-19 22:27:39)
Offline
here's the link to the game
http://scratch.mit.edu/projects/waterbuddy16/653915
Offline
heres a project to help out:
http://scratch.mit.edu/projects/Tutorial_Maker/232059
change this though
[blocks]repeat until><(<{ health}> <=> <{health max }> )><stamp><move( 1)steps>
<change{ <{health }> }by( 1)>
[/blocks]
Offline
It's not too hard to make a health bar.First,on the background,use the rectangle tool to make a rectangle of some sort of color.Now make a sprite that will change the health.It should be a line that is not as tall as the rectangle with two costumes,one the same color as the rectangle and the other a diffrent color.now make this script:[blocks]<when green flag clicked><go to x wherever the rectangle begins)y
wherever the rectangle begins<switch to costume[ 1<clear><repeat( 100<stamp><change x by( 1<switch to costume[ 2<set{ health }to( whatever needed<when I receive[ damaged<repeat( 10<stamp><change x by( -1<change{health }by( you choose<when green flag clicked><forever if><( health <<> 1 )><stop all>I Believe this was earlier called a Pen Health Bar in someone elses post.I hope that helped.
Last edited by Brass45 (2009-08-26 12:21:19)
Offline
waterbuddy16 wrote:
and do you have any advice for like once reached the final costume which is death how it would stop and not go back to the beginning. that's what keeps happening to me.
this is what i have<when I receive[ broadcast for being hit<next costume>
what do i do so it switches from full bar to empty bar then do <stop all> at end
you need to have it on the last bar tha t is empty and have the script that say (you need to add the health and the 0) forever if: health=0, under thqat put the command stop all or stop script (which will only stop the bars
Offline
azzza wrote:
you need to have it on the last bar tha t is empty and have the script that say (you need to add the health and the 0) forever if: health=0, under thqat put the command stop all or stop script (which will only stop the bars
Hi azzza! Welcome to the forums and thanks for helping out - that's what the forums are all about
Do be careful to check the dates of the topics that you are responding to though...if they are more than a couple of months old, chances are that the person that posted it has already found a solution or they would have bumped their topic (put another post on it to change the date and bring it back to the top of the list of topics).
You can learn more useful things about using the forums here:
http://scratch.mit.edu/forums/viewtopic.php?id=27550
Thanks and Scratch on!
Offline