dev-phaser-physics-matter

Implements Matter.js physics bodies, constraints, and collision events in Phaser 3 games.

1|Updated Mar 19, 2026
One-click install
npx skills add https://github.com/fiando/bake-tycoon --skill dev-phaser-physics-matter-fiando
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dev-phaser-physics-matter
Source: https://github.com/fiando/bake-tycoon/tree/main/.github/skills/dev-phaser-physics-matter
Command: npx skills add https://github.com/fiando/bake-tycoon --skill dev-phaser-physics-matter-fiando

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building realistic physics in Phaser games by hand means writing O(n²) collision loops, manual gravity integration, and custom joint logic. This Skill provides structured guidance for using Phaser's Matter.js integration to create realistic bodies, constraints, and collision handling without reinventing a physics engine. ## Core Features & Use Cases - Body Creation: Configure rectangles, circles, polygons, and compound bodies with bounce, friction, density, and static/sensor states. - Constraints & Joints: Build chains, ropes, springs, and hinges using Matter constraints, including multi-plank bridge construction. - Collision Events: Label bodies and listen to collisionstart events to trigger game logic like coin collection. - Use Case: You are building a physics puzzle game where the player topples stacked crates onto targets. Use this Skill to create a stable box pyramid with tuned friction and density, then detect collisions via labeled bodies to score hits. ## Quick Start Ask the AI to set up a Phaser 3 scene with Matter physics containing a bouncing ball, a static ground, and a rope made of constrained links.

Frequently Asked Questions about dev-phaser-physics-matter

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enable Matter physics in a Phaser 3 game?▼

Set physics.default to 'matter' in the game config and provide a matter options object with gravity and debug settings. Then create bodies with this.matter.add.image and shape them using setRectangle, setCircle, or setPolygon.

How do I create ropes and chains in Phaser with Matter.js?▼

Create a series of small bodies and connect adjacent ones with this.matter.add.constraint, passing the two bodies, a link length, and a stiffness value around 0.9. Make the first link static to anchor the rope to a fixed point.

Phaser Matter vs Arcade physics: which should I use?▼

Use Arcade for simple platformers and top-down games where AABB collision and high performance suffice. Use Matter for physics puzzles, realistic stacking, complex polygon shapes, and constraint-based mechanics like ropes and hinges.

How do I detect collisions between specific Matter bodies in Phaser?▼

Assign a label to each body via body.label, then listen to the matter world's collisionstart event. Iterate over event.pairs and compare bodyA and bodyB labels to trigger game logic such as collecting a coin.

Why is my Matter physics simulation unstable or slow?▼

Instability often comes from setting high density on all objects or untuned constraint stiffness. Enable sleep for inactive bodies, keep densities moderate, and iterate on constraint stiffness and damping values to stabilize the simulation.