explaingit

phaserjs/phaser

39,645JavaScriptAudience · developerComplexity · 3/5ActiveLicenseSetup · easy

TLDR

Open-source HTML5 game framework for building 2D games that run in web browsers on desktop and mobile, handling graphics, physics, animations, and audio so you focus on game design.

Mindmap

mindmap
  root((Phaser))
    What it does
      2D browser games
      Scene-based architecture
      GPU-accelerated rendering
    Key features
      Physics engine
      Animation system
      Sprite rendering
      Input handling
    Tech stack
      JavaScript
      TypeScript support
      WebGL renderer
    Use cases
      Casual games
      Platformers
      Puzzle games
      RPGs
    Deployment
      Web browsers
      iOS and Android
      Steam and Discord

Things people build with this

USE CASE 1

Build casual puzzle games or action platformers that run directly in a web browser without installation.

USE CASE 2

Create a top-down RPG with tilemaps, physics-based collisions, and sprite animations using a pre-built engine.

USE CASE 3

Wrap your finished game for iOS, Android, Steam, or Discord Activities using third-party distribution tools.

USE CASE 4

Integrate a game into a React or Vue web app as an interactive component alongside other UI elements.

Tech stack

JavaScriptTypeScriptWebGLHTML5

Getting it running

Difficulty · easy Time to first run · 5min
Use freely for any purpose, including commercial use, as long as you keep the copyright notice and license text.

In plain English

Phaser is an open-source HTML5 game framework that lets developers build 2D games that run directly in web browsers on both desktop and mobile. The problem it solves is that creating interactive games from scratch requires handling graphics rendering, physics, animations, input events, audio, asset loading, and dozens of other systems simultaneously. Phaser packages all of these into a coherent, well-documented API so you can focus on designing your game instead of building an engine. Phaser works by providing a scene-based architecture where your game is divided into independent scenes, a loading screen, a main menu, a game level, each with their own setup and update logic. Within a scene you create game objects like sprites (moving images), tilemaps (grid-based worlds), particles, cameras, and physics bodies. Phaser version 4 uses a completely rebuilt WebGL renderer with a node-based rendering pipeline, which means modern GPU hardware is used efficiently to push tens of thousands of sprites at high frame rates. For games that need even more, a special SpriteGPULayer object can render over a million sprites in a single GPU draw call. Built-in physics engines handle collisions and movement, and a built-in animation system manages sprite frame sequences. You would use Phaser when building any 2D browser game, from simple casual games and puzzle games to action platformers and top-down RPGs. Finished games can also be wrapped using third-party tools for distribution on iOS, Android, Steam, YouTube Playables, and Discord Activities, so the same codebase reaches native platforms too. Phaser is written in JavaScript and fully supports TypeScript. It integrates with frontend frameworks including React, Vue, Svelte, and Angular, and can be added to a project via npm or a CDN script tag. The minified build is around 345 kilobytes compressed, making it practical for web delivery.

Copy-paste prompts

Prompt 1
Show me how to set up a Phaser scene with a sprite, add physics to it, and handle keyboard input to move it around.
Prompt 2
How do I create a tilemap-based level in Phaser and detect collisions between the player and walls?
Prompt 3
Write a simple Phaser game with a loading scene, main menu scene, and a playable game scene that transitions between them.
Prompt 4
How do I use Phaser's animation system to play a sprite's walk cycle when the player presses a direction key?
Prompt 5
What's the best way to integrate Phaser into a React app so the game runs in a canvas element?
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.