Discuss Scratch

SuperCroc398
Scratcher
25 posts

What does the broadcast block do?

What do these blocks do?
when I receive [ v]
broadcast [ v]
broadcast [ v] and wait
mitdk
Scratcher
1000+ posts

What does the broadcast block do?

These blocks are basically a way for sprites to communicate. So, if you put this script into sprite 1:
when green flag clicked 
wait (3) secs
broadcast [ v]
and this in sprite 2:
when I receive [ v]
say [Hello!]
Then, sprite 2 will say hello after 3 secs
84375
Scratcher
500+ posts

What does the broadcast block do?

The broadcast blocks make things so much easier within your projects! You can use them among many messy lines of coding where you probably won't want to use the “wait (#) seconds” in order to make your sprites act at the same time during your game, animation, etc. @mitdk explained it amazingly.
SuperCroc398
Scratcher
25 posts

What does the broadcast block do?

mitdk wrote:

These blocks are basically a way for sprites to communicate. So, if you put this script into sprite 1:
when green flag clicked 
wait (3) secs
broadcast [ v]
and this in sprite 2:
when I receive [ v]
say [Hello!]
Then, sprite 2 will say hello after 3 secs




Oohh, now I get it
MrFluffyPenguins
Scratcher
1000+ posts

What does the broadcast block do?

broadcast [broadcast1 v] and wait
This block sends a broadcast similar to the other blocks, but the script doesn't continue until all of the blocks under a
when I receive [broadcast1 v]
block have finished.

So if you did this:
when I receive [broadcast1 v]
wait (3) secs
when green flag clicked
broadcast [broadcast1 v] and wait
say [Hello!]
The sprite would say “Hello!” after 3 seconds.

Last edited by MrFluffyPenguins (Dec. 4, 2020 01:25:33)

Ihatr
Scratcher
1000+ posts

What does the broadcast block do?

Mr_PenguinAlex wrote:

broadcast [broadcast1 v] and wait
This block sends a broadcast similar to the other blocks, but the script doesn't continue until all of the blocks under a
when I receive [broadcast1 v]
block have finished.

So if you did this:
when I receive [broadcast1 v]
wait (3) secs
when green flag clicked
broadcast [broadcast1 v] and wait
say [Hello!]
The sprite would say “Hello!” after 3 seconds.
you broke the tags

Last edited by Ihatr (Dec. 3, 2020 13:56:12)

Powered by DjangoBB