Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Library:Phaser

From ReverseEngineering.wiki
Library
On this wiki Facts · Code · Notes · Topics

Phaser (MIT) is a JavaScript/HTML5 game framework built as a UMD bundle exposing the global Phaser; Phaser.VERSION holds its version.

Phaser is an MIT HTML5 game framework (phaserjs/phaser).

Identification

  • The webpack build (config/webpack.config.js) outputs phaser.js as a UMD library named Phaser, so a game page has a global Phaser; entry point src/phaser.js assembles namespaces such as Game, Scene-related Core, GameObjects, Cameras, Loader.
  • The version string is Phaser.VERSION (src/const.js; 4.2.1 at the pinned commit; package.json agrees).
  • At start the game writes a banner line to console.log unless the game config sets banner: false (src/core/Config.js hideBanner, bannerTextColor, bannerBackgroundColor). Banner text (src/core/DebugHeader.js, src/const.js): the styled console.log string is [game title [ vVERSION] / ]Phaser v<VERSION> (<renderer> | <audio>) followed by a space and the game URL, with renderer WebGL, Canvas or Headless and audio Web Audio, HTML5 Audio or No Audio; so at the pinned commit it reads Phaser v4.2.1 (WebGL | Web Audio) and then gameURL, which defaults to 'https://phaser.io/' + LOG_VERSION (v4021 here), not plain https://phaser.io. A fallback without styled console output logs 'Phaser v4.2.1 / https://phaser.io'. The game title part appears only if the config sets title, and hidePhaser removes the Phaser part.
  • A game config object with type, width, height, scene, physics fields is the usual entry: search for new Phaser.Game(.

Reversing notes

Games are minified JavaScript plus loaded assets (atlases as JSON plus PNG). src/phaser.js builds a plain object literal var Phaser = { Game: require('./core/Game'), Scene: require('./scene/Scene'), Scenes: ..., ... } and ends with global.Phaser = Phaser, so in the shipped bundle the global Phaser and its namespace property names (Game, Scene, Scenes, ...) are object keys that a minifier does not rename; the local class variable names inside modules can be mangled. Scene keys and asset keys are strings in game code and are findable by string search. Unverified: how a game's own minifier treats subclasses of Phaser.Scene (depends on its build).

See Technique:Identifying HTML5 game engines, Technique:Reversing bundled JavaScript.

Code & repositories

  • https://github.com/phaserjs/phaser @ 02d8931b626d9764c133cbb3fbf99966c03c757c · license: MIT
    Phaser (MIT): src/const.js VERSION, src/phaser.js namespace, config/webpack.config.js UMD build, src/core/Config.js banner options.
    Tested on: source read, not run: source read, not run · checked 2026-10-18; last activity 2026-08-21