I am semi-new to Scratch, I think it's really cool. But, I am having trouble with "Lives". I am making a sequel to my game, "The Adventures of Pancake Man," and I wanted lives in this one. How do I make 3 lives for Pancake Man whenever he touches the "evil syrup?" And when his lives get to 0, how do I make it game over?
Please help!!
Thank you,
gooseman
Offline
Try this:
<when green flag clicked>
<forever>
<if> <touching[ Evil Syrup
<change{ Lives }by( -1
<end>
<end>
[/blocks]
Hope I helped!
Last edited by Chatter (2010-01-25 22:15:21)
Offline
You need to make a variable. Go to the variables pallet and click on create new variable. Name it lives.
Now you need to add these scripts to your program:
[blocks]
<when green flag clicked>
<set{ lives }to( 3 or however many lives you have in this game
^ This resets your lives
<when green flag clicked>
<forever>
<if><touching[ evil syrup
<change{ lives }by( -1
<wait until><< <not> <touching[ evil syrup >>
<end>
<end>
^ This makes it so each time you touch the evil syrup, you loose a life
Finally:
<when green flag clicked>
<forever>
<if><( <{ lives }> <=>0 )>
<stop all>
<end>
<end>
[/blocks]
Hope that helps!
Last edited by greenflash (2010-01-25 22:18:26)
Offline