I recognise that there are 2 problems:
- The code can be refactored properly which is probably the issue that I am facing with trying to get my objects (cars) to behave properly.
- I am unsure of how I can implement a collision detection to do a simulation where the 2 cars will stop when they sense another vehicle coming from opposite direction
A good to have:
- A button press that will pause the simulation and continue when pressed again.
https://github.com/RAMTEJ001/cg-traffic-simulation
- Every time I implemented a pause button, my cars would disappear from the screen and when I pressed the button, they appeared on the screen again at a different location, basically, the translation continues and is not paused upon initial click.
New contributor
heheecskdeelmao is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.