Canvas2D reimplementation of Gorillas.BAS with fixed timestep physics and destructible terrain

I rebuilt the early 90s QBasic game Gorillas.BAS as a fully browser-native Canvas2D game to explore how far a lightweight rendering stack can be pushed without a framework.

It’s a single-file implementation with:

  • deterministic fixed-timestep physics loop
  • destructible terrain using a mask buffer
  • procedural skyline generation
  • CPU opponent with adaptive aiming correction
  • keyboard + touch input system
  • particle-based explosion system
  • full game state machine (aim → flight → resolution)

Everything runs entirely in Canvas2D with no external dependencies.

This is not a Three.js/WebGL demo, but it follows many of the same principles used in real-time engine design (state management, simulation loop decoupling, spatial collision logic, etc.).

Even though it’s Canvas2D, the same architecture patterns apply directly to 3D engines:

  • fixed timestep simulation
  • input abstraction layer
  • separation of simulation vs rendering
  • entity state management
  • procedural world generation

Live demos
CodePen: https://codepen.io/the-red-reddington/full/NPbGXKL
GitHub Pages: https://red-reddington.github.io/web-demos/gorillas
Source: web-demos/gorillas/index.html at 7bfcbfcc8bb08f6ae59499d3f467468483145a6d · red-reddington/web-demos · GitHub

1 Like