Goal: You can make a bug appear to move by telling the turtle to change its shape back and forth between two slightly different animation shapes.
Vocabulary: setsh (setshape), wait
- Start with your Animate Bugs 1 file. You always start with the previous MIA file so you don't have to redraw things or rewrite code.
- From the File menu choose Save Project As. Name your file Animate Bugs 2 since you're working in project number two now.
- Hatch a new turtle onto the page by clicking on the turtle button in the toolbar and then clicking on the page. You only need one turtle for now.
- Now you're ready to teach the turtle a new word with a procedure! In the Procedures tab, type the move procedure as shown in the code section above.
Procedures ALWAYS start with the word to. This procedure is called move so the first line of code is to move.
Setsh means "set shape." Setsh "bug1 tells the turtle to wear the bug1 shape. Setsh "bug2 tells the turtle to wear the bug2 shape. Don't forget the " before the name of the shape!
Wait 2 tells the turtle to wait a little bit before going on to the next command.
Wait 10 means "wait one second."
Wait 1 means "wait 1/10 of a second."
Wait 2 means "wait 2/10 of a second." This is a good moving speed!
Procedures ALWAYS finish with the word end on its own line.
- Create a button and label it move. Set the button instruction to move and make it do it Forever so that your character will keep on moving. Try it out!
- Save your file!
What happens if you try wait 1
or wait 5
or wait 10
Can you change the move procedure to include all three shapes in your Shapes tab?