Discuss Scratch

marsmark
Scratcher
79 posts

What's the difference between "broadcast and wait" and "custom blocks"?

What's the difference between “broadcast and wait” and “custom blocks” other than the fact that broadcast allows asynchronously run scripts across multiple sprites?
crazyfrogcat
Scratcher
500+ posts

What's the difference between "broadcast and wait" and "custom blocks"?

marsmark wrote:

(#1)
What's the difference between “broadcast and wait” and “custom blocks” other than the fact that broadcast allows asynchronously run scripts across multiple sprites?
broadcast's can send data to other spite's but can only have a name while custom blocks allow you the add more than a label
jvvg
Scratcher
1000+ posts

What's the difference between "broadcast and wait" and "custom blocks"?

There are a few differences:
  • Custom blocks allow passing parameters, while broadcasts can only use global variables (which is mostly important for the next point)
  • Custom blocks are recursive (a block can call itself), while broadcasts only support tail recursion (basically broadcasting itself only after all other stuff has been done)
  • Custom blocks support running without screen refresh, while broadcasts don't
82BITMYSTERY
Scratcher
100+ posts

What's the difference between "broadcast and wait" and "custom blocks"?

removed

Last edited by 82BITMYSTERY (Oct. 23, 2024 15:53:13)

marsmark
Scratcher
79 posts

What's the difference between "broadcast and wait" and "custom blocks"?

jvvg wrote:

  • Custom blocks are recursive (a block can call itself), while broadcasts only support tail recursion (basically broadcasting itself only after all other stuff has been done)
thanks, I think this is the answer I'm looking for.
CST1229
Scratcher
1000+ posts

What's the difference between "broadcast and wait" and "custom blocks"?

jvvg wrote:

(#3)
There are a few differences:
  • Custom blocks allow passing parameters, while broadcasts can only use global variables (which is mostly important for the next point)
  • Custom blocks are recursive (a block can call itself), while broadcasts only support tail recursion (basically broadcasting itself only after all other stuff has been done)
  • Custom blocks support running without screen refresh, while broadcasts don't
Also, custom blocks run immediately (and can run within a single frame) while broadcasts are either asynchronous or always wait for at least one frame.

Powered by DjangoBB