Skip to content

Phaser

A free JavaScript framework for making 2D HTML5 games that run in web browsers and on mobile web.

Stars
40.6k
Forks
7.2k
Licence
MIT
Language
JavaScript
Last update
3 months ago
Type
Library

What it is

Phaser is an open source framework for building 2D games with JavaScript or TypeScript that run in web browsers on desktop and mobile. It provides rendering (WebGL and Canvas), physics options, input handling, cameras, tilemaps, animations and other building blocks so you don't have to write them from scratch. According to the README, it can also be wrapped for some app stores and platforms such as Steam and Discord Activities using third-party tools.

  • Build a 2D platformer or arcade game that runs in a browser
  • Create a tilemap-based world using the tilemap support described in the README
  • Add built-in physics (Arcade or Matter.js) to game objects
  • Start a new project from a template with the create-phaser-game tool

Great for

  • Developers who already know JavaScript or TypeScript and want to make 2D browser games
  • Hobbyists making simple 2D games for the web
  • Teams that want to use Phaser alongside React, Vue, Angular or Svelte
  • Developers making games for platforms like Discord Activities or YouTube Playables, as described in the README

Not ideal for

  • People who want to make 3D games, since the README describes Phaser as a 2D framework
  • Complete beginners with no programming experience, since it requires working with JavaScript or TypeScript
  • Projects that need a full visual game editor, since the README focuses on a code-based workflow
Step-by-step guide: how to use PhaserInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Node.js (version not specified in the README)

    Install via npm

    npm install phaser

    Create a new game project with the interactive tool

    npm create @phaserjs/game@latest
  2. 2

    Run it

    • Run npm create @phaserjs/game@latest and answer the prompts to choose a template
    • Change into the new project folder and install its dependencies as the tool instructs
    • Start the development server using the command the generated project provides
    • Open the local address shown in your terminal in a browser to see the result
  3. 3

    Get the most out of it

    • Use the create-phaser-game tool to start from official templates and demo games
    • Use the TypeScript definitions for better editor autocomplete
    • Use the filter system (Blur, Glow, Bloom and others) to add visual effects to any game object or camera
    • Use SpriteGPULayer or TilemapGPULayer when you need many sprites or large tilemaps on screen
    • Trim unused features in the build settings to reduce file size, as the README suggests

Downloads

Strengths

  • Free and open source under the MIT license, with a large community and a commercial maintainer, Phaser Studio Inc
  • Runs in the browser with both WebGL and Canvas rendering, so one codebase covers desktop and mobile web
  • Ships with a broad feature set in one package, including physics, animation, input, cameras and tilemaps

Trade-offs

  • The full build is large in raw form (phaser.js is over 8 MB, though the minified build is 345 KB compressed), and the README suggests trimming features to reduce size
  • Phaser 4 changed the rendering system from v3, so existing v3 projects may need migration per the linked migration guide
  • Claims such as 'AI-ready' and 'million sprites' come from the README's own marketing and were not independently verified here

How it compares

ProjectStarsTypeLevelUpdatedBest for
phaser (this)40.6kLibraryintermediate3 months agoDevelopers who already know JavaScript or TypeScript and want to make 2D browser games
three.js117kLibraryintermediate4 days agoWeb developers adding interactive 3D graphics to a website
pixijs48.6kLibraryintermediate6 days agoWeb developers building interactive 2D graphics or animations
engine17.2kLibraryintermediate4 days agoWeb developers who want to add 3D scenes or games to a website
G212.7kLibraryintermediate8 days agoFront-end developers adding charts to a web dashboard
imgui76.9kLibraryintermediate6 days agoGame developers who want an in-engine debug or tools panel

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.