Phaser Browser Game Guide
Prepare a Phaser indie browser game for RetiPie with bundled assets, touch controls, responsive canvas sizing, and SDK integration.
Phaser games are a natural fit for RetiPie when the build is self-contained and mobile-ready.
Build shape
Export a browser build that serves from static files:
index.html- bundled JavaScript
- CSS if needed
- local images, audio, JSON, tilemaps, and font assets
Put the final build files in a ZIP with index.html at the root.
Mobile setup
- Prefer touch or pointer controls over keyboard-only input.
- Scale the canvas to the viewport.
- Keep UI text readable on narrow screens.
- Test restart and pause flows on a phone-sized viewport.
RetiPie SDK
Use window.retipie from Phaser scenes for platform events:
retipie.analytics.gameplayStart();
retipie.game.configure({
leaderboards: {
default: { order: 'desc', unit: 'points', precision: 0 },
},
});Call gameplayStart() when a run actually begins and gameplayStop() when it ends, so menus and game-over screens aren't counted as play time. RetiPie freezes Phaser's loop, timers, and Web Audio when the player leaves your game, so you don't need to handle that yourself. See Game Lifecycle.
Unity WebGL Export
Prepare a Unity WebGL build for RetiPie with working Player Settings, package it as a ZIP, and call the Unity SDK from C# for lifecycle and leaderboards.
SDK Overview
Call window.retipie from your game to handle pause and resume, declare leaderboards, submit scores, and report analytics. Nothing to install.