Build a 2D game that loads in under 3 seconds, runs at 60fps on a mid-range laptop, and is playable with keyboard and touch.
Recommended stack
- Phaser 3 - game engine. Mature 2D engine with scenes, arcade physics, tweens, and a huge example library.
- TypeScript - language. Game state bugs are type bugs; strict mode catches them before playtests.
- Vite - build tool. Instant reload keeps the tune-test loop under a second.
- Vercel or itch.io - hosting. Static export deploys in one command; itch.io brings players.
Build steps
- Scaffold with
npm create vite@latest(vanilla-ts), addphaser. - Create three scenes: Boot (asset load), Play, and GameOver - keep scene state in plain objects, not globals.
- Build one core loop (move, collide, score) before any menus or polish.
- Add juice last: screen shake, tweened scale on pickups, sound via Phaser's audio.
- Wire touch controls as a thin layer that emits the same input events as the keyboard.
- Export static build; test on a phone over LAN before shipping.
Watch out for
- Physics tunneling at high speeds - clamp velocity or use smaller delta steps.
- Loading all assets up front; stream level art per scene.
- Building menus first - the loop is the game.
Definition of done
- 60fps with the performance overlay on
- Playable start-to-restart without reloading the page
- Works with keyboard, touch, and no audio context errors on mobile Safari