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

race cars 1 2 3 4 5 6
Race Cars 5
Download
6 KB


Goal:   Give the cars a hidden part of each lap.


Screenshot


Vocabulary:   ht, st, wait

Code
Shapes
Project Map

code


Notes

We can add some commands to the programmed colors so that the cars will disappear for little while and then come back.   (This way it will seem as if they are continuing the race on another part of the track which we can't see.)

  1. Add this at the beginning of the instructions for each color:
    ht wait random 50 st

    Ht means "hide turtle."   The turtle will disappear.

    Wait random 50 means, "Wait a random amount of time that is less than 50."   Each number is 1/10 of a second.   Wait 10 is one second.   Wait 50 is five seconds.   So each car will disappear for up to five seconds and will not be moving during that time.

    St means "show turtle."   The turtle will appear again.

    Then the turtle will finish running the instructions (adding 1 to its lap-counting box) and will continue racing.   Every time a car touches its starting line, it will again be hidden for up to five seconds before it continues racing.

  2. We need to add st to the reset procedure to be sure that we can see the cars again when we start over.

  3. A car runs faster when it is the only one moving.   So we will slow down the cars by changing their instructions to fd random 3.




What If?
What happens if you change the number after wait?
What happens if you change the number after fd random in the OnClick rule of each turtle's backpack?


Challenge
Can you "fix" the race so that one car has an advantage over the other?


On Your Own - Project Ideas
Can you make another animation in which an object disappears when it touches a color? Can you make it reappear when it touches another color? (Can you make an airplane disappear as it passes through clouds? or an animal disappear as it passes through a hollow log?)





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