physics-matter

Integrate Matter.js physics for rigid bodies, constraints, sensors, and collisions in Phaser.

40.1k|7.2k|Updated Apr 12, 2013
One-click install
npx skills add https://github.com/phaserjs/phaser --skill physics-matter-phaserjs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: physics-matter
Source: https://github.com/phaserjs/phaser/tree/main/skills/physics-matter
Command: npx skills add https://github.com/phaserjs/phaser --skill physics-matter-phaserjs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Matter.js integration for Phaser 4 enables realistic physics for games, including rigid bodies, joints, sensors, and advanced shapes, without requiring external tooling.

Core Features & Use Cases

  • Rigid body dynamics, constraints, composites, and sensors for interactive gameplay.
  • Flexible world configuration, collision filtering, and debug rendering to tune gameplay and visuals.
  • Use cases include platformers, physics-based puzzles, and tilemap interactions with gravity and collisions.

Quick Start

Enable Matter.js in your Phaser project and begin creating physics bodies with the matter add API.

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 Phaser 4 for rigid bodies and sensors?

Integrate Matter.js physics into Phaser 4 by enabling the physics system in your game config to manage rigid bodies, constraints, and sensors. Use the matter add API to create physics bodies and configure collision filtering within your game scenes.

What is Matter.js used for in Phaser game development?

Matter.js in Phaser game development provides realistic physics simulations, enabling rigid body dynamics, constraints, composites, and sensors. It powers interactive gameplay mechanics like gravity and advanced collisions without requiring external physics tooling.

Can I use Matter.js collision filtering and sensors for platformer games in Phaser?

Yes, you can use Matter.js collision filtering and sensors for platformer games in Phaser. The integration supports flexible world configuration and tilemap interactions, allowing precise tuning of gameplay mechanics and collision events.

How do I set up tilemap interactions and pointer constraints with Matter.js?

Set up tilemap interactions and pointer constraints with Matter.js by using the Phaser matter add API to define body shapes and world gravity. The system supports events and sleep states for efficient physics-based puzzle interactions.

Does Phaser 4 support debug rendering for Matter.js physics bodies?

Yes, Phaser 4 supports debug rendering for Matter.js physics bodies to help tune gameplay and visuals. You can enable debug rendering to visualize rigid bodies, constraints, and advanced collisions during development.