An introduction to the visual programming environment where students learn to navigate the workspace and drag blocks.
Imagine you are the boss of a robot! You don't need to speak a secret 'Robot Language' to tell it what to do—you just need to snap colorful blocks together like LEGOs to bring your ideas to life.
The coding workspace is divided into three main areas. First, the Block Palette is your toolbox; it holds all the different commands you can use. Second, the Script Area is the big empty space in the middle where you build your code. Finally, the Stage is the screen on the right where your character (called a Sprite) moves and acts out your instructions. Think of the Block Palette as your toy box and the Stage as the play mat where the fun happens!
Quick Check
Which part of the workspace is like a 'toolbox' where you find your coding blocks?
Answer
The Block Palette
To make a program, you drag a block from the Palette and drop it into the Script Area. If you bring a second block close to the bottom of the first one, a gray shadow will appear. When you let go, they will snap together like puzzle pieces! This stack of blocks is called a script. Computers read these scripts from top to bottom, just like you read a page in a book. If you have blocks in a stack, the computer does the first one, then the second, and finally the third.
1. Look in the Block Palette for a blue 'Move' block. 2. Drag the 'Move steps' block into the Script Area. 3. Drag a 'Say Hello' block and snap it to the bottom of the move block. 4. You have now created a script that tells your Sprite to walk and then talk!
Quick Check
In what order does the computer read the blocks in a script?
Answer
From top to bottom
Once you have built your script, you need to tell the computer when to start. Most programs use the Green Flag button as the 'Go' signal. To make this work, you must attach a special 'Event' block to the very top of your script that says 'When Green Flag Clicked.' If you want everything to stop immediately, you can click the red Stop button next to the flag. It’s like a traffic light for your code!
1. Drag the 'When Green Flag Clicked' block to the Script Area. 2. Snap a 'Move steps' block underneath it. 3. Snap a 'Play Sound' block at the very bottom. 4. Click the Green Flag above the Stage to watch your Sprite move and make noise at the same time!
Try to build a script where your Sprite moves in a small square. 1. Start with the 'When Green Flag Clicked' block. 2. Use a 'Move steps' block. 3. Snap a 'Turn degrees' block underneath. 4. Repeat those two blocks times to complete the shape!
What is the name of the area where you drag blocks to build your code?
If you have a stack of blocks, which block does the computer run first?
The Red Stop button is used to start your program.
Review Tomorrow
Tomorrow morning, try to remember the names of the three main parts of the coding workspace without looking at this guide.
Practice Activity
Open the coding sandbox and try to snap together five different colored blocks. Press the Green Flag to see what happens!