🧩Blockly Lessons
Last updated
Last updated
Blockly is a popular choice for learning programming if you don't have any prior experience. If that is you, then you have come to the right place. Throughout Misty's Blockly lessons you will learn the basic concepts of programming without having to worry about the complexities of syntax. You can easily drag and drop blocks together to create programs, and Blockly will automatically generate syntactically correct code.
To access your Blockly workspace you will need to open the 'Programming' tab in the left side bar and click 'Blockly'.
As you start exploring the Blockly workspace in Misty Studio you will find that the blocks are organized into 3 categories. If you would like to explore these in more detail before kicking off the lessons you can simply click the links below:
Misty Blocks: Movement, speech, audio, vision, events, miscellaneous, NLP and system.
Basic Blocks: Logic, loops, math, texts and lists.
Advanced Blocks: Variables and functions.
There are six types of blocks you can use in your Blockly workspace. You can identify them by their shape, connectors and sockets, which will tell you how they are connected together:
Independent blocks. As you can see in the example above this block can't be connected with other blocks because it has no connector or socket. It runs independently from the rest of the blocks.
Action blocks: These blocks come with a socket and a connector. They can be connected to other blocks with sockets of the same type to form a sequence. Inside some function blocks you can find empty spaces where you can insert action blocks.
Value blocks: Stand out by their shape and colour (Red, Black or Blue). These blocks are typically used to insert values into your action blocks, including text, list, variable, number or anything you need for your code.
Independent Function blocks. These blocks also can't be connected to other blocks and run independently, however, you can nest other blocks inside them to run a sequence based on a certain condition.
Function blocks: Can be connected to other blocks in a sequence and nest additional blocks that you want to run once the function is triggered.
Function Value Blocks: These are very similar to the regular function blocks, however, you can also attach value blocks.
You can recognize which block you are working with at that moment because it will be bordered with a yellow line. When the code runs the blocks will have a whiter tone, so you can check which block is currently being used.
In the lessons, you will find that some blocks are shown in a faded yellow colour. These are disabled blocks that are provided as examples of what you can use when building sequences. You can re-enable the blocks if you want to run them in your program. Below you will find instructions on how to manage your Blockly workspace and blocks.
Blockly allows you to drag and drop blocks directly into your workspace. Should you at any point decide you want to delete a block or a combination of blocks, you can drag them to the trash bin in the bottom right corner or right-click and select 'delete block'. You will find that you can also deactivate blocks, duplicate them or add comments.
At the top of your Blockly workspace, you'll see a set of controls that you can use to manage your Blockly program.
The 'Run' button is used to start program execution and will change to a 'Stop' button while your program is running.
The 'Stop' button stops the current program.
The 'New' button clears the current workspace.
The 'Open' button is used to load a saved program from your computer.
The 'Save' button is used to save the current program to your computer. By default, the program file is always saved as "misty_blockly.json", but you can rename it.