physics-arcade

Implements Arcade Physics in Phaser 4 including velocity, gravity, collisions, and collision categories.

Updated Jul 13, 2026
One-click install
npx skills add https://github.com/russellmorgan/UnderConstruction --skill physics-arcade-russellmorgan
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: physics-arcade
Source: https://github.com/russellmorgan/UnderConstruction/tree/main/.claude/skills/physics-arcade
Command: npx skills add https://github.com/russellmorgan/UnderConstruction --skill physics-arcade-russellmorgan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up and debugging Arcade Physics in Phaser 4 involves many interacting pieces — world configuration, body properties, colliders, groups, and collision filtering — and small mistakes (like forgetting to refresh a static body or opt into events) cause silent failures. This Skill provides the correct APIs, patterns, and gotchas so physics behavior works the first time. ## Core Features & Use Cases - Physics Setup & Bodies: Enable Arcade Physics in GameConfig, create dynamic and static sprites/images/groups, and configure velocity, acceleration, gravity, drag, bounce, and mass. - Collision Handling: Register persistent colliders and overlaps with callbacks, use one-shot collision checks, and filter interactions with collision categories and masks. - World & Events: Configure world bounds, gravity, fixed timestep, timeScale, and subscribe to collide, overlap, and worldbounds events. - Use Case: You are building a platformer in Phaser 4 and need a player that runs, jumps, collides with static platforms, and collects coins via overlap triggers — this Skill gives you the exact code patterns and warns you about pitfalls like static body refresh and event opt-in flags. ## Quick Start Use the physics-arcade skill to set up a Phaser 4 scene where a player sprite collides with static platforms and overlaps collectible coins.

Frequently Asked Questions about physics-arcade

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

FAQPage Schema
How do I enable Arcade Physics in Phaser 4?▼

Enable Arcade Physics by adding a physics block to your GameConfig with default: 'arcade' and arcade options like gravity and debug. Then create physics objects in a Scene using this.physics.add.sprite() or this.physics.add.staticGroup().

What is the difference between collide and overlap in Phaser Arcade Physics?▼

collide performs separation, pushing bodies apart so they cannot pass through each other. overlap only detects intersection without moving anything, making it the right choice for triggers like pickups and sensors.

How do I make certain objects only collide with specific others in Phaser?▼

Use collision categories: get bitmasks via this.physics.nextCategory(), assign them with setCollisionCategory(), and filter interactions with setCollidesWith(). Up to 32 categories are supported, and resetCollisionCategory() restores the default mask.

Why does my static body not move after I change its position or scale in Phaser?▼

Static bodies do not auto-sync with their Game Object's transform. After changing position, scale, or origin, you must call body.reset() or gameObject.refreshBody() to update the physics body.

Why are Phaser physics events like collide or worldbounds not firing?▼

World events require per-body opt-in. Set body.onCollide, body.onOverlap, or body.onWorldBounds to true before the corresponding 'collide', 'overlap', or 'worldbounds' events will be emitted on this.physics.world.

When should I disable the RTree spatial index in Phaser Arcade Physics?▼

The RTree spatial index is enabled by default via useTree: true and speeds up lookups, but becomes expensive to rebuild with very large body counts. Consider setting useTree: false when simulating 5000 or more dynamic bodies.