A 3D maze screensaver inspired by the classic Windows 3D Maze, with amazed Osaka plastered on every wall. Some walls get cursed image effects (deep-fried, vaporwave, blood red, nuclear green, etc.) applied randomly. A sound plays every time the camera turns. The whole thing auto-traverses the maze like the original screensaver.
demo.mp4
A recreational project I made to learn Rust and raylib better. The idea came from a meme I saw on Discord one day.
- Fullscreen 3D maze with textured walls
- 10 randomized image effects on walls (negative, deep-fried, rainbow, sepia, teal, grayscale, vaporwave, blood red, posterized, nuclear green)
- Auto-traversal using right-hand wall following
- Smooth camera interpolation (position lerp + constant-speed yaw clamping)
- Ghost/schizo mode: semi-transparent overlay of a second solver using left-hand rule from the opposite corner
- Sound effect on every turn (with pooled aliases so rapid turns don't cut each other off)
- Single self-contained binary, all resources (textures, audio) are embedded at compile time
- Wayland and X11 support
| Key | Action |
|---|---|
| Space | Pause / unpause |
| Q | Quit |
| M | Mute / unmute |
| G | Toggle ghost/schizo mode |
The maze is generated using recursive backtracking with a 30% straight-line bias. When carving paths, there's a 30% chance the algorithm continues in the same direction rather than picking a random neighbor. This keeps corridors feeling natural without being either too winding or too straight.
After generation, ~20% of remaining interior walls are randomly removed to open up wider corridors and reduce dead-end density.
Every 4th wall gets a random image effect applied. The assignment ensures no two adjacent special walls use the same effect, so you don't get identical walls side by side.
The main camera traverses the maze using the right-hand rule: always try turning right first, then straight, then left, then turn around as a last resort.
Ghost mode runs a second solver using the left-hand rule (the mirror opposite) starting from the far corner of the maze. Its view is composited on top of the main view at low opacity using render textures.
The maze is rendered using raylib's 3D model system. Each wall is a textured cube mesh. Two render textures are used for compositing: the main view renders at full opacity, and the ghost view (when active) renders to a separate texture that gets drawn on top with alpha blending.
cargo build --releaseThe binary is fully self-contained. No external resource files needed.
nix develop
cargo build --releasePRs are welcome, whether it's new image effects, maze generation tweaks, or something completely unhinged. Just open an issue or PR and we'll figure it out.
Max (maxethra)