physics-arcade

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up physics in Phaser 4 games involves many interacting pieces—world configuration, dynamic and static bodies, colliders, and collision filtering—and mistakes like unsynced static bodies or misused collide versus overlap calls cause subtle bugs. This Skill provides the correct APIs, patterns, and gotchas for the Arcade Physics system. ## Core Features & Use Cases - Physics Setup and Bodies: Enable Arcade Physics in GameConfig, create dynamic sprites and static groups, and configure velocity, acceleration, gravity, drag, and bounce. - Collision Handling: Register persistent colliders and overlaps with callbacks, use one-shot checks, and filter interactions with collision categories and masks. - World Management: Configure world bounds, gravity, fixed timestep, time scale, debug rendering, and physics events like collide, overlap, and worldbounds. - Use Case: When building a platformer in Phaser 4, use this Skill to correctly set up a player sprite with world bounds collision, static platform groups, coin pickup overlaps, and enemy collision categories. ## Quick Start Ask the AI to set up Arcade Physics in a Phaser 4 scene with a player sprite, static platforms, and a collider between them.

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?

Add a physics block to your GameConfig with default set to 'arcade' and optional arcade settings like gravity and debug. Then create physics objects in a Scene using this.physics.add.sprite, image, staticGroup, or existing.

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 collision categories work in Phaser Arcade Physics?

Call this.physics.nextCategory() to get unique bitmask values, assign them with setCollisionCategory, and control interactions with setCollidesWith. Bodies collide only when the category and mask bitwise check passes, with a maximum of 32 categories.

Why does my static body not move after changing its position in Phaser?

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

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 in Phaser Arcade Physics?

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