physics-matter

Configure Matter.js physics bodies, constraints, and collisions in Phaser 4 scenes.

1|Updated May 3, 2026
One-click install
npx skills add https://github.com/WanderTheWeeb/papas_trauma --skill physics-matter-wandertheweeb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: physics-matter
Source: https://github.com/WanderTheWeeb/papas_trauma/tree/main/skills/physics-matter
Command: npx skills add https://github.com/WanderTheWeeb/papas_trauma --skill physics-matter-wandertheweeb

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps you set up and control Matter.js rigid-body physics inside a Phaser 4 scene so your game can handle believable collisions, constraints, sensors, and debug visualization.

Core Features & Use Cases

  • Scene + World setup: Configure gravity, bounds, stepping behavior, sleeping, and debug rendering through the Phaser Matter plugin.
  • Physics objects and bodies: Create Matter sprites/images or inject Matter physics into existing game objects with shapes and body options.
  • Advanced interactions: Use constraints (joints/springs), composites (stacks/chains/soft bodies/compound bodies), collision filtering & callbacks, pointer constraints (mouse dragging), and tilemap conversion with MatterTileBody.

Quick Start

Describe how you want your Matter world configured (gravity, bounds, debug), which objects should be dynamic vs static, and what interactions you need (constraints, sensors, collision categories), then implement it starting from GameScene.create and wiring the physics config to run with this.matter.

Frequently Asked Questions about physics-matter

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

FAQPage Schema
How do I set up Matter.js physics bodies and world gravity in a Phaser 4 scene?

To set up Matter.js physics in Phaser 4, use the Phaser Matter plugin to configure world gravity, bounds, and stepping behavior, then create dynamic or static rigid bodies with specific shape options for collisions.

Can I convert Phaser tilemaps into Matter.js collision bodies?

Yes, you can convert Phaser tilemaps into Matter.js collision bodies using MatterTileBody conversion, enabling physics objects to interact seamlessly with level geometry defined in your tilemap data.

What is the best way to create constraints and collision filtering in Matter.js?

The best way to create constraints and collision filtering in Matter.js is by defining collision categories and masks, then applying joints or springs to control rigid body interactions and compound body behaviors.

Does Phaser 4 support Matter.js sensors and pointer dragging for game objects?

Yes, Phaser 4 supports Matter.js sensors and pointer constraints, enabling you to detect overlaps without physical collisions and implement mouse dragging for interactive rigid bodies within the physics world.

How do I configure Matter.js sleeping bodies and debug rendering in Phaser?

You configure Matter.js sleeping bodies and debug rendering in Phaser by adjusting the world plugin settings to enable body sleeping for performance optimization and toggling debug visualization to inspect physics shapes.

Why do I need to use the Phaser Matter plugin instead of standalone Matter.js?

Using the Phaser Matter plugin instead of standalone Matter.js provides integrated scene lifecycle management, automatic world configuration, and native callbacks for collision filtering and pointer constraints directly within your Phaser game objects.