physics-matter

Implements Matter.js rigid-body physics in Phaser 4 games including constraints, sensors, and collision filtering.

465|41|Updated Aug 4, 2026
One-click install
npx skills add https://github.com/autonomous-ai/openharness --skill physics-matter-autonomous-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: physics-matter
Source: https://github.com/autonomous-ai/openharness/tree/main/store/agents/phaser/skills/physics-matter
Command: npx skills add https://github.com/autonomous-ai/openharness --skill physics-matter-autonomous-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up full rigid-body physics in Phaser 4 requires navigating Matter.js concepts like compound bodies, constraints, collision bitmasks, and sleep systems, which are easy to misconfigure without a structured reference. ## Core Features & Use Cases - Body and Game Object Creation: Create Matter sprites, images, and bodies with shapes like rectangles, circles, polygons, vertex sets, and PhysicsEditor data. - Constraints and Composites: Build joints, springs, chains, stacks, soft bodies, cars, and Newton's cradles with configurable stiffness and damping. - Collision Control: Use collision categories, groups, sensors, and per-body callbacks to manage which bodies interact and respond to collision events. - Use Case: Build a platformer where the player drags crates with the mouse, triggers sensor zones, and collides only with ground and enemies using category filtering. ## Quick Start Ask the AI to set up a Phaser 4 scene with Matter.js physics including a draggable player sprite, static ground, and collision events.

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 Phaser 4?

Enable Matter physics by setting physics.default to 'matter' in the game config with a matter options object for gravity, bounds, and debug. Then create bodies in your scene using this.matter.add.sprite, image, or shape methods like rectangle and circle.

How do I create constraints and joints in Phaser Matter physics?

Use this.matter.add.constraint(bodyA, bodyB, length, stiffness, options) to create joints, springs, or pins between bodies. For pinning a body to a world point, use this.matter.add.worldConstraint with a pointA position.

What is the difference between Matter physics and Arcade physics in Phaser?

Matter.js provides full rigid-body simulation with rotation, compound bodies, constraints, and realistic collision response, while Arcade physics is a lightweight AABB system. Matter positions bodies by center of mass rather than top-left origin.

How does collision filtering work in Matter.js?

Matter uses bitmask categories and masks: assign each body a category with setCollisionCategory and specify what it hits with setCollidesWith. Collision groups override category and mask, where matching negative groups never collide and matching positive groups always collide.

Why is my Matter.js force not moving the body?

Matter.js force values are very small, typically between 0.01 and 0.1, unlike pixel-based velocities. Use applyForce with tiny vectors for gradual acceleration, or setVelocity with values between 1 and 15 for direct movement control.

Can I use Matter physics with Phaser tilemaps?

Yes, call setCollisionByProperty on the tilemap layer first, then run this.matter.world.convertTilemapLayer to create a MatterTileBody per colliding tile. It uses Tiled collision shapes when defined, otherwise falls back to tile bounds.