This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2013-03-10 04:06:42

froggyeyes100
New Scratcher
Registered: 2013-03-09
Posts: 3

Help with Game urgent please! #2

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

 

#2 2013-03-10 06:03:14

enzo7
New Scratcher
Registered: 2013-03-10
Posts: 4

Re: Help with Game urgent please! #2

I will try my best to help you.

Offline

 

#3 2013-03-24 16:30:23

cauzality
New Scratcher
Registered: 2013-03-19
Posts: 44

Re: Help with Game urgent please! #2

not sure if this is the best method but you could use broadcast to do different things depending on a level counter variable.

give your bat the following:

if < touching [green v] ? >
   if < [level v] = [1] >
      broadcast [level 2 v]
   end
   if < [level v] = [2] >
      broadcast [level 3 v]
   end
end
and use things like this to control what happens for each level:

when I receive [level 2 v]
   hide level 1 things
   show level 2 things
   etc...
end

Offline

 

#4 2013-03-24 16:37:32

cauzality
New Scratcher
Registered: 2013-03-19
Posts: 44

Re: Help with Game urgent please! #2

oh yeah, don't forget to change the level variable

if < touching [green v] ? >
   if < [level v] = [1] >
      broadcast [level 2 v]
   end
   if < [level v] = [2] >
      broadcast [level 3 v]
   end
   change [level v] by [1]
end

Offline

 

Board footer