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

#1 2013-03-09 13:30:19

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

Help with game urgent please

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-09 13:39:13

OrcaCat
Scratcher
Registered: 2010-06-30
Posts: 500+

Re: Help with game urgent please

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 background
I hope this is what you want!

Last edited by OrcaCat (2013-03-09 13:42:37)


     Awesome music     Electrode's theme     Epic music
Bye, 1.x.  sad                             Hello, 2.x!  smile

Offline

 

#3 2013-03-09 13:47:39

JadeDJ
Scratcher
Registered: 2013-03-05
Posts: 22

Re: Help with game urgent please

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 costume
Where it says [lvl 2/3/4], that is just an example. Hope this helps!


https://fbcdn-sphotos-f-a.akamaihd.net/hphotos-ak-prn1/62864_109495135917136_1191786468_n.jpg
SCRATCHERS UNITED!!! HERE: http://scratchersunited.webs.com/  wink

Offline

 

#4 2013-03-09 22:26:08

Sky01
Scratcher
Registered: 2010-10-23
Posts: 10

Re: Help with game urgent please

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
end
The "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)


I had a really cool animation planned for this signature but couldn't figure out how to post it  sad
http://www.my_animation_WAS_here

Offline

 

#5 2013-03-10 03:44:43

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

Re: Help with game urgent please

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

 

Board footer