When we open Scratch, we notice that the development environment roughly divides into three distinct sections, as seen in the following screenshot. Moving from left to right, we have the following sections in sequential order:
Let's see if we can get our cat moving:
Congratulations! You created your first Scratch project. Let's take a closer look at what we did just now.
As we clicked through the blocks palette, we saw that the available blocks changed depending on whether we chose Motion, Looks, or Control. Each set of blocks is color-coded to help us easily identify them in our scripts.
The first block we added to the script instructed the sprite to display costume2. The second block provided a way to control our script by clicking on the flag.
Blocks with a smooth top are called hats in Scratch terminology because they can be placed only at the top of a stack of blocks.
Did you look closely at the blocks as you snapped the control block into the looks block? The bottom of the when flag clicked block had a protrusion like a puzzle piece that fits the indent on the top of the switch to costume block.
As children, most of us probably have played a game where we needed to put the round peg into the round hole. Building a Scratch program is just that simple. We see instantly how one block may or may not fit into another block.
Stack blocks have indents on top and bumps on the bottom that allow blocks to lock together to form a sequence of actions that we call a script.
A block depicting its indent and bump can be seen in the following screenshot:
When we clicked on the Costumes tab, we learned that our cat had two costumes or appearances. Clicking on the costume caused the cat on the stage to change its appearance.
As we clicked around the sprites list, we discovered our project had two sprites: a cat and a stage. And the script we created for the cat didn't transfer to the stage.
We finished the exercise by clicking on the flag. The change was subtle, but our cat appeared to take its first step when it switched to costume2.
Inside every Scratch project, we find the following ingredients: sprites, costumes, blocks, scripts, and a stage. It's how we mix the ingredients with our imagination that creates captivating stories, animations, and games.
Sprites bring our program to life, and every project has at least one. Throughout the book, we'll learn how to add and customize sprites.
A sprite wears a costume. Change the costume and you change the way the sprite looks. If the sprite happens to be the stage, the costume is known as a background.
Blocks are just categories of instructions that include motion, looks, sound, pen, control, sensing, operators, and variables.
Scripts define a set of blocks that tell a sprite exactly what to do. Each block represents an instruction or piece of information that affects the sprite in some way.
Think of each sprite in a Scratch program as an actor. Each actor walks onto the stage and recites a set of lines from the script. How each actor interacts with another actor depends on the words the director chooses. On Scratch's stage, every object, even the stone in the corner, is a sprite capable of contributing to the story.
As directors, we have full creative control.
3.16.76.227