fbpx

Activity- Create a Block

This the last category where you can create your own blocks. Now Arun and Raj will explain how to use this command.

Raj- Let’s start with My blocks, how to create a block Arun?

Arun- Before any blocks are created, it is empty, except for a “Make a Block” button.

Clicking Make a Block brings up a dialogue allowing the user to make a procedure. Once OK is pressed, the new block appears in the palette and an empty definition appears in the code area. When the procedure runs, Scratch will run the blocks below the corresponding Define block.

Raj- There are 3 options available. Why?
Arun- These options help you to choose which type of block you want create.
Raj- What is this “Run without screen refresh”?
Arun- It is a feature that you can put on your custom blocks. Without it on, the screen will refresh itself before running the block again. With it on, the screen won’t refresh and it will run the custom block automatically again, so it will make it faster.
Raj- Let’s create some blocks.
Arun- Take example of greeting block. Create a block of say random greetings.

Raj- Okay!  block is created. What to do next?

Arun- Just define conditions inside the block. And create a variable Greeting choice, to select random choices, also snap block and block together.

Raj- Why?

Arun- So that whenever you will click green block, it will run the conditions defined in the block.

 

Raj- I have defined 4 choices to pick.
Arun- Great! Now click on the green flag.

Raj- Random value picked is 4 and the sprite said as given.

Arun- Correct! Similarly, you can make any block according to your need in the project.

This is the last category of block palette; I hope you understood everything very well. Next time we will try to build some games.