This site requires JavaScript, please enable it in your browser!
Greenfoot back
VivekRajagopal
VivekRajagopal wrote ...

2015/3/30

Cars as object and they should stop from collision and stop in the traffic light also.

VivekRajagopal VivekRajagopal

2015/3/30

#
I have a city with road layout. The cars infront of other needs to be detected and the car which is going to make the collision should be stopped or paused from the current movement. Also I need to move the other car to prevent the traffic.
Super_Hippo Super_Hippo

2015/3/30

#
How I do it in my Traffic Simulation 2 simulation, is that I simply move the car more than it actually drives (+dx) and check for collision. So I can see if there is another car in front of it and if yes, it should brake. Then move back the distance that it moved "too much" (-dx).
You need to login to post a reply.