Goal: You can make a person appear to dance by telling the turtle to change its shape back and forth between two mirror-image animation shapes.
Vocabulary: setsh (setshape), wait
- Start with your Animate Me 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 Me 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 dance procedure as shown in the code section above.
Procedures ALWAYS start with the word to. This procedure is called dance so the first line of code is to dance.
Setsh means "set shape." Setsh "me1 tells the turtle to wear the me1 shape. Setsh "me2 tells the turtle to wear the me2 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 dancing speed!
Procedures ALWAYS finish with the word end on its own line.
- Create a button and label it dance. Set the button instruction to dance and make it do it Forever so that your character will keep on dancing. Try it out!
- Save your file!
What happens if you try wait 1
or wait 5
or wait 10
Can you change the dance
procedure to include all three shapes in your Shapes tab?