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

#1 2012-03-20 10:33:37

YodaTroll
New Scratcher
Registered: 2012-03-20
Posts: 4

repeat until help

I am making a maze game and I have two backgrounds that keep switching back and forth and I don't know how to make them stop switching back and forth once the player has completed the level..

please post help or a link if this topic has already been discussed.

Thanks...

Offline

 

#2 2012-03-20 14:28:19

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: repeat until help

Could you please upload the project? Then we could see what's wrong.  smile

Offline

 

#3 2012-03-20 15:17:32

turkey3
Scratcher
Registered: 2011-12-04
Posts: 500+

Re: repeat until help

Hmm... I think I need more info. But of you have a script like this:

When gf clicked
Switch to background [first level v]
Forever if <touching [end point v]?>
Next background
That should be all you need.

Offline

 

#4 2012-03-21 14:21:55

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Re: repeat until help

turkey3 wrote:

Hmm... I think I need more info. But of you have a script like this:

When gf clicked
Switch to background [first level v]
Forever if <touching [end point v]?>
Next background
wait until <not <touching [end point v]?>>
That should be all you need.

I fixed it.

Offline

 

#5 2012-03-21 18:11:54

Prestige
Scratcher
Registered: 2008-12-15
Posts: 100+

Re: repeat until help

Hey there,
you can achieve this in one script for sure, just set up something like this on the Background.

Firstly: Make a new variable called "complete?" or something. When the level starts, set this to 0 and when the goal is reached set this to 1. Then you can make this script.


wait until <(complete?) = [0]>
repeat until <(complete?) = [1]>
    next background
    wait [2] seconds
end
set background to background1


"Don't insult someone until you've walked a mile in their shoes. That way, if they don't like what you have to say, you'll be a mile away and still have their shoes  smile  "

Offline

 

#6 2012-03-21 18:55:31

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: repeat until help

Prestige wrote:

Hey there,
you can achieve this in one script for sure, just set up something like this on the Background.

Firstly: Make a new variable called "complete?" or something. When the level starts, set this to 0 and when the goal is reached set this to 1. Then you can make this script.


wait until <(complete?) = [0]>
repeat until <(complete?) = [1]>
    next background
    wait [2] secs
end
switch to background [background1 v]

Fixed it a bit!

Offline

 

#7 2012-03-28 09:22:53

YodaTroll
New Scratcher
Registered: 2012-03-20
Posts: 4

Re: repeat until help

Thanks for the help....... I forgot to go back on the forums for like a week...
uhm this is what I had

when I recieve [10]
repeat until <>
switch to background [background 8]
wait (1.5) seconds
switch to background [background 9]
wait (1.5) seconds
but then when I go to the next level it continues to switch I couldn't figure out how to make it stop.....

I'm going to go test the suggestions now

Offline

 

#8 2012-03-28 10:01:46

YodaTroll
New Scratcher
Registered: 2012-03-20
Posts: 4

Re: repeat until help

YodaTroll wrote:

Thanks for the help....... I forgot to go back on the forums for like a week...
uhm this is what I had

when I recieve [10]
repeat until <>
switch to background [background 8]
wait (1.5) seconds
switch to background [background 9]
wait (1.5) seconds
but then when I go to the next level it continues to switch I couldn't figure out how to make it stop.....

I'm going to go test the suggestions now

. . . ok more background on the project... Basically a red square moves around and once it hits the endzone it broadcasts a number. when the other end of the commands receives the number it changes the background to another maze... when ever you hit the color black you "die" and go back to the beginning......
soooooo
I have it so that after level 6 it broadcasts 10
and then it does what I posted

when I recieve [10]
repeat until <>
switch to background [background 8]
wait (1.5) seconds
switch to background [background 9]
wait (1.5) seconds
I changed it to what TorbyFork234 and Prestige said to do... and when the sprite hits the color gray (the color for the end of level 7) 11 gets broadcasted
looks like this....

when I recieve [11]
set [complete1] to 1
repeat until <>
switch to background [background 10]
wait (1.5) seconds
switch to background [background 11]
wait (1.5) seconds
and after the background switches to number 10 it goes back to 8 then 9 then 10 then 11 and does what it is supposed to do
I wanted to make 10 levels before uploading to the Scratch gallery
I have other work to do so whenever you can figure it just post..
and If I manage to fix it I will post how

big_smile  thanks for helping

Offline

 

#9 2012-03-28 23:38:27

lukanater
Scratcher
Registered: 2007-09-26
Posts: 100+

Re: repeat until help

Can you upload the project so I can take a look at it?


http://i1049.photobucket.com/albums/s385/xenokstudios/trippinstudios.png

Offline

 

#10 2012-03-29 09:39:22

YodaTroll
New Scratcher
Registered: 2012-03-20
Posts: 4

Re: repeat until help

lukanater wrote:

Can you upload the project so I can take a look at it?

I uploaded it. I don't know what else I am supposed to do....... And it only shows level 7 the one I am having issues with

Offline

 

Board footer