Alice Community  

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

Reply
 
Thread Tools Display Modes
I need help with a racing game
Old
mslvr40
Member
 
Status: Offline
Posts: 16
Join Date: Nov 2011
Default I need help with a racing game - 11-18-2011, 08:31 PM

Hi. in my racing game I would like the car to stop or slow down when it goes off road. can you please either give me a link to an image with the method or a nother thread that has successfully solved this problem. Thank you
   
Reply With Quote
Old
davidghemer
Member
 
Status: Offline
Posts: 38
Join Date: Nov 2011
Default 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
   
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 ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.