Skip to content

Please update your browser

Your browser version is not supported by this site. CS First may not work properly. Learn more

4. Die Hauptfigur auf der Bühne herumlaufen lassen


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 a 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 dropdown 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 then 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. 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” blocks.

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.

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.

In the next step, you’ll broadcast a message from the narrator to make the main character walk.

arrow_backward Zurück
Weiter arrow_forward
  1. Wechselt die Kostüme, sodass es aussieht, als würde die Figur laufen.
  2. Verlangsamt den Kostümwechsel, sodass man ihn sehen kann.
  3. Lasst den Kostümwechsel immer wieder wiederholen.
  4. Programmiert damit, dass die Figur sich bewegt.