A recreated 1996 2D physics simulation, remastered in JavaScript for its 30th anniversary, reproduces the small wireframe demo that became the basis of the vehicle system later used in Grand Theft Auto. It’s an interactive Motion Lab you can play in a browser with touch and keyboard controls, offering three modes - Car, Ship, and Brick - plus toggles for barriers, gravity, camera dead zone and speed-related zoom. The original started on an Atari ST in GFA BASIC and was later ported to C; this recreation preserves the feel while separating controls, a fixed-step simulation, and Canvas rendering so you can see how inputs become forces and how forces become motion.
Technically, the core is a classical 2D rigid-body dynamics solver (position, velocity, angle, angular velocity) that sums forces and torques and uses a simple barrier impulse solver; that choice avoided many of the “point physics” hacks common in games then and produced more coherent rotation. On top of that sits a deliberately approximate tyre model: each tyre samples its local velocity and applies small longitudinal rolling resistance and a much larger lateral resistance proportional to velocity (a damping-style model), with steering altering front-wheel headings and the handbrake increasing rear resistance and reducing rear lateral grip. Modes reuse the same body with different shells and force models (thrust for Ship, pointer forces for Brick), and contact points use midpoints of faces to prevent artificial spin.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.