Alice Community Conditional Collision

 Conditional Collision
 Sir Longfellow Junior Member   Status: Offline Posts: 1 Join Date: Nov 2011 Conditional Collision - 12-11-2011, 09:50 PM Before I ask my question I'll lay out what I'm trying to do. Basically, what I want to do is have a car drive a given amount of time, in one direction, with various objects in the way. The user of the program will be able to move the car side to side with the arrow keys in order to avoid these obstacles. Once they have driven through the whole "course" then the game will end and ask if they want to play again. What I want to know how to do is how to make the car stop and the game end when it touches or "collides with" another object. I put in an if statement saying something like "if car is within x distance of object move back .2 meters", but it just passes through.
 GameKid Senior Member     Status: Offline Posts: 467 Join Date: May 2011 Location: My magnificent castle 12-11-2011, 11:43 PM Do mind that in distance to functions, it means the center, not the rim. As for the distance, I reccomend the subject's width. For example, to run into a building, If car distance to building
 possible help
 AliceMaster00 Senior Member     Status: Offline Posts: 167 Join Date: Oct 2011 Location: You know that gap between the bottom of your dresser and the floor? Yeah, there. possible help - 12-12-2011, 12:22 AM I suggest that you put 'if car is 2 meters of building move back 0.1 meter 0.1 secondds abruptly.' Once you've done that then create an event that says 'While camera is within 2 meters of building is true Begin: During:Camera move back 0.1 meters 0.1 seconds abrubtly. End: What a piece of work is a man? How noble in reason, how infinite in faculties, in form and in motion, how express and admirable how like an angel! What apprehension oh how like a god! The beauty of thee world, the paragon of animals, and yet- to me, what is this quintessence o' dust? Man delights, not me. Nor woman either, nor woman either.

 Thread Tools Display Modes Linear Mode

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     Community News and Announcements Alice 3     How Do I?     Works In Progress     Share Your World     Share Custom Classes     Bugs and Trouble Shooting     Suggestion Box Alice 2     How do I...?     Works-In-Progress     Share Worlds     Share Objects     Bugs and Troubleshooting     Suggestion Box Educators     Teaching with Alice     Teaching Using Alice 3     Teaching Using Alice 2     CS Principles and Alice     AP CSA and Intro to Java and Alice     Workshops General Discussion     Questions and Comments     The Lounge