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

#1 2011-11-11 18:25:40

jwill22
New Scratcher
Registered: 2011-11-10
Posts: 4

Program isn't ending how I want it too

I'm trying to figure out why the program will not stop running after either sprite touches the finish line. Instead the cat keeps going and another math problem will appear. I want it to end when either sprite touches the finish line. Cans somebody help? Thanks

http://dl.dropbox.com/u/12896730/Team%202%20Project%20improvements.sb

Offline

 

#2 2011-11-11 18:36:25

Smozzick
Scratcher
Registered: 2011-10-23
Posts: 100+

Re: Program isn't ending how I want it too

Ok, so basically I think with your current code one more question is unavoidable. But, you can make it stop after that one question is asked by adding:

Set Cat wins to 0
Set Rabbit wins to 0

At the top of your program. At the moment previous game wins affect the current game but this should make it stop after one question...or atleast it did for me.

An alternative would be to put the questions into a list and use a loop to read from the list, that would presumably stop before the list ended.

Hopefully this helped a bit, at least.


http://i50.tinypic.com/ded8m.png

Offline

 

#3 2011-11-11 18:43:12

Smozzick
Scratcher
Registered: 2011-10-23
Posts: 100+

Re: Program isn't ending how I want it too

Hmm no that didn't fix it. I'd definitely go for the loop in that case I think but still make sure to put those sets in or you could have problems with the game ending too early.

It's up to you really but I'm not awake enough to work it out right now...I'll have another look tomorrow.

The problem at the moment is that because you have multiple codes running at the same time when one is waiting 2 seconds to speak the other is asking a question and then the rest of the if statement for that part has to be finished before it gets to the stop all...I think.


http://i50.tinypic.com/ded8m.png

Offline

 

#4 2011-11-11 18:53:07

jwill22
New Scratcher
Registered: 2011-11-10
Posts: 4

Re: Program isn't ending how I want it too

Yeah please do have a look at it tomorrow, i've been pulling my hair out trying to get this bug out. Thanks

Offline

 

#5 2011-11-12 15:47:47

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Program isn't ending how I want it too

I think this belongs in All About Scratch.


Why

Offline

 

Board footer