Lives: Well, first make a variable called lives. Make it so that whatever way they die the lives value goes down and when it hits zero make it so that whatever you want it to do when you die, like say "game over" on the screen happens.
Levels: Same thing as lives but make a variable called level and make it go up every time.
Offline
For levels, make a bunch of backgrounds on the stage. <if><touching color[ exit ]
<next background><end>
As for lives, make a variable called "lives" put in the script: if touching (thing that makes you lose lives), change lives by -1, or however many you want to decrease it by. Also remember to reset the lives to a certain amount at the beginning of your game.
Offline
Yes, but don't forget to add the script:
When green flag clicked
or When I receive __
if you broadcasted level change from main sprite.
Instead of <next background/costume>, prefer using <change costume to costume ___>.
This will be better if you made the levels be a sprite instead of a background.
Offline
^ And don't forget to make sure when green flag clicked, set costume or background to the first level.
Offline
You've already made a thread about this (called 'How to make levels and lifes'). Please only make one thread about a particular subject, and if no one answers, feel free to bump it (make a random post to get back to the top of the list) or just be patien and wait for a reply. Thank you.
Offline
matthew8092001 wrote:
For levels, make a bunch of backgrounds on the stage. <if><touching color[ exit ]
<next background><end>
As for lives, make a variable called "lives" put in the script: if touching (thing that makes you lose lives), change lives by -1, or however many you want to decrease it by. Also remember to reset the lives to a certain amount at the beginning of your game.
okay i made lives but when i made live when (thing that makes you lose lives) make you loose life took a long time to loose a life from 5 i put so it took quite a long time to loose a life but i want it snappy and fast to loos a life but it take long
Offline
Use this for the main sprite:
When green flag clicked
<touching color(blue)?>
<switch to background__>
This ___will be the background number.
Last edited by kingofdallamas (2011-03-18 18:42:43)
Offline
dreamy678 wrote:
how do you make it so if sprite 1 tuches something black that the background will change
It's the same concept!
When green flag clicked
if touching color black?
change background to___
This __ shall be your background number choice. There's no such script as touching color black but this: <touching color[black] You can choose the colors when clicking the white box. Hope this helps, and scratch on, dreamy!
Offline
It doesn't work i tryed it and it turned red
Offline
Sleepykiller wrote:
It doesn't work i tryed it and it turned red
It works if you used it for a sprite's script. So, instead of background, it should be costume. Also, use <forever> and <if> and <else> to work better. The script above was a very simple way to do it, butnot very efficient at some points. Use level for variable as the background switch as an example. Level variable is what I shall call the variable with, but you can change it according to whatever you need to call it. So, in games, the scripts...
main sprite:
-when green flag clicked
set level to 1
-when touching color black
change level by 1
Background/sprite level thingy:
-When green flag clicked
forever
if level=1
change background to one
else
if level=2
change background to two
else if level=3 change background to three
etc.etc
These scripts are used for games to have proceeding levels. And just receiving the background change
forever if touching black
change background
There you go. Hope this helps!
Last edited by kingofdallamas (2011-03-29 19:08:49)
Offline