Discuss Scratch

Super_K
Scratcher
3 posts

What does the Define block on more blocks do?

Could someone tell me what the define block in more blocks do?
StellarCat
Scratcher
53 posts

What does the Define block on more blocks do?

So, when you have a custom block, for this, lets call it advance, Scratch doesn't know what ‘advance’ means.

Thats where define comes in. We need to define ‘advance’ for the program, therefor telling it what it means, and what to do.
In this case, Advance will mean to switch to the next costume. (You don't have to do this, its just to help, lol)

defineAdvancenextcostume

So, when you place/connect your own custom block to something…

Advance

It will do as told, because we defined it to do so.


Understand? Hope this helped!

They might be a little hard at first, but it will make sense later!
deck26
Scratcher
1000+ posts

What does the Define block on more blocks do?

This crops up regularly - eg https://scratch.mit.edu/discuss/topic/111228/

Simple example - you could create a custom block to draw a circle of a certain size centred on an x and y position. If you used a broadcast for this you'd need to always use the same variables or the same values but a custom block can be called with the values you want or with different variables (so one time the size could be variable size1 and the next it could be size2).

You can also run them without screen refresh which makes things run much faster.

Super_K
Scratcher
3 posts

What does the Define block on more blocks do?

Oh, I get it now! Thanks a lot for your help!

Last edited by Super_K (May 20, 2016 16:23:39)

Powered by DjangoBB