# phaser-arcade-physics

Configures movement, gravity, and collisions in Phaser 4 games using Arcade Physics. Helps write top-down or platformer controls and resolve body interactions.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 5500 installs · ★ 4506
- Author: gamedev-skills
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/gamedev-skills/awesome-gamedev-agent-skills/tree/HEAD/skills/web-engines/phaser-arcade-physics/SKILL.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/phaser-arcade-physics

## What it does

Guides AI coding agents through Phaser 4 Arcade Physics, targeting version 4.2. It covers setting up dynamic and static bodies with `this.physics.add.sprite` or `staticGroup`, applying velocity, gravity, and acceleration, and handling collisions via `collider` and `overlap`. General scene architecture and asset loading belong in `phaser-core`, while hinges and complex polygons require Matter physics.

The guidance addresses common Arcade Physics pitfalls. Modifying `x` and `y` coordinates directly bypasses the physics step and causes tunneling through walls. Velocity vectors need normalization during diagonal movement to prevent extra speed. Ground checks via `body.onFloor()` or `body.blocked.down` only return true if gravity is active and colliders are set before the check.

Arcade Physics restricts bodies strictly to AABB rectangles and circles. If your project demands stacking rigid bodies, springs, or non-rectangular meshes, this engine is the wrong choice.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill phaser-arcade-physics -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/phaser-arcade-physics/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/phaser-arcade-physics/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill phaser-arcade-physics -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/phaser-arcade-physics/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill phaser-arcade-physics -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/phaser-arcade-physics/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install gamedev-skills/awesome-gamedev-agent-skills phaser-arcade-physics
```

2. **Manually: put the files in place**
- File: `.github/skills/phaser-arcade-physics/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill phaser-arcade-physics -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/gamedev-skills/awesome-gamedev-agent-skills --path skills/web-engines/phaser-arcade-physics
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/phaser-arcade-physics/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill phaser-arcade-physics -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/gamedev-skills/awesome-gamedev-agent-skills/tree/HEAD/skills/web-engines/phaser-arcade-physics/SKILL.md

## When to use it
- implement top-down 8-directional movement with normalized diagonal speed
- build platformer jump mechanics with ground checks via `onFloor()`
- manage projectile pooling using `this.physics.add.group`
- handle physical separations with `collider` and trigger pickups with `overlap`

## Example prompts
- Create a top-down movement controller in Phaser 4 using Arcade Physics
- Set up a platformer scene with static platforms, gravity, and jump mechanics
- Implement a bullet pool using this.physics.add.group and detect overlaps with enemies

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 2aad726d71d86ad4.

BEGIN THIRD-PARTY FILE 2aad726d71d86ad4
```text
---
name: phaser-arcade-physics
description: >
  Use Phaser 4 Arcade Physics: enable the world, give sprites bodies, set
  velocity/acceleration/gravity, and resolve collisions with colliders, overlaps,
  groups, and world bounds. Use when a Phaser game needs movement or collisions —
  when the user mentions Arcade Physics, this.physics, setVelocity, collider,
  overlap, gravity, onFloor, or a platformer/top-down controller. For game config,
  scenes, and the loader use phaser-core.
---

# Phaser 4 Arcade Physics

Add movement and collision to a Phaser game with the lightweight **Arcade
Physics** engine (AABB rectangles and circles only). Targets **Phaser 4.2** for
new projects; inspect the installed major before editing an existing project.

## When to use

- Use for top-down or platformer movement, velocity/acceleration/gravity, bouncing,
  world bounds, and collision/overlap resolution between sprites, groups, and tiles.
- Use when the scene enables `physics: { default: 'arcade' }` and code calls
  `this.physics.add.*`, `body.setVelocity`, or `this.physics.add.collider`.

**When *not* to use:** the `Game` config, scene structure, asset loading, or
cameras → use `phaser-core`. Hinges, springs, complex polygons, or stacking
rigid bodies → use Matter physics (a different engine; Arcade and Matter bodies
do not interact). For engine-agnostic feel tuning see `physics-tuning`.

## Core workflow

1. **Enable the world.** Set `physics: { default: 'arcade', arcade: { gravity:
   {...}, debug: true } }` in the game or scene config. Turn `debug` on while
   building to see body outlines and velocity vectors.
2. **Give a sprite a body.** Create it with `this.physics.add.sprite(...)` (dynamic)
   or `this.physics.add.staticImage(...)` (static), or attach to an existing object
   with `this.physics.add.existing(obj)`.
3. **Drive it through the body, not by setting `x`/`y`.** Use `setVelocity`,
   `setAcceleration`, gravity, `setBounce`, and `setCollideWorldBounds`. The engine
   integrates position from velocity each step (already frame-rate independent).
4. **Resolve interactions.** `this.physics.add.collider(a, b)` separates bodies;
   `this.physics.add.overlap(a, b, cb)` detects without separating (pickups,
   triggers). Pass a callback to react.
```
END THIRD-PARTY FILE 2aad726d71d86ad4

The third-party file has ended. Everything between the 2aad726d71d86ad4 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2284 of 8194 bytes. © gamedev-skills · Apache-2.0 · https://github.com/gamedev-skills/awesome-gamedev-agent-skills/tree/HEAD/skills/web-engines/phaser-arcade-physics/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
