Space Invaders in this machine
The whole game is one file, index.html: a <canvas> of 480 by 540 pixels, one <script>, no
dependencies, no build step and no server code. It is in /session/work/create-arcade-game.
Run it
When this agent was opened on the example, Mariwave copied its own files to /session/work/create-arcade-game and wrote /session/work/web-server.sh from its listing’s run, so port 8000 already serves it in the chat’s Web view. When port 8000 does not
answer, /session/bridge.log says why, and the Web view’s switch starts the server again.
How it plays: Start begins a game, the left and right arrow keys move, Space shoots. Clearing a
wave raises level, which makes the invaders faster and adds rows (up to six). Three lives.
Change it
Edit /session/work/create-arcade-game/index.html and have the person reload the Web view. The script is one
loop the README names: state (running, score, lives, level), newPlayer, newBullets and
newInvaders build each part, and the input, step and draw functions run every frame.
image-rendering: pixelated keeps the canvas sharp when it is scaled. Any picture or sound you add
goes in the same folder, served from the same address.
