Making a Walking Animation
Now that you know how to move a sprite, let’s do something cool with that!
What is Costume?
A costume is one out of many alternate appearances of a sprite. Sprites can change their look to any of its costumes. They can be named, edited, created, and deleted. Every sprite has at least one costume.
One of the most common uses of costumes is to make an animation for a game or other project.
Activity: Making Tobi Walk
In this activity, we will create a small animation to make Tobi walk by switching between his costumes. Let’s begin!
Opening a New Document
If you are working on an existing script and you want to create a NEW one.
Click on File button and select New. If you haven’t saved your script, save it.
Choosing the Backdrop
Follow the steps below to add a backdrop.
Setting the Starting Point
We will set Tobi’s starting position using the following blocks from the Motion palette.
Saying “Hello”
We will make Tobi say “Hello” using a say block from the Looks palette.
Moving and Switching Costumes
To make Tobi look like he’s walking, we will use the following blocks:
- move block from the Motion palette
- switch costume from the Looks palette
- wait block from the Control palette. Write 0.1 instead of 1 to make the delay duration shorter
From the drop-down of switch costume block, choose the Tobi walking 1/ Tobi walking 2 costumes.
Running the Script Forever
To make Tobi walk continuously, we will use the forever block from the Control palette.
Adding a Hat Block
From the Events palette, we will add the following hat block. It will sense when we click Tobi and make it walk whenever we do so.
The entire script looks like this:
Maximize the stage and make Tobi walk! 🙂
Saving the Program
- To save the program, click on File > Save As.
- A window will popup. Choose the location as Desktop or any other relevant folder. Name the file Tobi Walking Animation.
- Click on Save.
Assignment
Before you move on to the next lesson, a small assignment awaits you!
You must upload the PictoBlox program you wrote in this activity to the website.
Submitting the assignment is a must in order to receive the certificate after completing the course.
Follow the steps below to upload your assignment:
- Click on Choose File.
- Select the image from the pop-up window that opens up.
- Once the image is selected, click on Upload Assignment.
Good luck!