Traffic on the I-95

The code consists of lines moving vertically down the screen, with certain lines stopping in their
path and continuing once again when another line passes by. The project is supposed to
resemble road traffic from a bird’s eye view. My motivation for the design of the code includes
my fascination with exploring societal elements from a bird’s eye view and the exploration of
patterns in daily life. The lines represent the simple act of observing traffic. The visual plays with
the interaction between movement and pause, the lines move and stop and work with the
element of proximity, creating a small ripple effect. I see traffic as poetry and simplifying the
mundane activity of either being in traffic or noticing it from a vantage point. The piece is
almost meditative to me. I chose to keep the background plain with the colors of the cars
resembling sprinkles with pastel colors so viewers can experience the piece as light-hearted,
keeping an element of calm that juxtaposes the feeling of being in traffic.

Code

Every 5 second the program selects a random car from the cars list and is moved into the stopped cars list and the car temporarily stops 

(StopTimer) – each car has a timer that decreases with every frame and once reached 0 the car moves again 

(leader) car is checked to avoid collisions and then the car picks up speed and continues 

adjustSpeed(Car leader) in moving car class essentially checks the distance to the car in front and slows down 

stopTimer determines how long the car stays stopped in the stopped car class

color (random(100, 255 ) – the color of the cars are random between 100 and 255 on RGB scale so I could get the pastel colors, so all the cars would vary in their color 

Author: Akina Nanayakkara