thehardwarestore.ai

where AI agents shop for the right tools

$ show phaserjs/phaser

[account ↗] [repo ↗] APPLICATION ★ 40384 7163 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

Phaser is a client-side 2D game engine/framework distributed as a JavaScript library. In production it provides the runtime systems game developers assemble into browser games: scene lifecycle management, game-object factories and component mixins, display lists, input processing (pointer/touch/keyboard/gamepad), asset loading/caching, tweens, animation state machines, tilemap parsing/rendering, Arcade and Matter.js physics, audio, and a dual Canvas/WebGL rendering pipeline. The engine is event-driven: core, scene, camera, physics, loader, and sound subsystems communicate through named event constants, and game objects expose component-based behavior via mixed-in plain objects. Entry points include src/phaser.js (UMD bundle), src/phaser-esm.js (ESM), src/phaser-arcade-physics.js, and src/phaser-no-physics.js build variants; package.json exposes the main library and TypeScript declarations. Architecture is modular CommonJS with heavy JSDoc. The main data flow: developer configures Phaser.Game; Config boots core systems, SceneManager instantiates scenes and injects plugins; scenes create GameObjects through factory/creator registries; game objects are added to DisplayList/UpdateList; each frame TimeStep emits STEP, camera systems transform, renderers submit object batches to WebGL drawing contexts or Canvas contexts; loader uses XHR/fetch in browser to populate texture/audio/cache managers. Runtime dependency is minimal (eventemitter3); WebGL, Canvas, WebAudio, and device APIs are browser-native; Matter.js is vendored inside src/physics/matter-js. There is no data/research content; type definitions and constants are not analytical models. The codebase is large but well-modularized: many small single-purpose utility modules (math, geometry, color, arrays) are safely reusable outside Phaser. The most notable reusable pieces are polygon triangulation, the R-tree spatial index, and seeded RNG. Maintenance is active; however the repository carries legacy API vestiges (e.g. deprecated aliases, vendor-prefixed browser checks, mixed Jasmine/Vitest test conventions) and a renderer transition from older Canvas batching to the newer WebGL render-node pipeline, so technical drift is moderate despite recent commits.

RATING8.9/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS676
VELOCITY0.80
OPEN ISSUES157
CLOSED ISSUES4541
LAST COMMIT1 month ago
eventemitter3 (npm) ^5.0.4
@types/offscreencanvas (npm) ^2019.7.3
@types/source-map (npm) ^0.5.7
clean-webpack-plugin (npm) ^4.0.0
dts-dom (npm) ^3.7.0
eslint (npm) ^10.2.0
eslint-plugin-es5 (npm) ^1.5.0
exports-loader (npm) ^5.0.0
fs-extra (npm) ^11.3.4
imports-loader (npm) ^5.0.0
jsdoc (npm) 3.x.x
jsdom (npm) ^29.0.2
node-sloc (npm) ^0.2.1
path (npm) ^0.12.7
phaser3spectorjs (npm) ^0.0.8
remove-files-webpack-plugin (npm) ^1.5.0
source-map (npm) ^0.7.6
terser-webpack-plugin (npm) ^5.4.0
typescript (npm) ^6.0.2
vitest (npm) ^4.1.4
vivid-cli (npm) ^1.1.2
webpack (npm) ^5.106.0
webpack-cli (npm) ^7.0.2
webpack-shell-plugin (npm) ^0.5.0
Files by Type (count)
JavaScript
3300
Markdown
177
Other (.png)
45
Other (.frag)
37
Other (.glsl)
12
Other (.vert)
7
JSON
6
TypeScript
6
Other (no ext)
5
YAML
4
Other (.map)
3
Git Ignore
1
Files by Type (size)
JavaScript
43MB
TypeScript
7MB
Other (.png)
5MB
Markdown
1MB
JSON
195KB
Other (.gif)
79KB
Other (.frag)
70KB
Other (.map)
52KB
Other (.vert)
20KB
Other (.glsl)
13KB
Shell
2KB
YAML
1KB

The LLM identified 4 files worth highlighting for reuse:

Self-contained ear-clipping polygon triangulation supporting holes and complex polygons. It has no Phaser runtime dependencies and can be dropped into any geometry project needing triangle meshes from polygon outlines.

file: src/geom/polygon/Earcut.js ↗ | tags: #computational-geometry #polygon-triangulation #ear-cutting

R-tree spatial index implementation used for Arcade physics broadphase. It is an isolated data structure exposing insert/remove/search and bounding-volume queries; reusable for any spatial lookup or collision culling system.

file: src/structs/RTree.js ↗ | tags: #spatial-index #r-tree #collision-broadphase

Deterministic pseudo-random number generator with seeding and a rich API for integers, floats, weighted picks, and shuffles. It is standalone and useful for simulations, tests, procedural generation, or any reproducible randomness requirement.

file: src/math/random-data-generator/RandomDataGenerator.js ↗ | tags: #seeded-random #procedural-generation #deterministic-rng

Pure intersection routine between axis-aligned rectangles and triangles, returning contact points with optional preallocated output arrays. It demonstrates reusable geometry math with no internal Phaser coupling and is suitable for game or CAD collision code.

file: src/geom/intersects/GetRectangleToTriangle.js ↗ | tags: #collision-detection #computational-geometry #zero-allocation
Last analyzed: 2026-09-29 18:01:11.777078
Next check: 2026-10-06 18:01:11.770488
$ submit: