Goal: Two cars race at different speeds.
Vocabulary: everyone

Notes To race two cars at different speeds:
- Hatch a second turtle and put a second car shape on it. Drag it so it is roughly lined up with the first car.
- 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.
- 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.)
- Place the eye tool on one turtle to open its dialog box, and give it the instruction fd 1. Set it to many times.
- 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.
- 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?
|