Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   Share Worlds (http://www.alice.org/community/forumdisplay.php?f=6)
-   -   A drag race game (http://www.alice.org/community/showthread.php?t=1008)

DickBaldwin 10-16-2007 01:37 PM

A drag race game
 
1 Attachment(s)
In case anyone is interested, I have written a drag race game. You can read about it and download the world at [URL]http://www.dickbaldwin.com/alice/Alice0930.htm#Drag_race_game[/URL]

[B]Drag race game at startup[/B]
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.
[B]
The Christmas tree lights[/B]
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.

[B]Go on green[/B]
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.

[B]Crossing the finish line[/B]
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.

[B]And the winner is ...[/B]
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.

ottosparks 11-19-2007 03:50 PM

Uhhhhh..
 
I can't find the Download link on there.... can you add a direct download link HERE?

lanceA 11-19-2007 07:35 PM

I've already used it in a class Dick. It led to some good discussions. Thanks for sharing.

DickBaldwin 11-19-2007 07:38 PM

[quote=lanceA;4131]I've already used it in a class Dick. It led to some good discussions. Thanks for sharing.[/quote]

You're welcome.

Dick Baldwin
Free Alice tutorials: [url]http://www.dickbaldwin.com/tocalice.htm[/url]
Free programming tutorials: [url]http://www.dickbaldwin.com/toc.htm[/url]

DickBaldwin 11-19-2007 07:43 PM

[quote=ottosparks;4130]I can't find the Download link on there.... can you add a direct download link HERE?[/quote]

Go to the following URL:

[U][URL]http://www.dickbaldwin.com/alice/Alice0930.htm#Resources[/URL][/U]

Click on the link that reads "Download the Alice a2w files for the sample programs presented in this appendix."

Dick Baldwin
Free Alice tutorials: [URL]http://www.dickbaldwin.com/tocalice.htm[/URL]
Free programming tutorials: [URL]http://www.dickbaldwin.com/toc.htm[/URL]

ottosparks 11-20-2007 07:13 AM

[QUOTE=DickBaldwin;4133]Go to the following URL:

[U][URL]http://www.dickbaldwin.com/alice/Alice0930.htm#Resources[/URL][/U]

Click on the link that reads "Download the Alice a2w files for the sample programs presented in this appendix."

Dick Baldwin
Free Alice tutorials: [URL]http://www.dickbaldwin.com/tocalice.htm[/URL]
Free programming tutorials: [URL]http://www.dickbaldwin.com/toc.htm[/URL][/QUOTE]
Thanks!:)




Mommy.... the train went swimming in the piano....

myfadingmuse 08-31-2010 02:43 AM

Hi Dick,

I showed this to my Grade 10 programming class, I got them to try and think about how you would have written the code for the drag race and it was a great activity to do! The kids loved it! Thank you so much for sharing this great Alice creation!


All times are GMT -5. The time now is 09:22 PM.

Copyright ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.