A positive (+) # number moves →to the right. A negative (-) # number moves ←to the left.
You can activate script blocks by double clicking their colored areas. Try it out.
Sprites can have different costumes. They can switch between →← costumes to change the way they look. This sprite has 2 costumes already. The cat’s legs are in different positions. If it switches back ← and forth→ between these costumes, the cat will look like it is taking steps.
Click
in the Top Left Menu.
Find and drag it into the script window.
You can connect blocks on their tops and bottoms.
These two blocks tell the cat take one cat-step to the right.
Why does the block say 10 steps?
Here, ‘steps’ means: # number of pixels → to move in the direction that the sprite is facing. You will learn more about this in Lesson 3.
Pixels are tiny blocks of color that are combined together to make images.
When Script Blocks are connected, they activate together, starting from the top.
One way to respond to the keyboard is to addto the top of a list of commands. The commands will then start when a certain key is pressed.
you can find this command by clicking control in the Top Left Menu
Drag to the script window and snap it to the top of your list.
Change the keystroke to right arrow instead of space.
Click the Green Flag to start your scripts.
From here on, you will start seeing this image:
When you see this, it means that you should click the Green Flag and test out your program.
Now that there is a cat sprite that can walk to the right, you need to make one that can walk to the left.
The Stamp is a World Tool. Stamping a sprite makes a copy of it.
Make a copy of the cat sprite by stamping it.
Select Sprite 2. You can use this new sprite to walk left.
Each sprite has its own Scripts, Costumes and Sounds. Everything gets copied when you used the stamp tool.
It is best to name a sprite after what it is.
Change the name to “catLeft”.
Click the Costumes Tab
Click the Edit button to edit costume2.
The editing window will open.
Click the Flip Horizontally button to make the cat face the other way.
You must do the same thing for the other costume.
If you have not done so already, rename the sprite that is facing right, to catRight.
To make the sprites work together, you have to only have one showing at a time. It is easy to hide and show sprites as long as you can figure out when to do it.
You want catLeft to show when the left arrow is pressed and hide when the right arrow is pressed.
You want catRight to show when the right arrow is pressed and hide when the left arrow is pressed.
Click in the TOP LEFT Menu. Find and .
Make the sprite hide and show when it needs to for both sprites.
Both of the sprites are just different views of the same cat so you want both sprites to move at the same time even if they are not showing.
Now you need to make sure that both sprites are in the same spot.
If both sprites are not showing, you can show the one that is hiding by right-clicking the sprite’s button (control click for Mac) and clicking ‘show’.
You can drag and move sprites. A good way to put them in the same spot is to align the tips of the ears.
Test out your program by pressing the left and right arrow keys.
Save your project so you can use it later. Save it as “Lesson 1” in a new folder “Lessons”.
To make a new folder, click the new folder button in the save window.