Code blocks are instructions that are used to create your project. Blocks connect together like puzzle pieces. There are blocks for movement, animations, text, and more.
Where to find code blocks
Code blocks are found in the Toolbox. The blocks are sorted into categories, the blocks are coloured to match their category.
You can click (or tap) on a category or sub-category to see the blocks that are inside it.
At the top of the toolbox is a Search box where you can type the name of a block you want to find.
How to use code blocks
1. Drag blocks into the Code Area
Choose a block from the toolbox and drag it into the code area to begin building your instructions.
Start with a top level block, these are most frequently found in the Events category.
2. Connect blocks together
Blocks snap together when placed near each other. A set of blocks grouped together is called a Stack.
You can add blocks above, below, or inside other blocks.
3. Change values inside blocks
Tap or click numbers, text, colours, or dropdowns in your blocks to edit your code.
4. Test your code
Press Play to see what happens.
Press Stop to continue making changes.
Testing often helps you see what works and fix what doesn’t.
5. Delete code blocks
If you want to delete a code block that you have added to the code area you can right-click (tap and hold) on the block or drag it to the trash can in the bottom right of the screen.
Tips for using blocks
- Start small and test your code often
- Keep code grouped clearly, you can use multiple top level blocks in one project
- Right click on a block and:
- Add Comment to type a note
- Duplicate if you want to reuse it
- Keep your workspace tidy by right-clicking on Stacks to collapse them when you are not editing them
- Don’t worry if something doesn’t work right away — explore and experiment
