Maze Screensaver in JavaScript

by | 2021-06-16

A mostly faithful re-creation of the Windows 95 3D Maze Screensaver in JavaScript with WebGL.
Based off the existing work of ibid-11962 from here:

The following changes have been made to improve faithfulness to the original screensaver:

Camera no longer stops to turn.
  • Camera makes move decision at edge of cell, not in center
    • Camera swings around corners instead of stopping to turn
    • Camera flips in front of fliprocks instead of inside them
    • Start image is in actual starting cell instead of one ahead
    • Happy face is visible as maze collapses instead of camera landing through it
  • Pathfinding method is randomly chosen between left-wall-hug or right-wall-hug at maze creation, instead of always choosing right
  • Fliprocks expand/collapse with maze at begin/end


Change linear movement to radial (arc), matching camera.
  • Rewrite turn algorithm to move position radially from one cell edge to next, instead of linearly
  • Add a speed governor routine to normalize travel speed regardless of framerate
Live Demo
Click Start to run. [Stop]