I am working on a program and i would like to be able to let the user control a vehicle on the program. The issue that i am having is that i would like to restrict the user to stay within a certain circle. This is what i am unsure on how to do.
Does anyone know how to go about creating random movements for a vehicle? I think this could be accomplished with having a variable that is randomly selected(forward, reverse, left, right, etc) then random choose a number for the distance to travel.
And going along with the second part, how would i write(if its even possible) that if the user controlling the car, collides with the other car(computer controlled), then do a method(crash sound, fire, etc)?
Any help would be much appriciated.