Home
Project Folders
Teacher Resources
Student Resources
En ESPAÑOL
How Do I?
Literacy
MWForum
Site Map
Search
Our Team

ant hill 1 2 3 4 5 6
Ant Hill 3
Screenshot
Turtle Face Get Web Player
  if you cannot see the project


Goal:   A line of ants follows the leader while you control its speed and direction.




Vocabulary:   towards, distance, * (multiplication sign)

Code
Shapes
Project Map

code


Notes

A line of ants can play "Follow the Leader" as you control the speed and direction of the leader.

  1. Hatch three more turtles and shrink their size.

  2. Make a slider named speed.   Keep its minimum set to 0, and set its maximum to 20.

  3. In the go procedure, fd speed / 10 moves the ant forward one-tenth of the amount on the speed slider.

  4. T2, towards "t1 means, "Ant t2, point toward ant t1."   We also want t3 to point toward t2, and t4 to point toward t3.

  5. Fd 1 / 20 * distance "t1 means, "Move forward one-twentieth of the distance to ant t1."

    This way, each ant will be constantly pointing toward and moving toward the ant in front of it without ever catching up to it.




What If?
Try fd speed or fd speed / 5 to change the range of your ants' speeds.   Try changing the maximum on the speed slider.


Challenge
Can you adjust the go procedure so that the ants are always closer together? Always farther apart?


On Your Own - Project Ideas





© copyright 2001 - 2008  OpenWorld Learning.   All rights reserved.