physics-matter

Integrate Matter.js physics with rigid bodies, joints, and collision filtering into Phaser 4 scenes.

Updated Apr 20, 2026
One-click install
npx skills add https://github.com/Raphe-dev/phaser-cozy-mmo --skill physics-matter
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: physics-matter
Source: https://github.com/Raphe-dev/phaser-cozy-mmo/tree/main/skills/physics-matter
Command: npx skills add https://github.com/Raphe-dev/phaser-cozy-mmo --skill physics-matter

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a comprehensive guide to integrating Matter.js physics into Phaser 4 games, enabling robust physics-based gameplay without piecemeal setup.

Core Features & Use Cases

  • Full-body physics: manage rigid bodies, constraints, and composites to build complex characters and structures.
  • Sensors and collision filtering: implement triggers, sensors, and bitmask-based collision logic for gameplay interactions.
  • World configuration and debugging: configure gravity, bounds, sleeping, and visualize debug rendering for development and testing.
  • Practical examples: from tilemap integration to mouse dragging, stacks, chains, and soft bodies.

Quick Start

Run a basic Matter-enabled scene in Phaser 4 by enabling matter physics and creating a dynamic body that reacts to gravity.

Frequently Asked Questions about physics-matter

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

FAQPage Schema
How do I integrate Matter.js physics into a Phaser 4 scene?

To integrate Matter.js physics into a Phaser 4 scene, enable the matter physics system and configure world properties like gravity and bounds to create dynamic rigid bodies that react in real time.

Can I use collision filtering and sensors for gameplay triggers in Phaser 4?

Yes, you can implement sensors and bitmask-based collision filtering in Phaser 4 to create precise gameplay triggers and control which rigid bodies interact during real-time physics simulation.

What's the best way to set up rigid bodies, joints, and composites in Matter.js?

The best way to set up rigid bodies, joints, and composites in Matter.js is using a reusable toolkit for shape construction and world management, allowing you to build complex characters and physical structures.

How do I enable debug rendering and pointer dragging for Matter physics objects?

You can enable debug rendering to visualize rigid bodies and bounds for testing, and implement pointer dragging to allow mouse interaction with dynamic physics objects directly within your Phaser 4 game.

Does Matter.js support tilemap integration for collision detection in Phaser 4?

Yes, Matter.js supports tilemap integration in Phaser 4, converting tile layers into static rigid bodies so your dynamic game objects can collide accurately with the level geometry.