Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Thread Tools Display Modes
Chapter 7 Assignment 6 - Bumper Cars
Posts: n/a
Exclamation Chapter 7 Assignment 6 - Bumper Cars - 10-10-2009, 06:22 PM

I'm having trouble completing the bumper car challenge. It's directions are to have 4 bumper cars in a loop of going around the bumper ring. They must turn every time they hit a wall or another car.
Reply With Quote
Senior Member
Dameria's Avatar
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 10-10-2009, 10:57 PM

How about you have an inner ring and and outer ring, and for the inner ring you do:
(loop infinite (if (car is within threshold of inner ring) do (car rotate right 0.05, duration: 0.25, style: abruptly))

And if the car hits outer ring, do the same thing, except rotate car left instead of right. The inner ring can be an oval in the middle of the track, and the outer ring you may have to build yourself.

You could also add the same thing with the other cars, but that would be a little more complicated, requiring more coding.
Reply With Quote

7.6, assignment, bumper car, chapter 7

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 ©2021, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.