Détail du package

phaser

phaserjs195.6kMIT3.88.2

A fast, free and fun HTML5 Game Framework for Desktop and Mobile web browsers from the team at Phaser Studio Inc.

2d, HTML5, WebGL, canvas

readme

Phaser - HTML5 Game Framework

Phaser Banner

Discord JSDelivr GitHub

Phaser is a fast, free, and fun open source HTML5 game framework that offers WebGL and Canvas rendering across desktop and mobile web browsers and has been actively developed for over 10 years.

Games can be built for the web, or as YouTube Playables, Discord Activities, Twitch Overlays or compiled to iOS, Android, Steam and native apps using 3rd party tools. You can use JavaScript or TypeScript for development. Phaser supports over 40 different front-end frameworks including React and Vue.

Phaser is commercially developed and maintained by Phaser Studio Inc along with our fantastic open source community. As a result of rapid support, and a developer friendly API, Phaser is currently one of the most starred game frameworks on GitHub.

Interested in learning more? Click the image below to watch our intro video.

YouTube

Create Phaser Game App

The easiest way to get started quickly with Phaser is our create-phaser-game app. This CLI tool presents an interactive selection of official project templates and demo games. Issue the command, answer some questions and the app will download and configure the right package for you.

npm create @phaserjs/game@latest
npx @phaserjs/create-game@latest
yarn create @phaserjs/game
pnpm create @phaserjs/game@latest
bun create @phaserjs/game@latest

We support all of the following frameworks and bundlers:

Frameworks Bundlers
Vue.js Vite
React Rollup
Angular Parcel
Next.js Webpack
SolidJS ESBuild
Svelte Import Map
Remix Bun

Most come in both JavaScript and TypeScript versions.

View the create game app tutorial.

Installing Phaser from NPM

Install via npm:

npm install phaser

Using Phaser from a CDN

Phaser is on jsDelivr which is a "super-fast CDN for developers". Include either of the following in your html:

<script src="//cdn.jsdelivr.net/npm/phaser@3.88.2/dist/phaser.js"></script>
<script src="//cdn.jsdelivr.net/npm/phaser@3.88.2/dist/phaser.min.js"></script>

It is also available from Cloudflare's cdnjs:

<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/3.88.2/phaser.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/3.88.2/phaser.min.js"></script>

Phaser TypeScript Definitions

Full TypeScript definitions can be found inside the types folder. They are also referenced in the types entry in package.json, meaning modern editors such as VSCode will detect them automatically.

Depending on your project, you may need to add the following to your tsconfig.json file:

"lib": ["es6", "dom", "dom.iterable", "scripthost"],
"typeRoots": ["./node_modules/phaser/types"],
"types": ["Phaser"]

API Documentation

Read our full API Documentation at https://docs.phaser.io/. Use the links at the top of the page to navigate the namespaces, classes, events and Game Objects and also to use the search box.

We maintain documentation for the most recent versions of Phaser on this site.

Getting Started with Phaser

We recommend the following to begin your journey:

New tutorials are being published every week, so check our site for more.

Phaser by Example Book

We have published a brand-new free 500 page book on game development with Phaser. Learn by building shoot-em-ups, puzzle games, rogue-likes and more.

Phaser by Example

Written by long-time prolific Phaser enthusiast Pello Xabier Altadill and Richard Davey, creator of Phaser, it features up-to-date content on building games with Phaser v3.85.

Work through the process of creating a variety of games, allowing you to learn from real-life examples. The games start simple, with an infinite runner game, and then progresses to building a shoot-em-up, a platformer, a puzzle game, a rogue-like, a story game and even 3D and multiplayer games.

It also contains a large section on the core concepts of Phaser, covering the terminology and conventions used by the framework, as well as a comprehensive deep dive into Game Objects.

Register for a free Phaser account to download the book.

Source Code Examples

We have created hundreds of examples and they are all available with full source code and assets.

Browse our brand new Phaser Examples site.

Phaser 3 Plugins

Super community member RexRainbow has been publishing Phaser content for years, compiling an impressive catalogue of plugins that all Phaser developers should be aware of.

You'll find Phaser Plugins that extend the framework with features such as UI controls, text input boxes, Firebase support, Finite State Machines and lots more. His set of Phaser Notes are also invaluable reading.

Phaser Sandbox

The Phaser Sandbox is a fully-configured online editor, ready to go direct in your desktop browser. It's loaded with all the core versions of Phaser and packed full of handy features. Register for a free Phaser account to create and save your own sandbox entries. Or view one just like this.

Phaser Compressor

Use our powerful new web-based tool to crunch your Phaser bundles down by up to 60%, enabling only the features your game requires.

Read more about Phaser Compressor

Change Log

We meticulously keep track of new features, updates and bug fixes in our change logs. Each version of Phaser has its own change log:

Have fun!

Grab the source and join the fun!

Phaser wouldn't have been possible without the fantastic support of the community. Thank you to everyone who supports our work, who shares our belief in the future of HTML5 gaming, and Phaser's role in that.

Happy coding everyone!

Cheers,

Rich and the whole team at Phaser Studio

boogie

Visit the Phaser website
Play some amazing games
Learn By browsing our API Docs, Support Forum and StackOverflow
Code Examples? We've over 2000 Examples to learn from
Read the weekly Phaser World Newsletter
Be Social: Join us on Discord and Reddit or follow us on BlueSky

Powered by coffee, anime, pixels and love.

The Phaser logo and characters are © 2011 - 2025 Phaser Studio Inc.

All rights reserved.

"Above all, video games are meant to be just one thing: fun. Fun for everyone." - Satoru Iwata

changelog

Phaser 3 Change Logs

You can find the exhaustive Change Logs for all versions of Phaser 3 here.

Please select a version to read that specific change log:

Version Name Release Date
3.89 Tsugumi in dev
3.88.2 Minami 13th February 2025
3.88.1 Minami 12th February 2025
3.88 Minami 11th February 2025
3.87 Hanabi 14th November 2024
3.86 Aoi 11th October 2024
3.85.2 Itsuki 17th September 2024
3.85.0 Itsuki 5th September 2024
3.80.1 Nino 27th February 2024
3.80 Nino 21st February 2024
3.70 Yotsuba 10th November 2023
3.60 Miku 12th April 2023
3.55.2 Ichika 27th May 2021
3.55.1 Ichika 26th May 2021
3.55 Ichika 24th May 2021
3.54 Futaro 26th March 2021
3.53.1 Anastasia 8th March 2021
3.53 Anastasia 8th March 2021
3.52 Crusch 14th January 2021
3.51 Emilia 5th January 2021
3.50.1 Subaru 21st December 2020
3.50 Subaru 16th December 2020
3.24.1 Rem 14th July 2020
3.24 Rem 13th July 2020
3.23 Ginro 27th April 2020
3.22 Kohaku January 15th 2020
3.21 Senku 22nd November 2019
3.20.1 Fitoria 15th October 2019
3.20 Fitoria 11th October 2019
3.19 Naofumi 8th August 2019
3.18.1 Raphtalia 20th June 2019
3.18 Raphtalia 19th June 2019
3.17 Motoko 10th May 2019
3.16.2 Ishikawa 11th February 2019
3.16 Ishikawa 5th February 2019
3.15.1 Batou 16th October 2018
3.15 Batou 16th October 2018
3.14 Tachikoma 1st October 2018
3.13 Yuuki 20th September 2018
3.12 Silica 4th September 2018
3.11 Leafa 13th July 2018
3.10.1 Hayashi 13th June 2018
3.10 Hayashi 13th June 2018
3.9 Yui 24th May 2018
3.8 Klein 16th May 2018
3.7.1 Sinon 8th May 2018
3.7 Sinon 4th May 2018
3.6 Asuna 19th April 2018
3.5.1 Kirito 17th April 2018
3.5 Kirito 16th April 2018
3.4 Miyako 12th April 2018
3.3 Tetsuo 22nd March 2018
3.2.1 Kaori 12th March 2018
3.2 Kaori 5th March 2018
3.1.2 Onishi 23rd February 2018
3.1.1 Onishi 20th February 2018
3.1 Onishi 16th February 2018

We've organized the Change Logs into commonly themed sections to make them more digestible, but we appreciate there is a lot of information.

Please don't feel overwhelmed! If you need clarification about something, join us on the Phaser Discord and feel free to ask.