phaser-matter

Integrate Matter.js physics into Phaser 4 projects for complex collision shapes and constraints.

17|1|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/Yakoub-ai/phaser4-gamedev --skill phaser-matter
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: phaser-matter
Source: https://github.com/Yakoub-ai/phaser4-gamedev/tree/main/skills/phaser-matter
Command: npx skills add https://github.com/Yakoub-ai/phaser4-gamedev --skill phaser-matter

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill addresses the limitations of Arcade Physics by providing a comprehensive guide and implementation framework for Matter.js, enabling realistic physics simulations in Phaser 4.

Core Features & Use Cases

  • Advanced Collision Handling: Supports complex concave/convex shapes, compound bodies, and sensor zones.
  • Physics Constraints: Implements realistic joints, hinges, springs, and distance rods for interactive game elements.
  • Use Case: Use this skill to build a ragdoll character, a destructible environment, or a platformer that requires precise polygon-based collision detection.

Quick Start

Use the phaser-matter skill to configure a compound body player character with a sensor for ground detection.

Frequently Asked Questions about phaser-matter

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

FAQPage Schema
How do I use Matter.js physics in Phaser 4 for complex collision shapes?

Matter.js physics in Phaser 4 is integrated by configuring the Matter physics world to handle complex concave and convex collision shapes. This setup enables the creation of compound physics bodies and non-rectangular shapes for precise collision detection.

How do I create ragdoll physics simulations in Phaser 4?

Ragdoll physics simulations in Phaser 4 are created by defining realistic Matter.js constraints like joints, hinges, and springs. This links multiple compound bodies together to simulate destructible environments and interactive ragdoll characters.

Does Phaser 4 Arcade Physics support complex polygon collision detection?

Phaser 4 Arcade Physics does not natively support complex polygon collision detection. You must integrate the Matter.js physics engine to handle concave shapes, compound bodies, and sensor-based trigger zones for advanced collision scenarios.

What is the best way to set up sensor-based trigger zones in Phaser 4?

The best way to set up sensor-based trigger zones in Phaser 4 is by configuring Matter.js sensor bodies alongside proper collision bitmasks. This detects overlapping bodies for ground detection without triggering physical collision responses.

Why does my Matter.js simulation drop performance with multiple constraints in Phaser?

Matter.js simulation performance drops in Phaser when collision bitmasks and constraint definitions are improperly configured. Properly tuning the physics world and simplifying complex compound bodies ensures stable simulation performance.