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

#1 2013-01-23 23:47:55

kellyvaughan27
New Scratcher
Registered: 2013-01-17
Posts: 6

wait (1) secs problem

My students created what would appear to be a simple program with several sprites that move simultaneously, change costumes, etc. We have done similar with no problems in the past. Each script works on its own, but when played together, it freezes at the first "wait 1 secs" block for one of the sprites. I have tried any number of things but cannot seem to figure this out... help?

Offline

 

#2 2013-01-23 23:58:22

kellyvaughan27
New Scratcher
Registered: 2013-01-17
Posts: 6

Re: wait (1) secs problem

This is a link to the project, in case you want to test it for yourself. http://scratch.mit.edu/projects/kellyvaughan27/3056601

Offline

 

#3 2013-01-24 00:32:38

dechan
Scratcher
Registered: 2012-12-20
Posts: 69

Re: wait (1) secs problem

In sprite 1 you are using a stop all block after a play sound block.
Because the play sound block is not a play sound and wait block the entire script will stop.
Only use a stop all block when you want the entire program to halt.

Last edited by dechan (2013-01-24 00:33:24)

Offline

 

#4 2013-01-24 00:56:50

dechan
Scratcher
Registered: 2012-12-20
Posts: 69

Re: wait (1) secs problem

Also, since sprite 1 is handling the music you can have both sounds looping like this:

when gf clicked
set [served] to [0]
repeat until <(served) = [1]>
   play sound [HumanBeatBox1]
   play sound [HipHop] until done
end
You want to put the "until done" on the longest sound loop in your script.

And then in sprite 3, do the following:
when I receive [handstand]
set [served] to [1]
broadcast [ohhhhh Jayden got served!!!]
say [ohhhhhhhh Jayden got served!] for (10) secs
Because "served" is a global variable (please do not make it belong to a specific sprite) all sprites and the Stage can see and change it.

Last edited by dechan (2013-01-24 01:00:41)

Offline

 

#5 2013-01-24 07:41:08

kellyvaughan27
New Scratcher
Registered: 2013-01-17
Posts: 6

Re: wait (1) secs problem

Oh... thanks. I feel silly. When my students showed me and I was playing with it, those other scripts weren't visible, and I never even saw them... just resized, and yes, it's obvious. Sigh. Thanks!  smile

Offline

 

#6 2013-01-24 12:36:00

dechan
Scratcher
Registered: 2012-12-20
Posts: 69

Re: wait (1) secs problem

The obvious can be a mischievous Ninja when you have an audience.   big_smile

Offline

 

Board footer