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

#1 2011-05-22 09:32:27

wuzel
New Scratcher
Registered: 2011-05-22
Posts: 7

repeat a broadcast?

I'm playing around with some turtle type graphics while getting the hang of this program.

I don't seem to be able to get the broadcast to repeat. I'm expecting the routine below to draw a spiral, but the broadcast to circles does not get repeated.
[blocks]

<repeat( 6
<broadcast[ circles]

[/blocks]

I expected the broadcast be called 6 times, but instead it gets called once and then stops.


[blocks]
<when I receive[ circles
<change{side  }by( 1
<repeat( 12
<move(side  )steps>
<turn cw( 30 )degrees>

[/blocks]

I can work around it by skipping the broadcast and using nested loops - that works fine, but I would like to be able to call named broadcasts, as it would make it easier to keep track to code later on when it the code gets more complicated.

Am I overlooking something?  How can broadcasts be called more than once?

Thanks

Offline

 

#2 2011-05-22 10:23:25

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

Re: repeat a broadcast?

Well, it actually does it six times, but it does it all at once, and the script therefore can't do it.
You need to broadcast[  ]and wait block.  smile

Last edited by scimonster (2011-05-22 10:23:50)

Offline

 

#3 2011-05-22 10:31:18

wuzel
New Scratcher
Registered: 2011-05-22
Posts: 7

Re: repeat a broadcast?

Thanks a million scimonster - changing from broadcast to broadcast and wait did the trick!

It's also solved the mystery of when on earth you would use broadcast and wait.

Offline

 

#4 2011-05-22 10:36:03

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

Re: repeat a broadcast?

wuzel wrote:

Thanks a million scimonster - changing from broadcast to broadcast and wait did the trick!

It's also solved the mystery of when on earth you would use broadcast and wait.

Glad to be of service!  tongue

Offline

 

Board footer