phaserjs/phaser/physics-arcade
Claude Code and agent skill by phaserjs/phaser
- community
- ext:[{"type":"config","description":"Configuration overrides"}]
Checking that the SKILL.md file is still in the repository.
Use this skill when using Arcade Physics in Phaser 4. Covers enabling physics, velocity, acceleration, gravity, collisions, overlap, world bounds, physics groups, static bodies, and collision categories. Triggers on: physics, arcade, velocity, gravity, collide, overlap, bounce, physics body.
Install
npx vskill@latest install phaserjs/phaser/physics-arcadeSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as phaserjs/phaser/physics-arcade.
Arcade Physics
Setting up and using Arcade Physics in Phaser 4 -- enabling physics in GameConfig, creating physics-enabled sprites/images/groups, velocity, acceleration, gravity, collisions (collide/overlap), world bounds, body properties, and collision categories.
Key source paths: src/physics/arcade/ArcadePhysics.js, src/physics/arcade/World.js, src/physics/arcade/Body.js, src/physics/arcade/StaticBody.js, src/physics/arcade/Factory.js, src/physics/arcade/components/, src/physics/arcade/events/ Related skills: ../game-setup-and-config/SKILL.md, ../sprites-and-images/SKILL.md, ../tilemaps/SKILL.md, ../groups-and-containers/SKILL.md
Quick Start
Core Concepts
World (this.physics.world)
The Phaser.Physics.Arcade.World manages all bodies in the simulation. Accessed via this.physics.world in a Scene.
- gravity --
Vector2applied to all dynamic bodies each step. Set via config orthis.physics.world.gravity.y = 300. - bounds --
Rectangledefining the world boundary. Defaults to game canvas size. - bodies --
Setof all dynamicBodyinstances. - staticBodies --
Setof allStaticBodyinstances. - colliders --
ProcessQueueof registeredColliderobjects (fromthis.physics.add.collider/this.physics.add.overlap). - fps -- Physics steps per second (default 60). Read-only; change via
world.setFPS(120). - fixedStep --
true(default) uses fixed timestep;falsesyncs to render fps. - timeScale -- Scaling factor: 1.0 = normal, 2.0 = half speed, 0.5 = double speed.
- isPaused -- When true, no bodies update and no colliders run. Toggle via
world.pause()/world.resume(). - useTree --
true(default) uses RTree spatial index for dynamic bodies. Disable for 5000+ bodies. - drawDebug -- Enables debug rendering when
true. Set via configdebug: true.
Bodies (Body)
A dynamic body is created automatically when you use this.physics.add.sprite() or this.physics.add.image(). Access it via gameObject.body.
Key properties (all on Body):
- velocity --
Vector2, pixels/sec - acceleration --
Vector2, pixels/sec^2 - drag --
Vector2, deceleration (applied only when acceleration is zero) - gravity --
Vector2, per-body gravity added to world gravity - bounce --
Vector2, rebound factor relative to 1 - friction --
Vector2, default(1, 0)-- velocity imparted by immovable body to riding body - maxVelocity --
Vector2, default(10000, 10000)| maxSpeed -- scalar cap, default-1(none) - mass -- default
1, affects collision momentum exchange - immovable --
false; iftrue, never moved by collisions - pushable --
true; iffalse, reflects velocity to colliding body - moves --
true; iffalse, position/rotation not updated by physics - enable --
true;falseremoves from simulation - useDamping --
false; whentrue, drag is a multiplier (0-1) instead of linear - collideWorldBounds --
false; onWorldBounds/onCollide/onOverlap --false, settrueto emit events
Shape: isCircle (set via setCircle), width/height, offset (Vector2), center (read-only midpoint).
Collision state (read-only, reset each step): touching / blocked / wasTouching -- { none, up, down, left, right }. embedded -- both overlapping with zero velocity.
Angular: angularVelocity (deg/sec), angularAcceleration, angularDrag, maxAngular (default 1000), allowRotation (default true).
Static Bodies (StaticBody)
A static body never moves and is not affected by gravity or velocity. It uses an optimized RTree for fast spatial lookups.
- Created via
this.physics.add.staticSprite(),this.physics.add.staticImage(), orthis.physics.add.staticGroup(). - After changing the parent Game Object's position or scale, call
body.reset()orgameObject.refreshBody()to sync. - Has
collisionCategoryandcollisionMasklike dynamic bodies. - Does not have velocity, acceleration, drag, or gravity properties.
Common Patterns
Enabling Physics on Existing Game Objects
Creating Physics Sprites and Images
Velocity and Gravity
Collide and Overlap
Two approaches: persistent Colliders (checked every frame automatically) or one-shot checks (called in update()).
Groups
PhysicsGroup config keys (applied as defaults to new members): collideWorldBounds, bounceX/Y, accelerationX/Y, dragX/Y, gravityX/Y, frictionX/Y, velocityX/Y, angularVelocity, angularAcceleration, angularDrag, maxVelocityX/Y, maxSpeed, mass, immovable, allowDrag, allowGravity, allowRotation, useDamping, enable.
World Bounds
Body Properties
Collision Categories
Collision categories let you filter which bodies can collide with each other using bitmask values. Maximum 32 categories.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/physics-arcade/SKILL.md
Popularity
- Repository stars
- 39,633
- Repository forks
- 7,130
- 7-day trend score
- 53
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 17 May 2026, 6 months ago.
Extension points
configConfiguration overrides
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/phaserjs/phaser/physics-arcade)