Alice Community  

Go Back   Alice Community > Alice 2 > Share Worlds

Reply
 
Thread Tools Display Modes
A drag race game
Old
DickBaldwin
Guest
 
Status:
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 http://www.dickbaldwin.com/alice/Ali...Drag_race_game

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, 1346 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
Uhhhhh..
Old
ottosparks
Senior Member
 
ottosparks's Avatar
 
Status: Offline
Posts: 117
Join Date: Mar 2007
Location: here
Question Uhhhhh.. - 11-19-2007, 03:50 PM

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


I'm more lopsided than a three-legged badger!
   
Reply With Quote
Old
lanceA
Guest
 
Status:
Posts: n/a
Default 11-19-2007, 07:35 PM

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

Last edited by lanceA; 11-19-2007 at 07:36 PM. Reason: Typos
   
Reply With Quote
Old
DickBaldwin
Guest
 
Status:
Posts: n/a
Default 11-19-2007, 07:38 PM

Quote:
Originally Posted by lanceA View Post
I've already used it in a class Dick. It led to some good discussions. Thanks for sharing.
You're welcome.

Dick Baldwin
Free Alice tutorials: http://www.dickbaldwin.com/tocalice.htm
Free programming tutorials: http://www.dickbaldwin.com/toc.htm
   
Reply With Quote
Old
DickBaldwin
Guest
 
Status:
Posts: n/a
Default 11-19-2007, 07:43 PM

Quote:
Originally Posted by ottosparks View Post
I can't find the Download link on there.... can you add a direct download link HERE?
Go to the following URL:

http://www.dickbaldwin.com/alice/Ali....htm#Resources

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

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

Last edited by DickBaldwin; 11-19-2007 at 07:48 PM.
   
Reply With Quote
Old
ottosparks
Senior Member
 
ottosparks's Avatar
 
Status: Offline
Posts: 117
Join Date: Mar 2007
Location: here
Smile 11-20-2007, 07:13 AM

Quote:
Originally Posted by DickBaldwin View Post
Go to the following URL:

http://www.dickbaldwin.com/alice/Ali....htm#Resources

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

Dick Baldwin
Free Alice tutorials: http://www.dickbaldwin.com/tocalice.htm
Free programming tutorials: http://www.dickbaldwin.com/toc.htm
Thanks!




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


I'm more lopsided than a three-legged badger!
   
Reply With Quote
Old
myfadingmuse
Guest
 
Status:
Posts: n/a
Default 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!
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



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