# Add an Arcade-ready build to this project

Goal: Turn this game into one folder I can upload to the Arena54 Arcade, where people play it on arena54.com and swipe to vote.

You are a coding agent working inside my project. Do the work. Do not ask me anything you can find out by reading the project. Do not invent an endpoint, a field or an error code that is not written below.

## 1. Look at the project first

- Find the framework and language, how the project is run and tested, and how the game is built for the web, which folder that build lands in, how it starts its sound, and whether it shows any alert, confirm or prompt box.
- I am not a programmer. Do every step yourself, and explain what you found and what you changed in plain words, with no jargon.
- Find what the game is made with: plain HTML and JavaScript, a library or bundler (Phaser, Three.js, PixiJS, Vite, webpack…), Godot, Unity, Construct, GDevelop, or something else.
- If the game cannot run in a web browser at all, say so plainly and stop.
- If the project already has an Arena54 client or key variable, reuse it.
- Tell me in two or three lines what you found and what you will change, then carry on.

## 2. The contract

The Arcade serves the build exactly as uploaded, as plain files, from an address like `https://play.arena54.fun/b/<build id>/index.html`, and shows it full screen inside a frame on arena54.com. Nothing runs on a server.

The folder:

- One folder with `index.html` directly inside it, not in a subfolder.
- Every path relative: `./assets/game.js` or `assets/game.js`. Never `/assets/game.js` (that points outside the build) and never an address on this computer.
- File and folder names use only letters, numbers, dots, dashes and underscores. No spaces, no accents. Other names are skipped at upload.
- Only these file types are kept; anything else is skipped at upload: .html .js .mjs .css .json .wasm .map .txt .png .jpg .jpeg .webp .gif .avif .svg .ico .woff .woff2 .ttf .otf .mp3 .ogg .wav .m4a .mp4 .webm .glb .gltf .bin .pck .data .unityweb
- At most 500 files. The size limits are shown under the upload button in the Arena54 dashboard; keep images and sound compressed.
- No pre-compressed copies that need the server to unpack them (.gz, .br): they are sent as they are.
- No PHP, no server code, no database: everything happens in the browser.

The frame it plays in:

- It allows scripts, the game's own storage (localStorage, IndexedDB), pointer lock, full screen, gamepads, and opening a link in a new tab.
- `alert()`, `confirm()` and `prompt()` silently do nothing there. Use the game's own on-screen messages and buttons.
- It cannot take over the browser tab or submit a form.
- Sound may only start after the player taps, clicks or presses a key. A tap counts when the finger lifts (pointerup, touchend or click), not when it lands.
- On iPhones the ring/silent switch mutes web sound unless the game asks for playback: where `navigator.audioSession` exists, set its `type` to "playback" during that first tap.
- Most players are on phones. The game should fill the frame (all of its width and height), work in portrait, and work with touch alone.

Engines:

- Godot: the Web export, with thread support switched off (the Arcade does not send the extra headers threads need). Keep the exported .pck, .wasm and .js files next to `index.html`; rename the exported page to `index.html` if it has another name.
- Unity: a WebGL build, with Compression Format set to Disabled, or Decompression Fallback switched on. Unity's `index.html` goes at the top, next to its Build and TemplateData folders.
- A bundler such as Vite: build with relative paths (for Vite, `base: './'`).

## 3. Do this, in order

1. Make the game's web build the way the project already makes it. If it has no build step (plain HTML), the game's own files are the build.
2. Put the finished build in a new folder named `arcade-build` at the top of the project (copy it there if the build makes another folder, such as `dist`). Do not change how the project normally builds or runs.
3. In `arcade-build`, make every path relative and rename any file whose name the Arcade would skip, updating whatever refers to it. Remove files the game does not use. If the game needs a file of a type the Arcade does not keep, tell me which and why.
4. In the game's own files, replace any alert(), confirm() or prompt() with an on-screen message, or a button that has to be pressed twice. Then make the build again.
5. Make sure sound starts on the first tap, click or key press, with the iPhone playback setting above. Make sure the game fills a phone screen and works with touch in portrait.
6. Only if I ask for it: sign-in, saved progress and leaderboards on Arena54 need the game registered in the Arena54 dashboard and a publishable key. Use the separate Arena54 prompts for those at https://developers.arena54.com/docs/hosted-games, and remind me to add `https://play.arena54.fun` under “Where the game runs”.

## 4. Prove it works

Check the folder itself, the way the Arcade will see it.

- List the top of `arcade-build`: `index.html` is there.
- Count the files and add up their size. Show both, and the largest file.
- Search every .html, .js and .css file in `arcade-build` for paths that start with `/` or point at this computer. Show anything you find.
- List any file whose type or name the Arcade would skip. There should be none.
- Serve it from a sub-path, as the Arcade does: copy `arcade-build` to `arcade-test/b/check/`, run a static web server in `arcade-test` (for example `npx serve arcade-test` or `python3 -m http.server`), open `/b/check/index.html` in a browser, and check the game starts with no errors in the console. Then delete `arcade-test`.

Show me the output of each check.

## 5. Rules you must not break

- Never delete or rewrite the game. Change its own files only for the dialog, sound and screen fixes above, and tell me each change.
- Never put a secret key (one starting `a54_test_` or `a54_live_`) anywhere in the game. Only a publishable key, starting `a54_pub_`, may be in a page.
- Do not upload anything, sign in anywhere or ask me for a password. I upload the folder myself.
- Keep what you tell me short and plain. I am not a programmer.

## 6. Done when

- `arcade-build/index.html` exists, and the game runs from a sub-path with no errors in the console.
- Every file in `arcade-build` has a kept type and a plain name, and the totals are within the limits.
- No alert, confirm or prompt is left, sound starts on the first tap, and the game fills a phone screen.
- Your last line tells me exactly what to do next: “Upload the arcade-build folder.”

Then give me a short list of the files you changed and anything I must do by hand.

For a person, not needed for this task: https://developers.arena54.com/docs · This prompt: https://developers.arena54.com/prompts/arcade-ready.web.md
