Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » What does define mean???
- 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:
But what are those options under them?
Thanks.
So i know that:
define testIf I create the code:
pen down
set pen color to [#ff0088]
pen up
when green flag clickedwill put the pen down, than set pen color to then pen up.
(test)
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:
The number, text and boolean inputs let you do stuff like this:
define jump (height)When you make the block, you can drag the inputs from the define block and use them in your script.
repeat (height)
change y by (1)
end
repeat (height)
change y by (-1)
end
when gf clicked
jump (10)
- 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.
- thatwasdeadsimple
-
Scratcher
100+ posts
What does define mean???
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 laughinstead of using the same code every time I want the sprite to laugh.
play sound [laughter v]
repeat (10)
next costume
wait (0.5) secs
end
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.
- Discussion Forums
- » Help with Scripts
-
» What does define mean???