Developer tools

Create arcade game

A complete arcade game in one web page, with no build step and no server: a starting point for any game you want to make and play in the Web view.

Recipe code: create-arcade-game

No Mariwave yet? Download it, and keep the recipe code to open this recipe once it is installed.

an arcade joystick

What it is

An app you run and watch, opened in its own machine.

What it needs

A Mac with Apple silicon and macOS 27 or later, with Mariwave installed. It runs in its own signed machine on your Mac.

Source

Eyzaguirre-co-LLC/mari-examples/create-arcade-game at 2a7999b922601fc4b7fd635bee11ce286e964b2b

Picture

sha256 be177d0c29f37667206551a0fde36b69c66c29de9da55c22bc42ed5f1b83b3e2

What the agent reads

When you open this recipe, the agent in its machine reads these instructions first.

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.