ai-behavior-trees-util…
Build a production behavior-tree runtime (Blackboard, action/condition leaves, sequence/selector/parallel composites, decorators)…
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,
Claude Code
$ npx -y skills add gamedev-skills/awesome-gamedev-agent-skills --skill phaser-arcade-physics --agent claude-code
Codex
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill phaser-arcade-physics -a codex -y
Cursor
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill phaser-arcade-physics -a cursor -y
Gemini CLI
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill phaser-arcade-physics -a gemini-cli -y
GitHub Copilot
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill phaser-arcade-physics -a github-copilot -y
OpenCode
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill phaser-arcade-physics -a opencode -y
Windsurf
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill phaser-arcade-physics -a windsurf -y
name: phaser-arcade-physics description: > Phaser 4 Arcade Physics movement and collision: bodies, velocity, gravity, colliders vs overlaps, groups and bullet pools. Use for a Phaser platformer or top-down controller, or a sprite that ignores physics, onFloor() always false or bodies passing through walls. Not for scenes and the loader (`phaser-core`), coyote time (`platformer`) or tunnelling theory (`physics-tuning`).
Moves and collides sprites with Phaser's Arcade engine: axis-aligned rectangles and circles, no rotation in collision, no joints. That is enough for most platformers, shooters and top-down games, and it is fast. New projects target **Phaser 4.2**; check the installed major before editing an existing project. If the game needs hinges, springs, slopes or rotated polygons, Matter physics is the separate engine for that, and its bodies never collide with Arcade bodies.
between sprites, groups and tilemap layers.
`body.setVelocity` or `this.physics.add.collider`.
(`platformer`), or fixed timestep and tunnelling in general (`physics-tuning`).
1. **Enable the world with debug drawing on**: `physics: { default: 'arcade', arcade: { gravity: { x: 0, y: 600 }, debug: true } }`. Body outlines and velocity lines answer most "why didn't it collide" questions at a glance. Turn debug off before release. 2. **Create bodies through the physics factory**: `this.physics.add.sprite` (dynamic), `this.physics.add.staticImage` or `staticGroup` (walls and ground), or `this.physics.add.existing(obj)` for an object you already made. 3. **Move dynamic bodies through the body** with velocity, acceleration and gravity. Writing `x`/`y` directly teleports the body past colliders. 4. **Register each `collider` and `overlap` once in `create`.** A collider separates bodies; an overlap only reports contact (pickups, triggers, hurtboxes). 5. **Use groups** so one collider covers many objects, and pool projectiles with `maxSize`. 6. **Verify** with the probe in [Verify](#verify).
const config = {
type: Phaser.AUTO,
width: 800,
height: 600,
physics: {
default: 'arcade',
arcade: {
gravity: { x: 0, y: 600 }, // top-down games use { x: 0, y: 0 }
debug: true, // body outlines and velocity while building
},
},
scene: [PlayScene],
};update() {
const speed = 220;
const body = this.player.body;
body.setVelocity(0);
if (this.cursors.left.isDown) body.setVelocityX(-speed);
if (this.cursors.right.isDown) body.setVelocityX(speed);
if (this.cursors.up.isDown) body.setVelocityY(-speed);
if (this.cursors.down.isDown) body.setVelocityY(speed);
body.velocity.normalize().scale(speed); // diagonals at the same speed (zero stays zero)
}create() {
this.platforms = this.physics.add.staticGroup();
this.platforms.create(400, 568, 'ground');
this.player = this.physics.add.sprite(100, 450, 'player');
this.player.setCollideWorldBounds(true);
this.player.body.setSize(20, 36, true); // hitbox tighter than the art, centred
this.physics.add.collider(this.player, this.platforms); // once, here
this.cursors = this.input.keyboard.createCursorKeys();
}
update() {
const onGround = this.player.body.blocked.down; // same as body.onFloor()
const dir = (this.cursors.right.isDown ? 1 : 0) - (this.cursors.left.isDown ? 1 : 0);
this.player.setVelocityX(dir * 160);
if (this.cursors.up.isDown && onGround) this.player.setVelocityY(-450);
}// Push apart, then react.
this.physics.add.collider(this.player, this.enemies, (player, enemy) => this.hurt(player, enemy));
// Detect only. The optional 4th argument returns false to skip a pair before the callback.
this.physics.add.overlap(this.player, this.coins, (player, coin) => {
coin.disableBody(true, true); // deactivate and hide; the group can reuse it
this.registry.inc('score', 10);
});create() {
this.bullets = this.physics.add.group({ defaultKey: 'bullet', maxSize: 30 });
}
fire(x, y) {
const bullet = this.bullets.get(x, y); // an inactive member, or a new one under maxSize
if (!bullet) return; // every bullet is in flight
bullet.enableBody(true, x, y, true, true);
bullet.body.setAllowGravity(false);
bullet.setVelocityY(-500);
}
update() {
// Return off-screen bullets to the pool, or firing stops after 30 shots.
for (const bullet of this.bullets.getChildren()) {
if (bullet.active && bullet.y < -32) bullet.disableBody(true, true);
}
}1. `npm run build` (or `npx tsc --noEmit`) passes. 2. Probe the running game. If `phaser-core`'s headless smoke script is in use, put this body in its `page.evaluate(() => { ... })` after a two-second wait, adjusting the scene key and object names:
const s = window.game.scene.getScene('play');
return {
bodies: s.physics.world.bodies.size, // dynamic bodies alive
staticBodies: s.physics.world.staticBodies.size,
playerOnFloor: s.player.body.blocked.down, // true once the player has landed
playerY: Math.round(s.player.y),
};Expect `playerOnFloor: true` and a `playerY` resting on the ground for a platformer, and a body count that stays flat while firing (the pool is recycling). 3. With `debug: true`, take a screenshot and check that hitboxes sit on the art. Without browser automation, ask the user to run with `debug: true` and report whether the outlines match the sprites and where the player stops.
<img src="docs/assets/awesome-gamedev-agent-skills-banner.png" width="820" alt="awesome-gamedev-agent-skills — game-dev skills for AI coding agents.
Build a production behavior-tree runtime (Blackboard, action/condition leaves, sequence/selector/parallel composites, decorators)…
Implement game audio practice — bus/mixer architecture and gain in decibels, ducking (sidechain), adaptive/dynamic music via…
Build game cameras that feel good — 2D follow with a deadzone, look-ahead, smoothing, and level-bounds clamping; 3D third-person…
Plan, generate, source, normalize, and validate cohesive visual game assets. Use for art direction, style bibles, sprites,…
Build branching dialogue and narrative — a node/choice graph with conditions, variables, and localization hooks — and choose…
Design NPC and enemy decision-making with finite state machines, behavior trees, steering behaviors, and A* pathfinding —…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.