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

#1 2009-10-26 16:55:59

cod4person
Scratcher
Registered: 2009-10-26
Posts: 2

How Do I

i've been makeing a progect call zombie run and i've put health on as a variable but i dont know how to make my guy die plz help me

Offline

 

#2 2009-10-26 17:18:27

Ralphjos
Scratcher
Registered: 2009-10-10
Posts: 100+

Re: How Do I

Inorder to make the guy die,

When flag clicked
Forever
     If Health = 0
        (insert death script)
        Stop all

That should do it!

    Regards,
       Ralphjos


http://i33.tinypic.com/2dt3j9j.gif

Offline

 

#3 2009-10-26 17:22:48

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: How Do I

Yup. And for him to lose health, use:

When Green Flag Clicked                                                                                      Forever if touching what ever kills him                                                           
change health by -1 (it an be any number, depending on how much health you want him to lose )
wait 0.1 secs


Hai.

Offline

 

#4 2009-10-27 19:09:05

steppenwulf
Scratcher
Registered: 2009-07-23
Posts: 1000+

Re: How Do I

fg123 wrote:

Yup. And for him to lose health, use:

When Green Flag Clicked                                                                                      Forever if touching what ever kills him                                                           
change health by -1 (it an be any number, depending on how much health you want him to lose )
wait 0.1 secs

Unless you give him a ton of health, 0.1 seconds seems a bit fast don't you think?

I would do this:

Make a variable called health.

<when green flag clicked>
<set{ health }to( 100

Suppose you make the zombies green. Then you insert on your guy:

<when green flag clicked>
<forever if><touching color[ whatever color the zombies are
<wait( .2 )secsc>
<change{ health }by( -1
<end>

Then:

<when green flag clicked>
<wait until><( health <=> 0 )>
<broadcast[ Die

<when I receive[ Die
<stop all>

Last edited by steppenwulf (2009-10-27 20:39:04)


I'm graduating HS this April and going to college in the Fall.

Offline

 

#5 2009-10-27 20:38:46

steppenwulf
Scratcher
Registered: 2009-07-23
Posts: 1000+

Re: How Do I

Whoops my bad. Thanks for noticing, urhungry.  smile


I'm graduating HS this April and going to college in the Fall.

Offline

 

Board footer