So far, the main character
has only performed actions that
were included in the starter project.
The next two videos will show you how
to create the new message and another
action for the main character.
First, program the main character to walk.
Click the main character to start.
To make the main character look like
it is walking, use the switch costume block.
There are two walking costumes.
So, drag out two switch costume blocks.
From the drop-down menus select Walking1 and Walking2.
Test the code by clicking the blocks a couple times.
It looks like nothing's happening between clicks.
That's because the computer executes
one instruction after the other
too quickly for you to see the change.
To slow it down, place a wait block
in between the two switch costume blocks.
Now you can see the costumes change.
Repeat this change with a repeat loop.
Test it by clicking the code.
It works, but the main character
kind of looks like it's twitching instead of walking.
Read the code to understand why.
It reads, switch costume, wait,
switch costume and switch costume again.
The program doesn't pause before restarting the loop.
Add another wait block after switch
to costume Walking2, test it.
The main character's walking looks less awkward now.
The main character looks like it's walking
but it doesn't go anywhere.
Add some move blocks after the switch costume blocks
to make the main character move while it walks.
Test it one more time.
The main character walks backward.
To fix that, try making it move
negative 10 steps instead of 10 steps.
Now it walks in the direction it's facing.
Have fun tinkering with this code.
Change how far the main character walks
by changing the number in the move blocks
or in the repeat loop.
Change how fast the main character walks
by changing the values in the wait box.
In computer science, it often takes more
than one try to find the right solution to a problem.
Keep coding, testing, and trying solutions
until you find the one that works.
In the next step, you'll broadcast a message
from the narrator to make your main character walk.
Now it's your turn.
Use the repeat, switch costume, wait,
and move blocks to make the main character walk.
Tinker with the values in the blocks
until you like how the main character walks.
Sign in to track your progress and earn badges