Wolfenstein raycaster · claude-opus-5
Build a first-person raycasting maze shooter on a canvas in the Wolfenstein 3D style: WASD movement and arrow or mouse turning through a textured grid maze with enemies you can shoot. Procedural textures only, no external assets.
transcript · 6 messages
Build a first-person raycasting maze shooter on a canvas in the Wolfenstein 3D style: WASD movement and arrow or mouse turning through a textured grid maze with enemies you can shoot. Procedural textures only, no external assets.
I'll build a complete Wolfenstein-style raycaster in one file.
{"command":"ls -la /tmp/ws"}total 0 drwxr-sr-x. 2 node node 6 Aug 3 00:23 . drwxrwsrwx. 3 root node 16 Aug 3 00:23 ..
thinking
I'm building a 3D maze engine with procedurally generated textures stored in offscreen canvases for efficient texel lookups, using DDA raycasting to render textured walls with floor and ceiling shading, sprite rendering with a z-buffer for depth, enemy AI that chases and shoots at the player, and a procedurally drawn gun sprite. I'll generate 64x64 textures as pixel arrays and render them into an ImageData buffer, using a fixed internal resolution that gets upscaled with pixelated filtering. Enemy sprites will be procedurally drawn on canvas with multiple animation frames like walking and attacking. Writing texture and sprite generation... For the rendering pipeline, I'm implementing floor and ceiling casting per row for performance—casting rays downward and upward from the horizon to texture the ground and sky. Sprites get sorted by distance and drawn with a z-buffer check to handle occlusion properly. Enemy AI uses state machines for idle, chase, attack, and death states, with line-of-sight checks via raycasting and pathfinding that avoids walls. Shooting is hitscan—a single ray from the camera checks which enemies are in front and picks the closest one. I'm adding procedural WebAudio for gunshots and hit sounds, plus ammo and health pickups as sprites, and a level exit trigger to complete the map. Now I'm implementing the actual rendering code with proper floor casting math, texture lookups with distance-based shading, and a simple vertical bob for the gun while keeping the horizon fixed. For sprites, I'm using the standard screen-space transformation to project enemy positions onto the camera plane, then drawing guard frames programmatically with simple rectangles for the uniform, head, and weapon. Writing sprite rendering code... I'll handle collision detection with a circle radius of 0.25 against the grid, and layer the minimap and gun UI on top of the 3D canvas using 2D drawing operations after the pixel data is rendered.
/tmp/ws/index.html (46577 bytes)Successfully wrote 46577 bytes to /tmp/ws/index.html
TAKE IT TO CODE
A single self-contained HTML file — copy it and open in any browser, or reuse the prompt with your own pi-agent run.
RUN
EVALUATION
Static start menu for a maze shooter game; no input triggered the game to start or change state.
Vision grade · anthropic/claude-sonnet-5
MEASUREMENTS
Raw readings from the capture, not a verdict — the grade above is the only judgement. Percentages are how much of the screen changed; the measure under-reports sparse motion on a dark background.