physics-matter

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

Updated Feb 11, 2026
One-click install
npx skills add https://github.com/ArtRiv/game-topicos-especiais --skill physics-matter-artriv
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: physics-matter
Source: https://github.com/ArtRiv/game-topicos-especiais/tree/main/skills/physics-matter
Command: npx skills add https://github.com/ArtRiv/game-topicos-especiais --skill physics-matter-artriv

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you set up and use Matter.js physics in Phaser 4 so your game can have believable rigid-body behavior, constraints, sensors, and collision rules without manual low-level wiring.

Core Features & Use Cases

  • Configure Matter world behavior: gravity, bounds, sleeping, fixed timestep/stepping, and debug rendering for faster iteration.
  • Create and control physics objects: Matter Sprites/Images/Game Objects with shapes, mass/friction/bounce, and runtime motion/forces.
  • Implement gameplay-critical interactions: constraints (joints/springs/world constraints), composites (stacks/chains/soft bodies), collision filtering, sensors, and collision callbacks.
  • Common scenarios: falling platforms with stable collisions, pointer dragging of objects, trigger zones that detect overlap without physical response, and tilemap-based physics bodies.

Quick Start

Use the physics-matter Skill to enable Matter physics, create a Matter sprite and a static rectangle, then configure gravity and run your scene so you can test rigid-body collisions and pointer interactions immediately.

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 in a Phaser 4 scene?

To set up Matter.js physics in Phaser 4, you configure the physics.matter properties including gravity, bounds, sleeping, and debug rendering, then use this.matter.add to create bodies and constraints for your scene.

How do I create trigger zones using sensors in Phaser 4?

Sensors in Phaser 4 create trigger zones that detect overlap without physical response. You configure sensor bodies and use this.matter.world events to drive game logic when objects enter the detected area.

Can I convert tilemap collisions to Matter.js physics bodies in Phaser?

Yes, Matter.js supports tilemap collision conversion in Phaser. You can convert tilemap layers into physics bodies to enable rigid-body collisions directly against your level geometry using this.matter.add.

How do I implement pointer dragging for physics objects in Matter.js?

Pointer dragging in Matter.js uses constraints to attach the mouse pointer to a physics body. You create a joint or spring constraint at runtime to allow interactive gameplay movement of the object.

What is the best way to handle collision filtering in Matter.js?

Collision filtering in Matter.js uses category and mask bits to define which physics bodies interact. You apply collision rules during body creation to control rigid-body behavior and specific gameplay interactions.

Does Matter.js support composites for stacks and soft bodies in Phaser?

Yes, Matter.js supports composites in Phaser to build complex structures like stacks, chains, and soft bodies. You group multiple bodies and constraints together to create jointed objects with stable collisions.