Phaser 3 starter (hand-written or with an agent)

Folder layout, build settings and a checklist for shipping a Phaser game here.

by gamehub · Phaser

0
Publish your game
⚑ Report

Log in to report this.

## Set up
1. npm create @phaserjs/game@latest my-game  (pick the Vite template)
2. In vite.config.js set base: "./" so every asset path is relative.
3. Put art and sound in public/assets and load them as "assets/…".

## Make it work on phones
- this.scale.mode = Phaser.Scale.FIT and autoCenter = CENTER_BOTH.
- Use pointer events, not only keyboard. Add on-screen buttons if you need more than tap/drag.

## Ship it
1. npm run build
2. Zip the CONTENTS of dist/ (index.html must be at the top of the zip).
3. Game Hub → Publish → upload the zip. Credit any community sprites or sounds you used.

## Agent prompt
"Build a Phaser 3 game with Vite. Set base './' in vite.config. All assets in public/assets, loaded with
relative paths. Scale mode FIT. Support touch and keyboard. Then run the build and zip dist/ so that
index.html is at the zip root."

## What Game Hub accepts
- A .zip with index.html at the top (or inside one folder), or one self-contained .html file.
- Web files only: HTML, JS, CSS, WASM, images, audio, fonts, engine data. No executables or server code.
- Free plan: 25 MB per game. Creator plan: 200 MB.
- The game runs in a sandboxed iframe on its own domain. It can load its own files with relative paths
  (e.g. "assets/player.png", never "/assets/player.png"). It cannot call other websites, open pop-ups,
  use cookies or read anything from Game Hub.
- Mark the game "Works on phones" only if it plays with touch alone.