My Blocks#

My Blocks are used to create custom blocks.

My Blocks are used to create a sequence of blocks that can be used multiple times throughout a project.

My Blocks are made using the Make a Block button.

A rectangular button with rounded corners and a light gray border, labeled 'Make a Block' in bold, gray text, centered within the button.

My Blocks can have multiple parameters - text labels, numeric variables, and boolean variables - to add more functionality to your custom block.

A small, red, puzzle-shaped programming block labeled 'myBlock' in white text. The block is designed to connect with other blocks in a visual programming environment.

To use a My Block, attach the calling my block to a hat block. When the my block is reached in your project, the stack inside of the my block will run using the parameter values specified.

A red, rounded rectangular programming block labeled 'define myBlock' in white text. The block is used to define a custom function or block named 'myBlock' within a visual programming environment.

Note: Creating multiple My Blocks with the same labels and variables may cause errors when running your project in the Playgrounds.

In this example, a My Block is used to define making one side of a square. The My Block is then called 4 times to make all 4 sides of the square and finish the shape.

Diagram illustrating the use of My Blocks to create and call a square shape with adjustable side lengths.

My Blocks can also have custom parameters. In this example, the length of the square’s sides can be adjusted and will change in the My Block.

Diagram illustrating the use of My Blocks to create a square shape with adjustable side lengths in a programming project.