physics-arcade

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

2|10|Updated Jul 28, 2026
One-click install
npx skills add https://github.com/kodingvibes/gamejam-2026 --skill physics-arcade-kodingvibes
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: physics-arcade
Source: https://github.com/kodingvibes/gamejam-2026/tree/main/participantes/jpyunism/.agents/skills/physics-arcade
Command: npx skills add https://github.com/kodingvibes/gamejam-2026 --skill physics-arcade-kodingvibes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up 2D physics in Phaser 4 involves many moving parts: enabling the physics system in GameConfig, creating dynamic and static bodies, tuning velocity and gravity, and wiring up collision detection. This Skill provides a complete reference so you can implement Arcade Physics correctly without digging through Phaser source code. ## Core Features & Use Cases - Physics Setup and Bodies: Enable Arcade Physics in GameConfig and create dynamic sprites, static platforms, and physics groups with the factory methods. - Movement and Forces: Control velocity, acceleration, drag, bounce, per-body gravity, and world bounds for game objects. - Collision Handling: Register persistent colliders and overlaps, filter interactions with collision categories, and listen to world events like collide and worldbounds. - Use Case: Build a platformer where the player runs and jumps on static platforms, collects coins via overlap callbacks, and enemies are separated from bullets using collision category bitmasks. ## Quick Start Ask the AI to set up Arcade Physics in a Phaser 4 scene with a player sprite that collides with static platforms and responds to arrow key movement.

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 set to 'arcade' and optional arcade settings 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?▼

Collide performs separation, pushing bodies apart so they do not interpenetrate, while overlap only detects intersection without moving anything. Use overlap for triggers like pickups and collide for solid objects like platforms.

How do I make a static platform in Phaser Arcade Physics?▼

Create static platforms with this.physics.add.staticImage, staticSprite, or staticGroup. After changing a static body's position or scale, call refreshBody or body.reset to sync, since static bodies do not auto-sync transforms.

Why are my Phaser collision events not firing?▼

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

How do collision categories work in Phaser Arcade Physics?▼

Collision categories use bitmask values to filter which bodies collide. Call this.physics.nextCategory to get a category, assign it with setCollisionCategory, then define allowed targets with setCollidesWith. A maximum of 32 categories is supported.

When should I disable the RTree in Phaser physics?▼

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