I'm trying to create a maze game but I really want to know how to:
- End the game when my sprite touches the wall
- Hide sprites from one background
- Start a new level
Please help! :(
Offline
How about this?
End game:
when gf clicked forever if <[sprite v] touching colour [000000]//colour of wall, or if wall is a sprite, use "if sprite touching wall" block go to [beginning] end endthat will reset the sprite to the beginning of the game. If you want a proper "game over" screen to come up, do this instead:
when gf clicked forever if <[sprite v] touching colour [000000]> broadcast [game over v] end end when I receive [game over v] do actionStarting new level:
when gf clicked set [level v] to [1] forever if <[sprite v] touching [finish]> change [level v] by [1] end endHide sprites (if you want them to be shown on only one of the levels):
when gf clicked forever if <level = 1>// whatever level you want the sprite to be shown at show else hide end endif I got something wrong, misunderstood you or if you have any questions, ask
Offline
To end the game when your sprite touches the wall, put this script on it. Just change black to whatever color your walls are if they aren't black already.
when flag clicked forever if <touching color [#000000]?> stop all
Last edited by gettysburg11 (2012-04-15 11:26:16)
Offline
sorry, colour 000000 was meant to be black
also, on the starting new level one, i should have written
if <[sprite] touching [finish v]> go to [beginning v] change [level v] by [1] endthis will make sure that the level doesn't get changed by more than 1
Offline