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
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>
Offline
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.
Offline