View Single Post
A drag race game
Posts: n/a
Default A drag race game - 10-16-2007, 01:37 PM

In case anyone is interested, I have written a drag race game. You can read about it and download the world at

Drag race game at startup
Two cars are at the starting line with instructions to the user to click on a car to start the race. By clicking a particular car, the player not only starts the race, but also predicts which car will win the race.

The Christmas tree lights

From what I read, drag races are started by running a drag strip "Christmas tree" through several colors of lights with the green light being the signal to start moving down the track. When the user clicks on one of the cars, a simulated drag strip "Christmas Tree" cycles through red, yellow, and green.

Go on green
When the Christmas tree turns green, the two cars start moving down the track. A while loop and a random number generator are used to control the motion of each car. During each iteration of the while loop, each car moves forward by a random distance ranging from 0.5 to 1.5 meters.

Crossing the finish line
When a car crosses the finish line during an iteration of the while loop, the loop terminates and the motion of both cars stops. The winner is determined to be the car that went the greatest distance beyond the finish line before stopping.

And the winner is ...
Text at the bottom of the world shows which car won, and also shows whether or not the player correctly predicted the winner by clicking on the car that won the race.
Attached Files
File Type: a2w DragRace01.a2w (394.8 KB, 1379 views)

Last edited by DickBaldwin; 11-25-2007 at 02:43 PM. Reason: Upload the a2w file now that upload is working.
Reply With Quote