Phaser Gameobj logo

Phaser Gameobj

Organization
Yakoub-ai
phaser-gameobj

This skill should be used when the user asks to "add a sprite", "create a player", "add text to game", "create particles", "add a tilemap", "create a group", "add a container", "create game objects", "draw shapes", "add UI elements", "create a camera", "add depth", or needs to add any visual, interactive, or logical element to a Phaser 4 scene.

Overview

PublisherYakoub-ai
Repositoryphaser4-gamedev
Skill namephaser-gameobj
Stars
29
Forks
3
Bundled files
1
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Yakoub-ai on GitHub. Read the source before you install it.

Installation

Install the Phaser Gameobj AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Yakoub-ai/phaser4-gamedev/tree/main/skills/phaser-gameobj
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Yakoub-ai/phaser4-gamedev.git /tmp/phaser4-gamedev
mkdir -p .claude/skills
cp -r /tmp/phaser4-gamedev/skills/phaser-gameobj .claude/skills/phaser-gameobj
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Phaser Gameobj in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Phaser Gameobj on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Phaser Gameobj is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Phaser 4 Game Objects

Choose the right game object type for each use case. Every object is created with this.add.* (visual only) or this.physics.add.* (with Arcade Physics body).

Object Type Reference

Sprite — Animated, interactive, can have physics

typescript
// Static display sprite (no physics)
const sprite = this.add.sprite(x, y, 'textureKey');
const sprite = this.add.sprite(x, y, 'atlas', 'frameName.png');  // atlas frame

// Physics sprite (dynamic body, affected by gravity/velocity)
const sprite = this.physics.add.sprite(x, y, 'textureKey');

// Configure physics body
(sprite.body as Phaser.Physics.Arcade.Body)
  .setSize(24, 32)           // hitbox size (smaller than visual for player)
  .setOffset(4, 8)           // offset from sprite origin
  .setMaxVelocity(300, 600); // cap velocity

// Common sprite settings
sprite.setOrigin(0.5, 0.5);  // pivot point (default: 0.5, 0.5 = center)
sprite.setScale(2);           // scale up
sprite.setAlpha(0.8);         // transparency
sprite.setDepth(10);          // render order (higher = on top)
sprite.setFlipX(true);        // mirror horizontally
sprite.setTint(0xff0000);     // tint red
sprite.clearTint();

Image — Static visual, no animation

typescript
const img = this.add.image(x, y, 'key');
const img = this.add.image(x, y, 'atlas', 'frame.png');

// Useful for: backgrounds, UI panels, static decorations
// Lighter than Sprite (no animation overhead)
img.setScrollFactor(0);  // Fixed to camera (for UI)
img.setScrollFactor(0.5); // Parallax at half speed

Text — Dynamic text display

typescript
const text = this.add.text(x, y, 'Score: 0', {
  fontSize: '24px',
  fontFamily: 'Arial, sans-serif',
  color: '#ffffff',
  stroke: '#000000',
  strokeThickness: 4,
  align: 'center',
  backgroundColor: '#333333',
  padding: { x: 8, y: 4 },
  wordWrap: { width: 400, useAdvancedWrap: true },
});

text.setText('Score: 100');  // update text
text.setScrollFactor(0);     // fixed to camera (HUD)

BitmapText — faster for many text objects (renders as texture):

typescript
// Must load bitmap font first in preload:
this.load.bitmapFont('arcade', 'assets/fonts/arcade.png', 'assets/fonts/arcade.xml');

const bmpText = this.add.bitmapText(x, y, 'arcade', 'Score: 0', 32);
bmpText.setText('Score: 100');

Graphics — Draw shapes programmatically

typescript
const gfx = this.add.graphics();

// Filled shapes
gfx.fillStyle(0xff0000, 1.0);          // color, alpha
gfx.fillRect(x, y, width, height);
gfx.fillCircle(x, y, radius);
gfx.fillTriangle(x1,y1, x2,y2, x3,y3);

// Stroked shapes
gfx.lineStyle(2, 0xffffff, 1.0);       // lineWidth, color, alpha
gfx.strokeRect(x, y, width, height);
gfx.strokeCircle(x, y, radius);

// Paths
gfx.beginPath();
gfx.moveTo(x1, y1);
gfx.lineTo(x2, y2);
gfx.closePath();
gfx.strokePath();

gfx.clear();  // erase everything (call each frame if updating)

Container — Group objects for relative positioning

typescript
// Create a health bar from multiple objects
const healthBar = this.add.container(x, y);
const bg = this.add.graphics().fillStyle(0x333333).fillRect(0, 0, 100, 12);
const bar = this.add.graphics().fillStyle(0x00ff00).fillRect(0, 0, 100, 12);
const label = this.add.text(50, -14, 'HP', { fontSize: '10px' }).setOrigin(0.5);
healthBar.add([bg, bar, label]);

// All children move/rotate/scale with container
healthBar.setPosition(200, 50);
healthBar.setDepth(10);
// Note: Physics does NOT work on containers — physics lives on individual sprites

Group — Manage a collection of objects

typescript
// Static group (pool of objects created manually)
const stars = this.add.group();
for (let i = 0; i < 20; i++) {
  stars.add(this.add.sprite(
    Phaser.Math.Between(0, 800),
    Phaser.Math.Between(0, 600),
    'star'
  ));
}

// Physics group with automatic pooling
const bullets = this.physics.add.group({
  classType: Bullet,     // custom class extending Arcade.Sprite
  maxSize: 30,
  runChildUpdate: true,  // calls update() on active members
});

// Get a member from the pool
const bullet = bullets.get(x, y) as Bullet;
if (bullet) {
  bullet.setActive(true).setVisible(true);
  bullet.setVelocityY(-400);
}

// Static group (for tilemap-like platforms)
const platforms = this.physics.add.staticGroup();
platforms.create(400, 580, 'platform');
platforms.create(100, 400, 'platform');

Particles — Visual effects

typescript
// Phaser 4 particles API (same pattern as late v3)
const emitter = this.add.particles(0, 0, 'star', {
  speed: { min: 50, max: 150 },
  scale: { start: 0.5, end: 0 },
  blendMode: 'ADD',
  lifespan: 800,
  quantity: 5,
  frequency: 100,         // emit every 100ms
  maxParticles: 50,       // cap total particles (performance!)
  gravityY: 200,
  rotate: { min: 0, max: 360 },
});

// Follow a sprite
emitter.setPosition(player.x, player.y);

// One-shot explosion burst
this.add.particles(x, y, 'spark', {
  speed: { min: 100, max: 300 },
  lifespan: 600,
  quantity: 20,
  maxParticles: 20,
  scale: { start: 1, end: 0 },
  blendMode: 'ADD',
});

TileSprite — Scrolling/repeating texture

typescript
const bg = this.add.tileSprite(0, 0, 800, 600, 'bg-tiles');
bg.setOrigin(0, 0);

// Scroll in update():
bg.tilePositionX += 1;  // scroll right
bg.tilePositionY -= 0.5;

// NOTE: TileSprite does NOT support texture cropping in Phaser 4 (removed from v3)

Depth and Camera

typescript
// Depth (z-order)
background.setDepth(0);
ground.setDepth(1);
player.setDepth(2);
hud.setDepth(10);         // HUD elements always on top

// setScrollFactor controls parallax / HUD behavior
uiElement.setScrollFactor(0);    // Fixed to camera (HUD)
farBg.setScrollFactor(0.2);      // Slow parallax
nearBg.setScrollFactor(0.7);     // Fast parallax
gameObject.setScrollFactor(1);   // Default: moves with world

Common Patterns

Interactive Object (Clickable)

typescript
const button = this.add.sprite(x, y, 'button-up');
button.setInteractive({ useHandCursor: true });  // pointer cursor on hover
button.on('pointerover', () => button.setTexture('button-hover'));
button.on('pointerout', () => button.setTexture('button-up'));
button.on('pointerdown', () => button.setTexture('button-down'));
button.on('pointerup', () => {
  button.setTexture('button-up');
  this.onButtonClick();
});

Animated Sprite with State Machine

typescript
// In update() — simple state-based animation
const body = this.player.body as Phaser.Physics.Arcade.Body;
const isGrounded = body.blocked.down;
const isMoving = Math.abs(body.velocity.x) > 10;

if (!isGrounded) {
  this.player.play('player-jump', true);
} else if (isMoving) {
  this.player.play('player-walk', true);
} else {
  this.player.play('player-idle', true);
}

Floating Damage Numbers

typescript
private showDamage(x: number, y: number, amount: number): void {
  const text = this.add.text(x, y, `-${amount}`, {
    fontSize: '20px',
    color: '#ff4444',
    stroke: '#000',
    strokeThickness: 3,
  }).setOrigin(0.5).setDepth(100);

  this.tweens.add({
    targets: text,
    y: y - 60,
    alpha: 0,
    duration: 900,
    ease: 'Quad.Out',
    onComplete: () => text.destroy(),
  });
}

Phaser 4 Notes

  • Geom.Point is removed — use Phaser.Math.Vector2 for 2D coordinates
  • Math.PI2 is removed — use Math.TAU (π×2) or Math.PI_OVER_2 (π/2)
  • TileSprite no longer supports texture cropping — use a RenderTexture if needed
  • DynamicTexture/RenderTexture — must call .render() after drawing operations

Additional Resources

Reference Files

  • references/game-objects-api.md — Complete API quick reference for every object type, advanced usage, and performance tips

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Phaser Gameobj AI skill do?

This skill should be used when the user asks to "add a sprite", "create a player", "add text to game", "create particles", "add a tilemap", "create a group", "add a container", "create game objects", "draw shapes", "add UI elements", "create a camera", "add depth", or needs to add any visual, interactive, or logical element to a Phaser 4 scene.

Why use Phaser Gameobj on TypingMind?

Because you install it once and use it with any model. Phaser Gameobj is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Phaser Gameobj in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Yakoub-ai/phaser4-gamedev/tree/main/skills/phaser-gameobj. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Phaser Gameobj?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Phaser Gameobj?

As many as you like. As long as a model supports skills, you can use Phaser Gameobj with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Phaser Gameobj AI skill free?

It is published on GitHub by Yakoub-ai. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇