Pages: 1
Topic closed
I need a lives system for my game. I'll give credit to whoever's life system I use. If anyone knows how to do this, please reply
Offline
You can use a variable. Go to the variables one, create it and then use a script to count the lives, like this:
[blocks]<when green flag clicked>
<set{ LIVES }to( 3
<when I receive[ death
<change{ LIVES }by( -1
<if><( <{ LIVES }> <=> 0 )>
<broadcast[ GAME OVER
<end>[/blocks]
With the [broadcast [GAME OVER]] you can tell a certain sprite to do something when you lose, such as displaying a screen and then using a [stop all] block. Hope this helps (and works for you)
Offline
I'll tweak technoguyx's.
Orange=Control
Red=Variables
RoyalBlue=Sensing
Green=Operators
[when green flag clicked]
[set [lives V] to (number of lives)]
|forever]
| || |if <touching color [█]>]
| || |[change lives by (-1)]_________________
| || |____________________________________]
| || |if <(lives) =[/green] (0) >]
| || |[stop all]______
| || |______________]_____________________
|________________________________________]
Wow, that was complex. That took forever. Quote this to see all my hard work!
Offline
Topic closed
Pages: 1