Wolfenstein raycaster · gpt-3.5-turbo
Output generated Cost / run $0.0026 Runtime 8.5s
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 · 4 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 will start by creating the HTML structure for the canvas where the maze will be rendered. Then, I will add the necessary CSS and JavaScript code for the first-person raycasting maze shooter. Let's begin by setting up the HTML file with an embedded canvas element.
index.html (574 bytes)Successfully wrote 574 bytes to index.html
The HTML file with the canvas element has been created. Now, I will add the JavaScript code for the first-person raycasting maze shooter inside the `<script>` tag in the HTML file. ```javascript // JavaScript code for maze shooter const canvas = document.getElementById('mazeCanvas'); const ctx = canvas.getContext('2d'); const mazeWidth = 12; const mazeHeight = 12; const tileSize = 50; const maze = [ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], [1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1], [1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1], [1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1], [1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], ]; function drawMaze() { for (let y = 0; y < mazeHeight; y++) { for (let x = 0; x < mazeWidth; x++) { if (maze[y][x] === 1) { ctx.fillStyle = '#000'; } else { ctx.fillStyle = '#fff'; } ctx.fillRect(x * tileSize, y * tileSize, tileSize, tileSize); } } } drawMaze(); </script> ```