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

race cars 1 2 3 4 5 6
Race Cars 2
Screenshot
Turtle Face Get Web Player
  if you cannot see the project


Goal:   Two cars race at different speeds.




Vocabulary:   everyone

Code
Shapes
Project Map

code


Notes

To race two cars at different speeds:

  1. Hatch a second turtle and put a second car shape on it.   Drag it so it is roughly lined up with the first car.

  2. Everyone means that we are talking to all of the turtles at once, no matter how many.   Put the command(s) inside brackets.

    In the command center, type everyone [seth 90] to be sure that both cars will drive to the right.

  3. In the reset procedure, everyone [setx -225] lines up both cars at the same x coordinate.   (You may choose a different number to fit your project size.)  

  4. Place the eye tool on one turtle to open its dialog box, and give it the instruction fd 1.   Set it to many times.

  5. Place the eye tool on the other turtle and give it the instruction fd 2.   Set it to many times.  

    Now when you click on a turtle, it will move forward over and over again.

  6. In the go! procedure, everyone [clickon] is like clicking on all the turtles at the same moment.   This way, both cars can start the race at the exact same moment, but they can each follow their own instruction.




What If?
What if each car moves forward by a different fraction,
such as fd 1 / 2 or fd 1 / 3?


Challenge
Can you give each car a different starting position in the reset procedure so that they both reach the right edge of the project at the same time?




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