11 minutes
Oil and Smoke
Everything you fire goes forward. A rammer on your back bumper is safe from your gun, and so is a gunner closing from behind.
This lesson gives the car two rear weapons. Q pours an oil slick on the road behind you. R leaves a cloud of smoke.
Spin from a slick
A car that drives onto oil loses its grip and spins. The game has to answer two questions: which way, and how many times.
Which way depends on where the middle of the slick is. Take an arrow that points straight across the car, out of one door. The dot product, the · below, measures how far the slick's middle sits along that arrow: plus on the side the arrow points to, minus on the other. That sign picks the spin:

Either way, the nose swings toward the slick's middle.
The second answer is once, on the way in. After that one kick the car slides on its old line while the spin winds down, the slide you met in lesson 1.6. In the model, with the car sliding straight, every car ends up turned 123°, about a third of a turn, from any line and at any speed. In the game the driver steers and crashes add spin, so rammers ended between 109° and 136° after one slick.
Continue reading
Unlock the Full Course
Every lesson, the runnable examples, and the finished build — yours to keep.