phaserjs/phaser

Games

A 2D HTML5 game framework for building browser and wrapped games with JavaScript or TypeScript.

40,603
7,185
JavaScript
MIT
13 years old

Phaser is an MIT-licensed 2D game framework for HTML5 games that render to desktop and mobile browsers via Canvas or WebGL. It suits developers who want a JavaScript or TypeScript framework with scenes, physics, input, animations and asset loading already assembled, rather than a general-purpose renderer.

What it does and how it works

You write game logic against Phaser's scene-based API: scenes, a loader, Arcade and Matter.js physics, tilemaps, particles, tweens, cameras and input handling. The framework is front-end agnostic — the README states support for over 40 frameworks including React and Vue — and ships first-class TypeScript definitions, so editors pick up types automatically (Phaser README, TypeScript types folder).

Phaser 4 replaces the v3 WebGL pipeline with a node-based renderer, adds a unified Filter system for effects and masks, and introduces SpriteGPULayer and TilemapGPULayer for very large sprite and tile counts in single draw calls. These are author-described features, not independent benchmarks; the practical claim is that animated backgrounds and large maps no longer dominate the frame budget.

Ways to start

The npm route installs the package and imports it; CDN script tags target a pinned release from jsDelivr or cdnjs for projects without a bundler (npm package, README install options). The scaffolding CLI create-phaser-game offers official templates and demo games for Vue, React, Angular, Next.js, SolidJS, Svelte and Remix with Vite, Rollup, Parcel, Webpack, ESBuild or Bun, mostly in JavaScript and TypeScript versions (create game app tutorial). There is also a browser-based Sandbox, though saving entries requires a free account (Sandbox, registration).

Bundle size matters for a browser game: the minified full build is 1.29 MB raw and 345 KB gzipped, with a smaller Arcade-only build, and build settings can exclude unused features. The large unminified file is mostly inline documentation plus TypeScript definitions.

Output targets and requirements

Games run in desktop and mobile web browsers. The README also lists YouTube Playables, Discord Activities, Reddit games and Twitch overlays, and says iOS, Android, Steam and native builds are possible through third-party tools — those wrappers are outside the repository itself, so they are separate toolchains to evaluate. Development uses JavaScript or TypeScript and a build or CDN setup; there is no stated operating-system restriction, and the browser sandbox path needs only a desktop browser.

Migrating from Phaser 3

v4 keeps most of the public API but has breaking changes: the renderer, tint system, FX/Masks, Shader API and lighting, plus removal of classes such as Point, Mesh and BitmapMask. The project publishes a migration guide and a dedicated migration skill for AI coding agents (v4 migration guide, migration skill). Treat v3 tutorials and plugins as needing verification against v4, and check the changelogs for the release you target (changelogs).

The README also bundles AI agent skills covering Phaser subsystems for coding assistants (skills folder); these are optional documentation aids, not a runtime requirement.

HotRepo's take

Stars and a single tracked daily-board observation do not establish momentum or quality. The more decision-relevant facts are the MIT license, the long-running v3-to-v4 transition, and the renderer rewrite that makes migration planning the main practical cost for existing games.

Written by AI from the project's README, updated October 30, 2026. The project's own docs are the source of truth.