Friday, 3 March 2017

All the Cars!

The next few steps in the project were to spawn several cars in all lanes at random intervals and with random speeds. We did this by basing our code on the code of the fish and boids from the second lab and giving the code for our cars the same structure as the code in that lab.

We first randomly spawned one car in every lane. As seen in the following video.
(video 1)





We then want to spawn more than one car in every lane, at random intervals and randomly in every lane.
This is what we see in the following video.
(video 2)



We now have a highway with traffic! But the cars drive through each other if they one catches up to another. This will be the next thing to fix.


(excuse the quality of the videos, a recording of the computer screen…)

No comments:

Post a Comment