Repolode
phaserjs

phaserjs/phaser

Phaser is a free, open source HTML5 game framework for building 2D games with WebGL or Canvas rendering in browsers.

Stars
40,540
Forks
7,179
Open issues
176
Last commit
2 months ago

What is it?

Phaser is a JavaScript and TypeScript framework for 2D games that run in desktop and mobile web browsers. It supports both WebGL and Canvas rendering and includes scene management, a asset loader, built-in Arcade and Matter.js physics, animations, input handling, cameras, tilemaps, particles and tweens.

Games built with Phaser can be deployed to the web, YouTube Playables, Discord Activities, Reddit, and Twitch overlays, or wrapped with third-party tools for iOS, Android, Steam and native apps. Phaser can be installed from npm or loaded from a CDN, and a create-phaser-game CLI scaffolds projects with templates for React, Vue, Angular, Svelte, Next.js and other frameworks.

Version 4 replaces the rendering pipeline with a node-based WebGL renderer and unifies effects and masks into a filter system. It adds GPU-driven sprite and tilemap layers for rendering very large numbers of objects. Phaser 3 projects need migration, which is covered by a guide in the repository.

Key features

  • 01Renders with WebGL or Canvas in desktop and mobile browsers.
  • 02Includes Arcade and Matter.js physics, animations, tweens and particles.
  • 03Provides scenes, asset loading, input handling, cameras and tilemaps.
  • 04Supports JavaScript and TypeScript with bundled type definitions.
  • 05Offers a CLI that scaffolds projects for popular front-end frameworks and bundlers.
  • 06Includes a filter system with effects such as blur, glow and bloom.

Use cases

  • Building 2D browser games for desktop and mobile web.
  • Publishing mini-games to YouTube Playables or Discord Activities.
  • Creating interactive game-like content inside a React or Vue app.
  • Prototyping 2D game mechanics with built-in physics and animation tools.

Quick start

  1. 1

    Install Phaser from npm

    npm install phaser
  2. 2

    Import Phaser in your project

    import Phaser from 'phaser';
  3. 3

    Or scaffold a new game with the create-phaser-game app

    npm create @phaserjs/game@latest

Things to know

  • Phaser 4 has breaking changes from Phaser 3, so older tutorials and plugins may need migration work.

In collections

Topics

FAQ

What is phaser?
Phaser is a free, open source HTML5 game framework for building 2D games with WebGL or Canvas rendering in browsers. Phaser is a JavaScript and TypeScript framework for 2D games that run in desktop and mobile web browsers. It supports both WebGL and Canvas rendering and includes scene management, a asset loader, built-in Arcade and Matter.js physics, animations, input handling, cameras, tilemaps, particles and tweens.
Is phaser free to use? What license does it have?
phaser is open source under the MIT license. Check the license terms before using it in commercial products.
Is phaser still maintained?
Updated within 6 months. The last commit to phaser was on Aug 21, 2026.
What can I use phaser for?
Building 2D browser games for desktop and mobile web. Publishing mini-games to YouTube Playables or Discord Activities. Creating interactive game-like content inside a React or Vue app. Prototyping 2D game mechanics with built-in physics and animation tools.
How do I install phaser?
Install Phaser from npm: npm install phaser Import Phaser in your project: import Phaser from 'phaser'; Or scaffold a new game with the create-phaser-game app: npm create @phaserjs/game@latest
Where can I get phaser?
The source code and installation instructions are on GitHub: https://github.com/phaserjs/phaser

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects