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

#1 2009-08-18 17:53:42

waterbuddy16
Scratcher
Registered: 2009-08-18
Posts: 25

how do you make health bars?

How do you make health bars that are easy to use please help me  sad


http://img21.imageshack.us/img21/9258/awesomepu.gif The pentagon approves of my awesomeness. It doeshttp://dragcave.net/image/u9Sn.gifhttp://dragcave.net/image/mHJD.gif

Offline

 

#2 2009-08-18 18:12:05

adriangl
Scratcher
Registered: 2007-07-02
Posts: 1000+

Re: how do you make health bars?

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.


Scratchin' since 2007

Offline

 

#3 2009-08-18 19:18:30

waterbuddy16
Scratcher
Registered: 2009-08-18
Posts: 25

Re: how do you make health bars?

oh well I'm sorry about the advanced topic, i am a complete newbie  i just got the program yesterday and joined scratch today


http://img21.imageshack.us/img21/9258/awesomepu.gif The pentagon approves of my awesomeness. It doeshttp://dragcave.net/image/u9Sn.gifhttp://dragcave.net/image/mHJD.gif

Offline

 

#4 2009-08-18 20:39:11

adriangl
Scratcher
Registered: 2007-07-02
Posts: 1000+

Re: how do you make health bars?

waterbuddy16 wrote:

oh well I'm sorry about the advanced topic, i am a complete newbie  i just got the program yesterday and joined scratch today

Don't worry, you'll get your way  big_smile


Scratchin' since 2007

Offline

 

#5 2009-08-19 10:15:47

waterbuddy16
Scratcher
Registered: 2009-08-18
Posts: 25

Re: how do you make health bars?

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


http://img21.imageshack.us/img21/9258/awesomepu.gif The pentagon approves of my awesomeness. It doeshttp://dragcave.net/image/u9Sn.gifhttp://dragcave.net/image/mHJD.gif

Offline

 

#6 2009-08-19 10:22:18

adriangl
Scratcher
Registered: 2007-07-02
Posts: 1000+

Re: how do you make health bars?

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.


Scratchin' since 2007

Offline

 

#7 2009-08-19 10:27:59

WeirdF
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: how do you make health bars?

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.


http://i.cr3ation.co.uk/dl/s1/gif/847032b8a331def77529b6a0384db1fe_handfingers.gif

Offline

 

#8 2009-08-19 10:52:16

adriangl
Scratcher
Registered: 2007-07-02
Posts: 1000+

Re: how do you make health bars?

WeirdF- I meant to say costumes, not sprites, sorry.

Waterbuddy- Your Health Bar Help Project


Scratchin' since 2007

Offline

 

#9 2009-08-19 11:22:13

waterbuddy16
Scratcher
Registered: 2009-08-18
Posts: 25

Re: how do you make health bars?

thank you  big_smile


http://img21.imageshack.us/img21/9258/awesomepu.gif The pentagon approves of my awesomeness. It doeshttp://dragcave.net/image/u9Sn.gifhttp://dragcave.net/image/mHJD.gif

Offline

 

#10 2009-08-19 18:08:59

cds56
Scratcher
Registered: 2008-05-02
Posts: 500+

Re: how do you make health bars?

WAterbuddy, do you want me to make you a PEN health bar???!?!??!


http://img192.imageshack.us/img192/909/meowdevlogo.pnghttp://i32.tinypic.com/pucti.png

Offline

 

#11 2009-08-19 22:08:09

waterbuddy16
Scratcher
Registered: 2009-08-18
Posts: 25

Re: how do you make health bars?

uhhh...
whats a pen health bar, i knowes about de pen tools, and health bar stuff, but what's pen health bar?


http://img21.imageshack.us/img21/9258/awesomepu.gif The pentagon approves of my awesomeness. It doeshttp://dragcave.net/image/u9Sn.gifhttp://dragcave.net/image/mHJD.gif

Offline

 

#12 2009-08-19 22:26:45

waterbuddy16
Scratcher
Registered: 2009-08-18
Posts: 25

Re: how do you make health bars?

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  smile
stay tuned I will post a link soon...

Last edited by waterbuddy16 (2009-08-19 22:27:39)


http://img21.imageshack.us/img21/9258/awesomepu.gif The pentagon approves of my awesomeness. It doeshttp://dragcave.net/image/u9Sn.gifhttp://dragcave.net/image/mHJD.gif

Offline

 

#13 2009-08-20 14:50:56

waterbuddy16
Scratcher
Registered: 2009-08-18
Posts: 25

Re: how do you make health bars?

here's the link to the game  big_smile
http://scratch.mit.edu/projects/waterbuddy16/653915


http://img21.imageshack.us/img21/9258/awesomepu.gif The pentagon approves of my awesomeness. It doeshttp://dragcave.net/image/u9Sn.gifhttp://dragcave.net/image/mHJD.gif

Offline

 

#14 2009-08-23 22:13:47

llanier
Scratcher
Registered: 2008-12-09
Posts: 9

Re: how do you make health bars?

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

 

#15 2009-08-24 11:28:56

Mawile
Scratcher
Registered: 2009-04-21
Posts: 100+

Re: how do you make health bars?

I'd go with llanier but it's a lilttle confusing


I'm Registeel, Sadly i forgot my password :'(
http://img197.imageshack.us/img197/9941/cooking.jpghttp://img194.imageshack.us/img194/9608/telescopeweegee.jpg

Offline

 

#16 2009-08-25 20:04:27

Brass45
Scratcher
Registered: 2009-05-03
Posts: 500+

Re: how do you make health bars?

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 sad  wherever the rectangle begins)y sad  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)


http://img412.imageshack.us/img412/4593/ubd1591.png<--Our website(click)
http://static.zooomr.com/images/8884671_b196719ffa_o.png<--If this image looks interesting,then click it to see an exclusive sneak peak of Evil Strings newest game:DarkLight

Offline

 

#17 2010-04-01 03:52:25

azzza
Scratcher
Registered: 2010-03-05
Posts: 3

Re: how do you make health bars?

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

 

#18 2010-04-01 06:39:16

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: how do you make health bars?

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  smile

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!


http://i39.tinypic.com/2nav6o7.gif

Offline

 

Board footer