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.
My Blocks can have multiple parameters - text labels, numeric variables, and boolean variables - to add more functionality to your custom block.
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.
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.
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.