I am making a game where a sprite (bat) has to through a small maze to the finish. At the end of each maze, there is a small green dot which acts like a portal. What I want: When the bat touches the portal the background (level) will switch to the next background (level). At the moment I have four different backgrounds (Levels). At the moment I have programmed it to: When colour black (Bat) touches colour (green), it switches to Level3, and then when black touches green again it switches back to level 1. I want the order to be Level 1, 2, 3, 4. How can I make surethat will definately happen? Please help!
Offline
Well, I think you need this:
when gf clicked//bat script forever if <color [#000000] is touching [#00FF00]?> broadcast [nextbackground v] end when i receive [nextbackground v]//background script if <(background#)=[3]> switch to background [background4 v] else next backgroundI hope this is what you want!
Last edited by OrcaCat (2013-03-09 13:42:37)
Offline
Just change the colour of the dot on each level.
when gf clicked switch to costume [greendot]
when I receive [lvl 2/3/4] next costumeWhere it says [lvl 2/3/4], that is just an example. Hope this helps!
Offline
You could try variables.
when gf clicked //this is the bat script set [level] to (1) forever if <[#000000] touching [#28EB42]> change [level] by (1) wait [1] secs endThe "color touching color" block is blue. I'm still getting the hang of Scratchblocks
when gf clicked //this is the stage's script forever switch to costume (level) end
Last edited by Sky01 (2013-03-09 22:33:38)
Offline
Ok I tried what you told me to OrcaCat and when the black touches the gren from Level 1 now, it just flashes through al of the levels until a move away from the green dot. Then its on Level 4. :-(
Offline