Lesson goal: Pole Position: Speed, Curves & Steering

Previous: Breakout: Reflection Angles & Paddle | Home | Next: Billiards: Elastic Collisions, 90° Rule & Ghost Ball

In 1982, Namco and Atari released Pole Position, designed by Toru Iwatani (the creator of Pac-Man). It pioneered the behind-the-car pseudo-3D perspective and became the most popular arcade racing game of its era!

Instead of unpredictable twitch steering, the game is powered by clean, deterministic kinematics:

Track Coordinates & Motion

  • Track Distance ($s$): Distance from the starting line in meters ($0$ to track finish).
  • Lateral Road Lane ($x$): Normalized position across the road from $-1.0$ (left curb) to $+1.0$ (right curb). Center line is $x = 0$. Left lane is around $x = -0.6$, right lane is $x = +0.6$. If $|x| > 1.0$, you are off-road in the dirt!
  • Acceleration ($a$): With full throttle, the Formula 1 racer accelerates at a constant $15\text{ m/s}^2$ up to top speed $v_{\text{max}} = 60\text{ m/s}$ ($216\text{ km/h}$ / $134\text{ mph}$).
  • Time to Top Speed: $$t_{\text{accel}} = \frac{v_{\text{max}}}{a} = \frac{60}{15} = 4.0\text{ seconds}$$ Distance covered while accelerating: $$d_1 = \frac{1}{2} a t^2 = \frac{1}{2} (15)(4.0)^2 = 120\text{ meters}$$
  • Cruising at Top Speed: Once at $60\text{ m/s}$, the car travels $60\text{ meters}$ every second ($d = v \cdot t$).
  • Curvature & Centripetal Drift: When entering a turn, the curving road pulls laterally beneath your car. If you do not steer into the turn, centrifugal drift pushes your car outward into the grass!


Controlling Your Racer with Code

  • pole_position(track): Loads deterministic Track #1 to #4. Every run produces 100% reproducible physics!
  • drive(seconds, lane_x): Powers forward with full throttle for seconds, steering toward lane_x (e.g. drive(4.0, 0)). If lane_x is omitted, holds your current lane.
  • steer(lane_x): Sets your target lane position ($x \in [-1, 1]$).
  • brake(seconds): Applies brakes to slow down before sharp corners.
  • coast(seconds): Releases throttle to coast under engine drag.
pole_position(1)
drive(12.0)
Move the mouse over a dotted box for more information.

  • Live Telemetry HUD: Displays current speed in km/h and m/s, track distance covered, elapsed lap time, and current lane position.
  • Mini-Map Progress: Track progress bar at the bottom shows your car (cyan), rival traffic (orange/green), and the finish banner.
  • Manual Driving: You can also drive interactively with keyboard: ↑ Gas, ↓ Brake, ← / → Steer!

Now you try. Can you sprint to the finish in Track #1, or steer through the curve in Track #2?

Type your code here:


See your results here: