Discuss Scratch

mmate
Scratcher
19 posts

What does define mean???

I know that you can with define you can turn more blocks in to one. But why are there numbers and stuff at the options??????

So i know that:
define test
pen down
set pen color to [#ff0088]
pen up
If I create the code:
when green flag clicked
(test)
will put the pen down, than set pen color to then pen up.

But what are those options under them?

Thanks.

Last edited by mmate (Dec. 8, 2014 20:24:24)

stickfiregames
Scratcher
1000+ posts

What does define mean???

Yes, a custom block will run the script under the define block.

The number, text and boolean inputs let you do stuff like this:
define jump (height)
repeat (height)
change y by (1)
end
repeat (height)
change y by (-1)
end

when gf clicked
jump (10)
When you make the block, you can drag the inputs from the define block and use them in your script.
drmcw
Scratcher
1000+ posts

What does define mean???

They are called parameters and enable you to pass values to the script. So in your example; maybe you want to pass a colour to test; you 'd do that with a number parameter. The parameter acts like a variable so you can give it a sensible name and then use it like a variable reporter within the custom script.
Jaguarplayz4374
Scratcher
1 post

What does define mean???

What does define in scratch even mean???
thatwasdeadsimple
Scratcher
100+ posts

What does define mean???

Jaguarplayz4374 wrote:

What does define in scratch even mean???
It's when you have a custom block you can use several times, without repeating the same code. For example, if I want to make a sprite laugh by making a laughing sound and switching costumes, I can make this:
define laugh
play sound [laughter v]
repeat (10)
next costume
wait (0.5) secs
end
instead of using the same code every time I want the sprite to laugh.
I hope that helped!
(Note that these blocks have become more complicated now in Scratch 3.0 then they used to be in 2.0)
MINECRAFTGAMER2111
Scratcher
100+ posts

What does define mean???

It's like a broadcasting feature but only for one sprite. This happens when using the <define> block, and then when been runned, it will start the script.

Powered by DjangoBB