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

#1 2012-03-16 18:10:49

TheSpitster
Scratcher
Registered: 2011-05-13
Posts: 33

Broadcast

is there a way to say something like: when the green flag is clicked, do something, until i receive _________'?


The only thing worse than watching jaws on the way to the beach is watching chuck norris on your way to texas

Offline

 

#2 2012-03-16 18:17:31

TheAmaterasu
New Scratcher
Registered: 2012-03-13
Posts: 42

Re: Broadcast

All I can think of is to go like this:

when gf clicked
<forever>
<play sound[meow]>
<end>
and then:

<when I recieve[stop!]>
<Stop all>

Offline

 

#3 2012-03-16 18:19:28

ProgramCAT
Scratcher
Registered: 2011-12-13
Posts: 500+

Re: Broadcast

There is currently no 'until I recieve [something v]' block.
You can do it with variables though.

when gf clicked
set [state v] to (0)
repeat until <(state) = (1)>
scripts here
end

when I receive [something v]
set [state v] to ( (1) - (state) )
^ That will toggle the variable 'state' between 1 and 0.
Or, to just set it once:

when I receive [something v]
set [state v] to (1)

Last edited by ProgramCAT (2012-03-16 18:19:40)


Programming is an art...
Goodbye, Scratch. I am leaving because of the exams coming up at our school, though I'll check the forums once or twice a week.

Offline

 

#4 2012-03-16 18:20:55

TheSpitster
Scratcher
Registered: 2011-05-13
Posts: 33

Re: Broadcast

Thanks This worked really well


The only thing worse than watching jaws on the way to the beach is watching chuck norris on your way to texas

Offline

 

#5 2012-03-18 20:27:44

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

Re: Broadcast

TheAmaterasu wrote:

All I can think of is to go like this:

when gf clicked
<forever>
<play sound[meow]>
<end>
and then:

<when I recieve[stop!]>
<Stop all>

But what if he doesn't want everything to stop.

Last edited by turkey3 (2012-03-18 20:31:06)

Offline

 

Board footer