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

#1 2012-11-26 22:21:34

ArloarLoLs
Scratcher
Registered: 2012-08-27
Posts: 71

Doesnt the define block function the same as broadcast and recieve?

Why is it necessary then?

Offline

 

#2 2012-11-27 01:18:40

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Doesnt the define block function the same as broadcast and recieve?

Defined blocks can take arguments, where broadcasts are usually just to continue a script across sprites...

Offline

 

#3 2012-11-27 07:55:14

Mokat
Scratcher
Registered: 2011-12-08
Posts: 1000+

Re: Doesnt the define block function the same as broadcast and recieve?

It's meant so that your scripts are smaller. For example, you could change this:

repeat (10)
change [color v] effect by (25)
glide (1) secs to x: (2) y: (34)
say [Hello!] for (2) secs
play sound [Pop v] until done
end
into
block
which is a lot easier than doing the first script over and over.


http://www.eggcave.com/egg/977371.pnghttp://www.eggcave.com/egg/977376.pnghttp://www.eggcave.com/egg/1005291.pnghttp://www.eggcave.com/egg/996745.png

Offline

 

#4 2012-11-27 08:21:33

jontmy00
Scratcher
Registered: 2011-11-28
Posts: 1000+

Re: Doesnt the define block function the same as broadcast and recieve?

Mokat wrote:

It's meant so that your scripts are smaller. For example, you could change this:

repeat (10)
change [color v] effect by (25)
glide (1) secs to x: (2) y: (34)
say [Hello!] for (2) secs
play sound [Pop v] until done
end
into
block
which is a lot easier than doing the first script over and over.

It can also be shared across sprites, reducing the need to duplicate scripts.


FOR ALL THE NEWS ON UPDATES FOR SIMPLISTICRAFT, CLICK HERE.

Offline

 

#5 2012-11-27 17:21:27

CanadianGeorge
Scratcher
Registered: 2012-11-21
Posts: 100+

Re: Doesnt the define block function the same as broadcast and recieve?

That's the same thing I was thinking!  It's pretty much the same as broadcast and wait.
Because here are what is the same:
Define script, (when i receive), and it would pretty much act the same.
I'm not sure but there must be some reason.


smile   neutral   sad   big_smile   yikes   wink   hmm   tongue   lol   mad   roll   cool
"You're weird" -My Sister

Offline

 

#6 2012-11-28 08:30:39

jontmy00
Scratcher
Registered: 2011-11-28
Posts: 1000+

Re: Doesnt the define block function the same as broadcast and recieve?

CanadianGeorge wrote:

That's the same thing I was thinking!  It's pretty much the same as broadcast and wait.
Because here are what is the same:
Define script, (when i receive), and it would pretty much act the same.
I'm not sure but there must be some reason.

You can make blocks that do not require screen refreshes. Good for terrain generations.


FOR ALL THE NEWS ON UPDATES FOR SIMPLISTICRAFT, CLICK HERE.

Offline

 

#7 2012-11-28 15:39:16

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Doesnt the define block function the same as broadcast and recieve?

procedures can be atomic

it is also easier to manage a procedure with arguments instead of a broadcast with many variables.


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

Board footer