Goal: You can make your bug move across the page if you tell it to move forward a little bit every time it changes shape.
Vocabulary: setsh (setshape), wait, fd (forward)
- Start with your Animate Bugs 2 file. From the File menu choose Save Project As. Name the file Animate Bugs 3 because now you're working on the third project.
- Adjust your move procedure so it looks like the one above in the code section. Now the move procedure includes fd 5 which means "forward 5" and moves the shape forward 5 tiny turtle steps.
- Remember that new turtles are always facing straight up. This bug is really a turtle in disguise. We need to turn the turtle so that the bug will move sideways instead of straight up.
Down in the command center, type: seth 90
We say it, "set heading 90." We are telling the turtle, "Set your heading to 90 degrees." That means: "No matter which way you were already facing, face straight to the right."
(Be sure to hit the Enter/Return key after you type seth 90. You will not see any change in the shape itself, but the turtle wearing this shape will face straight to the right and will move to the right when you click the button. You only need to do this one time. The turtle will remember which way it is facing, next time you open the project.)
- Set the move button to Forever so that your bug will keep on moving.
- Make a stopall button with a stopall instruction, to stop all of the action on the page. (Stopall is one word and it tells all of the turtles and actions to stop.)
- Save your file!
What happens if you type seth 100
or seth 120
in the command center?
What happens if you type a larger number after fd
Can you make your bug move straight to the left?