Wolfenstein raycaster · claude-sonnet-5.5
Output generated Cost / run $0.1402 Runtime 72.0s
Prompt for this run
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.
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
METRICS
Transcript · 15 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.
/tmp/job-PDnB0h/index.html (11026 bytes)Successfully wrote to /tmp/job-PDnB0h/index.html
{"action":"click","x":600,"y":400}{"action":"screenshot"}Frame 1, +0ms
[Browser image supplied to model]
{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.","error: Blocked pointer lock on an element because the element's frame is sandboxed and the 'allow-pointer-lock' permission is not set.","error: Failed to execute 'requestPointerLock' on 'Element': Blocked pointer lock on an element because the element's frame is sandboxed and the 'allow-pointer-lock' permission is not set."],"dom":"","images":"attached"}
Frame 1, +0ms
[Browser image supplied to model]
{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.","error: Blocked pointer lock on an element because the element's frame is sandboxed and the 'allow-pointer-lock' permission is not set.","error: Failed to execute 'requestPointerLock' on 'Element': Blocked pointer lock on an element because the element's frame is sandboxed and the 'allow-pointer-lock' permission is not set."],"dom":"","images":"attached"}
thinking
Pointer lock being blocked in the sandbox is fine since it just errors harmlessly, so I'll wrap the request in a try/catch and add a fallback drag-based turning mechanism using mouse movement when the lock isn't active. Then I'll quickly test that firing still works.
{"command":"cd /tmp/job-PDnB0h && python3 - <<'E'\ns=open('index.html').read()\ns=s.replace(\"if(document.pointerLockElement===cv&&!over)ang{"action":"reload"}/bin/bash: line 1: python3: command not found Command exited with code 127
Frame 1, +0ms
[Browser image supplied to model]
{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing."],"dom":"MAZE SHOOTER\n\nWASD move · Arrows / mouse turn · Space / click fire · Shift run\n\nKill all guards to win. Click to start.","images":"attached"}
Python isn't available, so I'll make the edits with the edit tool.
{"path":"/tmp/job-PDnB0h/index.html","edits":[{"oldText":"if(document.pointerLockElement===cv&&!over)ang+=","newText":"if((document.pointerL{"action":"reload"}{"action":"click","x":600,"y":400}Successfully replaced 3 block(s) in /tmp/job-PDnB0h/index.html.
Frame 1, +0ms
[Browser image supplied to model]
{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing."],"dom":"MAZE SHOOTER\n\nWASD move · Arrows / mouse turn · Space / click fire · Shift run\n\nKill all guards to win. Click to start.","images":"attached"}
Frame 1, +0ms
[Browser image supplied to model]
{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.","error: Blocked pointer lock on an element because the element's frame is sandboxed and the 'allow-pointer-lock' permission is not set."],"dom":"","images":"attached"}
The game is in `/tmp/job-PDnB0h/index.html`. It loads and renders, but I only checked the start screen and the first view. I didn't test shooting, enemy attacks, or the win and lose screens. **What I saw:** Clicking the start overlay begins the game. The first view shows textured brick walls, a guard with a visible muzzle flash, the gun at the bottom, the minimap, and the health, ammo and kills HUD. **Pointer lock:** The test browser sandbox blocks it, so I couldn't try locked mouse turning. The error is only logged. I made the mouse still turn the view while a button is held, and the arrow keys always work. **Controls:** - **Move:** WASD, with Shift to run. - **Turn:** arrow keys or mouse. - **Fire:** Space or click. **Textures and visuals:** The brick, blue panel and green walls, the guards, and the shading are all generated in code, with no external assets. There is also a minimap in the corner. **Enemies and winning:** - **Enemies:** There are 15 guards. They wake when they see you, chase you, and shoot back. Each takes 3 hits. - **Win and lose:** You win by killing all of them. You lose if your health reaches 0. - **Restart:** Clicking the end screen restarts the game.