
11-29-2011, 01:12 AM
The exact solution will depend on what kind of road you have (straight, bending?). But in general terms you could use one or more dummy objects to define the edge of the track. Then you could use "distance to" functions to determine when the car goes off the track. Put the test inside a "when something is true" event and get the car to stop/slow whenever the event is triggered.
This is a similar problem to collision detection, so you might want to do a search on this. I have a video on collision detection - follow the first link in my signature.
For video tutorials on programming in Alice 2.2 check out my YouTube channel
http://www.youtube.com/user/drdave785
Also check out my Programming in Alice blog at
http://programminginalice.com
|