Discuss Scratch

draberty1
Scratcher
37 posts

How do you use your own created blocks?

How do you use your own created blocks?
define 
Kraken_Games
Scratcher
100+ posts

How do you use your own created blocks?

Just go to “My blocks” or something in the very left, then your made blocks will be there
Catalystix
Scratcher
100+ posts

How do you use your own created blocks?

so a custom block is like a function. anything in the “Define” block is what will happen when your custom piece is called on in the code. the define block is just what you want to happen when your block is used. in block form it looks like this.

when green flag clicked
(MyBlock)

define (MyBlock)
say [Now whatever here will happen when the flag is clicked] for (2) secs]

Hope this helps. try messing with it a bit and that should help a lot

Last edited by Catalystix (March 20, 2019 20:57:26)

codeman1044
Scratcher
1000+ posts

How do you use your own created blocks?

The define block is just where you put your code to tell the program how to run your block. I have an example here (read this post first):
https://scratch.mit.edu/projects/293658088/editor/
There's a list of instructions explaining what the code does, but if you don't want to worry about it, don't.
Here's the use of the custom block:
To reduce repetitive chunks of script.
To make users able to customize the game easier, like making a custom setting.
To have a script chunk adapt to an input (check out the link)

The purpose of the define block is telling what the custom block to do. It's like the actual scratch program: no code, nothing happens. You have to tell he computer what to do, and how to do it.

There are 3 different options for custom blocks: text box, a text/number input, or a boolean input. All of those are (kind of) reviewed in the link above.
The option to run without screen refresh just slows the fps of the scratch game to the point where the code can run within one frame. Useful for some cases, but not others.

When using a define block, if you have inputs, those input spots are like variables in a way: you click and drag them from the define block into the attached script where you want them (examples given in link).

If I missed something, or didn't explain something well, let me know!
RiRiRi13
New Scratcher
13 posts

How do you use your own created blocks?

I do not see Define Block in the dialog of My Blocks. Do I need to be a Scratcher to see it or something?
098765432154321
Scratcher
500+ posts

How do you use your own created blocks?

RiRiRi13 wrote:

I do not see Define Block in the dialog of My Blocks. Do I need to be a Scratcher to see it or something?
Create a new block and you will see the define block in the editor.
HappyDollar
Scratcher
22 posts

How do you use your own created blocks?

Thx now I know how to use Boolean
ABCLearningKids
Scratcher
6 posts

How do you use your own created blocks?

CAN ANYONE HELP ME MAKE A BLOCK?! PLEASE!

Last edited by ABCLearningKids (July 24, 2020 02:02:03)

deck26
Scratcher
1000+ posts

How do you use your own created blocks?

ABCLearningKids wrote:

CAN ANYONE HELP ME MAKE A BLOCK?! PLEASE!
1 - create your own new topic instead of necroposting

2 - say what you want the block to do!

Powered by DjangoBB