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

#1 2009-03-14 06:39:38

Darkpulse
Scratcher
Registered: 2009-03-14
Posts: 8

lives system

i'd like to know how to set up a lives sytem i've tried a lot but i still dont know how to

This coding i got

sprite 1 coding (character)

<when green flag clicked>
<forever if><touching[ sprite 7 ]
<broadcast[ life loss ]
<play sound[ meow ]
<change[ ghost ]effect by( 30 )
<say[ ouch! ]for( 2 )secs>

sprite 8 coding (life)

<when I receive[ life loss ]
<hide>

but i dont know how to do each life in order so life 1 goes life 2 goes then life 3 goes
and then when life 3 goes it says game over (well i might actually still be able to make it say game over when it hides but still post all of it please)

thanks

Offline

 

#2 2009-03-14 17:24:05

daydreamgirl
Scratcher
Registered: 2009-02-20
Posts: 42

Re: lives system

Darkpulse wrote:

i'd like to know how to set up a lives sytem i've tried a lot but i still dont know how to

This coding i got

sprite 1 coding (character)

<when green flag clicked>
<forever if><touching[ sprite 7 ]
<broadcast[ life loss ]
<play sound[ meow ]
<change[ ghost ]effect by( 30 )
<say[ ouch! ]for( 2 )secs>

sprite 8 coding (life)

<when I receive[ life loss ]
<hide>

but i dont know how to do each life in order so life 1 goes life 2 goes then life 3 goes
and then when life 3 goes it says game over (well i might actually still be able to make it say game over when it hides but still post all of it please)

thanks

Are you saying that you have three icons that represent lives, and you want them to disappear in order each time the character loses a life?
If that's what you mean, you need to make sprite 8 have three costumes, one with three life icons, one with two, and one with one. You need to have the one with one icon first, then the one with two, and then the one with three. It also needs a for-all-sprites variable called Life (or whatever.)

Make it so clicking the green flag sets Life to 3 and tells Sprite 8 to switch to its third costume (with three life icons.) Then, add this code:

<when I receive[life loss
<change{Life}by( -1
<switch to costume[ <{ life }>
<if> <(<{ Life }><=> 0 )>
<hide>


Test Signature

Offline

 

#3 2009-03-15 05:39:46

Darkpulse
Scratcher
Registered: 2009-03-14
Posts: 8

Re: lives system

ok thanks that helped a lot, i can put lives in my scratch projects now

Last edited by Darkpulse (2009-03-20 17:09:28)

Offline

 

#4 2009-03-16 16:53:56

daydreamgirl
Scratcher
Registered: 2009-02-20
Posts: 42

Re: lives system

Darkpulse wrote:

ok thanks that helped a lot, i cant put lives in my scratch projects now

Then obviously I'm not the most helpful of people. Go ask someone else.


Test Signature

Offline

 

#5 2009-03-20 17:10:22

Darkpulse
Scratcher
Registered: 2009-03-14
Posts: 8

Re: lives system

oh sos i put a t on the end so it said cant instead of can

Offline

 

Board footer