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

#1 2012-07-01 10:19:41

Frankie101
New Scratcher
Registered: 2012-06-28
Posts: 28

How do I do repeat 5 times, then change to another stage?

I want to do 5 levels (I got that bit), but after the 5th level I want a game over sign to appear, but it always does it at the beggining? Help please!!

Offline

 

#2 2012-07-01 10:20:49

jontmy00
Scratcher
Registered: 2011-11-28
Posts: 1000+

Re: How do I do repeat 5 times, then change to another stage?

Is this for school? What are your scripts?


FOR ALL THE NEWS ON UPDATES FOR SIMPLISTICRAFT, CLICK HERE.

Offline

 

#3 2012-07-01 10:29:05

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: How do I do repeat 5 times, then change to another stage?

If your level is a variable, make sure to set it to one at the start of the game


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#4 2012-07-01 10:29:35

Frankie101
New Scratcher
Registered: 2012-06-28
Posts: 28

Re: How do I do repeat 5 times, then change to another stage?

Yes it is. The scripts for it are:

when I recieve change background
switch to level complete
wait 5 secs
switch to school
<<That is for the stage.

The thing that broadcasts the 'end' is

when gf clicked
if <(level) = 1>
glide 5 secs to x... y...
glide 5 secs to x... y...
end
if <(level)=2>
it keeps going like this up to level 6
at the end it goes:
       
broadcast end

Offline

 

#5 2012-07-01 10:34:04

Frankie101
New Scratcher
Registered: 2012-06-28
Posts: 28

Re: How do I do repeat 5 times, then change to another stage?

They shouldn't be red!

Offline

 

#6 2012-07-01 10:34:09

jontmy00
Scratcher
Registered: 2011-11-28
Posts: 1000+

Re: How do I do repeat 5 times, then change to another stage?

Frankie101 wrote:

Yes it is. The scripts for it are:

when I receive [change background v]
switch to background [level complete v]
wait (5) secs
switch to background [school v]
<<That is for the stage.

The thing that broadcasts the 'end' is

when gf clicked
if <(level) = [1]>
glide (5) secs to x: () y: ()
glide (5) secs to x: () y: ()
end
if <(level) = [2]>
Same as above
it keeps going like this up to level 6
at the end it goes:
       
broadcast end

Scripts fixed.

Last edited by jontmy00 (2012-07-01 10:34:37)


FOR ALL THE NEWS ON UPDATES FOR SIMPLISTICRAFT, CLICK HERE.

Offline

 

#7 2012-07-01 10:36:28

jontmy00
Scratcher
Registered: 2011-11-28
Posts: 1000+

Re: How do I do repeat 5 times, then change to another stage?

Add this:

when gf clicked
forever
if <(level) > [5]>
show
switch to background [game over v]
else
hide
end

Last edited by jontmy00 (2012-07-01 10:37:41)


FOR ALL THE NEWS ON UPDATES FOR SIMPLISTICRAFT, CLICK HERE.

Offline

 

#8 2012-07-01 10:37:25

Frankie101
New Scratcher
Registered: 2012-06-28
Posts: 28

Re: How do I do repeat 5 times, then change to another stage?

@zammer990 I have already done that  wink

Offline

 

#9 2012-07-01 10:40:18

jontmy00
Scratcher
Registered: 2011-11-28
Posts: 1000+

Re: How do I do repeat 5 times, then change to another stage?

Does it work with my method?


FOR ALL THE NEWS ON UPDATES FOR SIMPLISTICRAFT, CLICK HERE.

Offline

 

#10 2012-07-01 10:40:49

Frankie101
New Scratcher
Registered: 2012-06-28
Posts: 28

Re: How do I do repeat 5 times, then change to another stage?

It still doesn't work  sad

Offline

 

#11 2012-07-01 10:42:46

jontmy00
Scratcher
Registered: 2011-11-28
Posts: 1000+

Re: How do I do repeat 5 times, then change to another stage?

Upload the project as a last resort... Not a good idea since it's for school... You suggest what to do?


FOR ALL THE NEWS ON UPDATES FOR SIMPLISTICRAFT, CLICK HERE.

Offline

 

#12 2012-07-01 10:43:46

jontmy00
Scratcher
Registered: 2011-11-28
Posts: 1000+

Re: How do I do repeat 5 times, then change to another stage?

jontmy00 wrote:

Add this:

when I receive [end v]
if <(level) > [5]>
show
switch to background [game over v]
else
hide
end

I think it should work now...


FOR ALL THE NEWS ON UPDATES FOR SIMPLISTICRAFT, CLICK HERE.

Offline

 

#13 2012-07-01 10:45:40

Frankie101
New Scratcher
Registered: 2012-06-28
Posts: 28

Re: How do I do repeat 5 times, then change to another stage?

As I am selected on stage sprite, it doesn't have the show and hide buttons  hmm

Offline

 

#14 2012-07-01 11:10:59

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: How do I do repeat 5 times, then change to another stage?

Here's a simple script that does what you want, it'll change to gave over when level is higher than 5

when gf clicked
switch to background [first level / intro v]
set [level v] to (1)
wait until <(level) > (5)>
switch to background [game over v]


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#15 2012-07-01 11:31:50

Frankie101
New Scratcher
Registered: 2012-06-28
Posts: 28

Re: How do I do repeat 5 times, then change to another stage?

Thankyou both so much!!!  big_smile

Offline

 

Board footer