Goal: Make something happen when the turtle touches a rock or the pond.
Vocabulary: announce, bk (back)

Notes Be sure the turtle has the instruction fd speed / 10 and is set to many times.
- In the Drawing center, choose a shade of blue you like and draw a pond. Choose a shade of brown or gray and draw some rocks. (If you like, you can first draw them in black and then fill them with brown or gray.)
- Right-click/ctrl-click on the color of your rocks to open the dialog box for that color family.
In the white box next to turtle, type:
announce [You hit a rock! Back up!] bk 50 stopall
Keep it set to once. Click OK.
Now when the turtle touches a rock, an announcement will pop up with the words in the brackets. After you click OK at the bottom of the announcement, the other instructions will run.
Bk 50 will move the turtle back 50 tiny turtle steps.
Stopall will stop all action on the page. You will have to click the turtle to start him moving again.
Note: When you program a color (when you write an instruction for it), it works for every shade of that color, from the lightest to the darkest. So you could make rocks that are different shades of brown (or gray) and the instruction will still work.
- Next, open the dialog box for the color of your pond. In the white box next to turtle, type:
announce [You reached the pond!] fd 25 stopall
Keep it set to once. Click OK.
Now when the turtle touches the pond, an announcement will pop up with the words in the brackets. After you click OK, the turtle will move forward 25 tiny turtle steps (to get farther into the pond) and then stop.
What If?
What happens if you remove the stopall command from the instructions for the colors?
Challenge
Try writing your own announcements for the brown and blue colors.
|