14 minutes
Civilian Traffic
The highway is empty. Traffic has to be there whenever you look, at any speed, and it must never pop into view. At rest the screen shows the road from 10 m behind your car to 37 m ahead. A car that appears inside that strip looks like a glitch.
Cars per hundred metres
So new cars come on far up the road, 110 to 240 m ahead. Once they fall 100 m behind, they go back to their pool, a stock of spare cars parked out of play. Both ends are well off screen:

The first idea for how many cars is a clock: send one every so often. But the count on the road is the rate times how long each car stays, and that depends on you. Park, and each car drives off up the road and leaves. Drive at the traffic's own pace, and a car stays with you for good.
HighwaySpawner works from a density instead. It turns the length of the window into a target number of cars:
traffic(level) is 1 on level 1, where this series stays, and climbs a little with each level after that. With our scene's numbers:
Continue reading
Unlock the Full Course
Every lesson, the runnable examples, and the finished build — yours to keep.