need advise for implementing this in my car game

Posted By: jpxtreme

need advise for implementing this in my car game - 02/28/11 14:23

Hello. I'm making a car driving simulation game. I just would like to ask for an advise or idea. How do I know if the player is driving the wrong road? If it is, then it will cause the player a violation.

Please give me an idea or way how to achieve this. I've tried to use events but I don't know the logic to do this.
Posted By: flatron

Re: need advise for implementing this in my car game - 02/28/11 20:12

you can have a path along road and in a while check angle between car and next node in path.
Posted By: darkinferno

Re: need advise for implementing this in my car game - 02/28/11 21:20

i'm not sure but i think you could also store the direction of each road in a skill, maybe an angle, like:

my.DriveDirection = 0

then when the player vehicle is driving on it, you could do something like:

if(playerVehicle.pan>my.DriveDirection+20 || playerVehicle.pan<my.DriveDirection-20)
error("YOUR DRIVING THE WRONG DIRECTION");

just an idea.. idk if it helps
© 2024 lite-C Forums