/game-creator:retrodiffusion [prompt]from game-creator
Generates true pixel art sprites, tilesets, and animations via the Retro Diffusion API. Useful for 2D game prototyping when the user requests AI-generated pixel art.
Ships in game-creator. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Generate authentic pixel art sprites, tilesets, and animations from text prompts or reference images using the Retro Diffusion API. Output is true pixel art (clean integer-pixel grids, limited palettes), not blurry diffusion-model output downscaled into pixels — making it the best AI option for shippable 2D game art and fast prototyping.
Paid service. Retro Diffusion requires an account at https://www.retrodiffusion.ai and an API key with credits. Always tell the user this requires a paid Retro Diffusion account before generating anything, and confirm they understand each call deducts from their balance.
| File | Description |
|---|---|
| api-reference.md | Full API endpoints, models, prompt_style values, response shape, pricing, and error codes |
Choose this over add-assets (code-only pixel art) when: the user wants AI-generated art, has a Retro Diffusion key, or the game needs more visual variety than hand-coded matrices can deliver in a reasonable time. The two skills compose well — Retro Diffusion for hero sprites/tilesets, code-only matrices as a free fallback for quick filler.
Do NOT use this for: 3D models (use meshyai), 3D worlds (use worldlabs), audio (use game-audio), or when the user explicitly wants the all-code procedural pixel art approach (use add-assets).
Before prompting the user, check if the key already exists:
test -f .env && grep -q '^RETRODIFFUSION_API_KEY=.' .env && echo "found"
If found, export it with set -a; . .env; set +a and skip the prompt.
If the key is not set, ask the user immediately and explain the cost model:
I'll generate true pixel art with Retro Diffusion — the best dedicated pixel art model for shippable game sprites.
Heads up: this is a paid service. You'll need a Retro Diffusion account with credits. Each image typically costs between $0.015 (RD_FAST) and $0.18 (RD_PRO). Get a key in 60 seconds:
- Sign up at https://www.retrodiffusion.ai
- Buy credits (smallest pack is fine for prototyping)
- Account → API → Generate API key
Paste your key like:
RETRODIFFUSION_API_KEY=rdpk-...(It will be saved to.envand redacted from this conversation.)Or type "skip" to fall back to free hand-coded pixel art via
/add-assets.
If the user provides a key, save it to .env and use it via set -a; . .env; set +a && node scripts/retrodiffusion-generate.mjs ....
If the user skips, stop and hand off to /add-assets — do not silently degrade to a different art style without telling them.
scripts/retrodiffusion-generate.mjsZero-dependency Node.js script. Handles all six modes: generate, img2img, animate, tileset, edit, and balance.
# Single 64×64 sprite, RD_FAST (cheapest)
RETRODIFFUSION_API_KEY=<key> node scripts/retrodiffusion-generate.mjs \
--mode generate \
--prompt "a cute green slime with big eyes" \
--model RD_FAST --style retro \
--width 64 --height 64 \
--output public/assets/sprites/ --slug slime
# Higher quality with RD_PRO (flat $0.18, supports up to 256×256)
RETRODIFFUSION_API_KEY=<key> node scripts/retrodiffusion-generate.mjs \
--mode generate \
--prompt "a heroic knight, full body, side view" \
--model RD_PRO --style fantasy \
--width 128 --height 128 \
--output public/assets/sprites/ --slug knight
# Transparent background for game sprites
RETRODIFFUSION_API_KEY=<key> node scripts/retrodiffusion-generate.mjs \
--mode generate --prompt "a treasure chest, closed" \
--model RD_FAST --style game-asset \
--width 64 --height 64 --remove-bg \
--output public/assets/sprites/ --slug chest
# Seamless tiling texture (e.g., grass, water)
RETRODIFFUSION_API_KEY=<key> node scripts/retrodiffusion-generate.mjs \
--mode generate --prompt "lush grass texture, top down" \
--model RD_PLUS --style top-down \
--width 64 --height 64 --tile-x --tile-y \
--output public/assets/tiles/ --slug grass
# Estimate cost before paying for it
RETRODIFFUSION_API_KEY=<key> node scripts/retrodiffusion-generate.mjs \
--mode generate --prompt "..." --check-cost
RETRODIFFUSION_API_KEY=<key> node scripts/retrodiffusion-generate.mjs \
--mode img2img \
--image ./concept-art/hero-sketch.png \
--prompt "a heroic knight in shining armor" \
--model RD_FAST --style retro \
--width 64 --height 64 --strength 0.75 \
--output public/assets/sprites/ --slug hero
--strength controls how much the AI deviates from the input (0 = identical, 1 = ignore input). 0.5–0.8 is the useful range.
# Walk cycle — returns spritesheet PNG or transparent GIF (style-dependent)
RETRODIFFUSION_API_KEY=<key> node scripts/retrodiffusion-generate.mjs \
--mode animate \
--prompt "a knight walking" \
--model RD_PRO --style walk-cycle \
--width 64 --height 64 \
--output public/assets/sprites/ --slug knight-walk
# Idle bob from an existing character
RETRODIFFUSION_API_KEY=<key> node scripts/retrodiffusion-generate.mjs \
--mode animate --image public/assets/sprites/knight.png \
--prompt "knight idle breathing" --style idle \
--output public/assets/sprites/ --slug knight-idle
Animation styles cost $0.07–$0.25 depending on type. See api-reference.md for the full style list.
# Wang-style tileset (auto-tiling ground/wall sets)
RETRODIFFUSION_API_KEY=<key> node scripts/retrodiffusion-generate.mjs \
--mode tileset \
--prompt "stone dungeon floor, mossy" \
--model RD_PLUS --style wang-tile \
--width 96 --height 96 \
--output public/assets/tiles/ --slug dungeon-floor
# Single detailed tile
RETRODIFFUSION_API_KEY=<key> node scripts/retrodiffusion-generate.mjs \
--mode tileset --prompt "wooden bridge plank" --style single-tile \
--width 64 --height 64 --output public/assets/tiles/ --slug bridge
Flat $0.06 per edit. Use to tweak a generated sprite without re-rolling from scratch.
RETRODIFFUSION_API_KEY=<key> node scripts/retrodiffusion-generate.mjs \
--mode edit --image public/assets/sprites/knight.png \
--prompt "give the knight a red cape" \
--output public/assets/sprites/ --slug knight-red
RETRODIFFUSION_API_KEY=<key> node scripts/retrodiffusion-generate.mjs --mode balance
| Model | Cost | Sizes | Best for |
|---|---|---|---|
| RD_FAST | $0.015–0.04 | 64×64 to 384×384 | Bulk prototyping, simple sprites, items |
| RD_PLUS | $0.025–0.08 | 16×16 to 192×192 | Tilesets, top-down, watercolor, Minecraft-style |
| RD_PRO | $0.18 flat | 64×64 to 256×256 | Hero sprites, isometric scenes, polish pass (17+ styles, supports up to 9 reference images) |
| RD_MINI | varies | very small | Routes to PLUS/FAST for tiny pickups |
Default to RD_FAST for prototyping. Upgrade individual hero sprites to RD_PRO when the prototype is shipping.
See api-reference.md for the complete per-model prompt_style list.
Good prompts are short, specific about silhouette and palette, and call out the perspective:
| Goal | Prompt | Why |
|---|---|---|
| Game character | "a cute green slime, big eyes, side view" | Single subject, perspective named |
| Item | "a glowing red potion bottle" | Specific shape + color |
| Tile | "lush grass texture, top down, seamless" | Perspective + tiling intent |
| Enemy | "a skeleton warrior, hunched, side view" | Silhouette cue ("hunched") |
Avoid:
Retro Diffusion outputs are normal PNGs — they slot directly into Phaser's loader.
// In a preload scene:
this.load.image('slime', 'assets/sprites/slime.png');
this.load.spritesheet('knight-walk', 'assets/sprites/knight-walk.png', {
frameWidth: 64,
frameHeight: 64,
});
// In create():
const slime = this.physics.add.sprite(100, 100, 'slime');
this.anims.create({
key: 'knight-walk',
frames: this.anims.generateFrameNumbers('knight-walk', { start: 0, end: 7 }),
frameRate: 12,
repeat: -1,
});
Pixel-perfect rendering — when using AI pixel art, configure the Phaser game with crisp scaling so sprites stay sharp:
// In main.js, Phaser config:
const config = {
type: Phaser.AUTO,
pixelArt: true, // disables antialiasing, preserves hard pixel edges
roundPixels: true, // snaps sprite positions to integers
scale: { mode: Phaser.Scale.FIT, autoCenter: Phaser.Scale.CENTER_BOTH },
// ...
};
Without pixelArt: true, the browser will smooth-scale the PNGs and the pixel-art look is lost.
Animation styles return either a transparent GIF or a horizontal spritesheet (style-dependent — check the output PNG dimensions). For spritesheets, infer frameWidth = imageWidth / frameCount and load with this.load.spritesheet(). The .meta.json file written next to each output records the requested width/height so frame count is recoverable.
Every call costs real money from the user's balance. Apply these defaults to avoid waste:
--check-cost first when generating at unfamiliar sizes or with RD_PRO.--seed when iterating on a prompt — same seed + same prompt = same image, so you can A/B test prompt edits without re-rolling random variations.public/assets/sprites/. Never regenerate an asset that already exists unless the user asked for a new variant.--mode balance before a big batch so the user sees their remaining credits.public/assets/sprites/
slime.png # generated image
slime.meta.json # prompt, model, style, cost, balance, timestamps
knight-walk.png # animation spritesheet or GIF
knight-walk.meta.json
public/assets/tiles/
grass.png # tiling texture
grass.meta.json
Always write a .meta.json next to each PNG so the prompt and seed are recoverable for later regeneration.
| Problem | Cause | Fix |
|---|---|---|
RETRODIFFUSION_API_KEY not set | Key missing | Ask the user for their key (https://www.retrodiffusion.ai → Account → API). Save to .env. |
| HTTP 401 Unauthorized | Wrong header or invalid key | Header must be X-RD-Token: <key>, NOT Authorization: Bearer. Verify the key on the dashboard. |
| HTTP 400 "insufficient credits" | Account balance is empty | Tell the user to top up at the dashboard before retrying. Run --mode balance to confirm. |
| Sprite looks blurry in Phaser | Browser is smooth-scaling the PNG | Set pixelArt: true and roundPixels: true in the Phaser config. |
| Output ignores prompt details | Prompt is being auto-expanded into something different | Try --bypass-prompt-expansion to send the prompt verbatim. |
| Tileset edges don't match | Style isn't a wang/tile style | Use --style wang-tile for auto-tiling sets, or --tile-x --tile-y for seamless single textures. |
| img2img output ignores reference | Strength too high | Lower --strength to 0.4–0.6. Strength 0 keeps the input; strength 1 ignores it. |
| Inconsistent style across batch | Different seeds and slight prompt variation | Pin --seed and reuse the exact same prompt structure for sibling sprites (same character family). |
RETRODIFFUSION_API_KEY checked in .env or env, prompted if missing--check-cost used for the first call at any new size--seed pinned when generating siblings (e.g., walk + idle of the same character)--remove-bg used for game sprites (transparent PNG)--tile-x/--tile-y used for textures, --style wang-tile for auto-tilingpublic/assets/sprites/ (or tiles/) with .meta.json alongsidepixelArt: true and roundPixels: trueframeWidth/frameHeight matches the requested width/heightWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub playableintelligence/game-creator --plugin game-creator31 skills in this plugin
/add-3d-assetsReplace primitive 3D shapes with real GLB models — animated characters, world props, buildings, and scenery for Three.js games. Use when the user says "add 3D models", "replace the boxes with real models", "add GLB assets", or "make the 3D game look real". For 2D pixel art, use add-assets instead. Do NOT use for 2D pixel art (use add-assets) or gameplay changes (use add-feature)./add-assetsReplace geometric shapes with pixel art sprites — recognizable characters, enemies, and items with optional animation. Use when the user says "add sprites", "replace the shapes with real art", "add pixel art", "make the characters look real", or "add game assets". For 3D games, use add-3d-assets instead. Do NOT use for 3D models (use add-3d-assets) or gameplay changes (use add-feature)./add-audioAdd music and sound effects to a game using the Web Audio API — background music, gameplay themes, and SFX. Zero dependencies. Use when the user says "add music", "add sound effects", "add audio", "make it sound good", "add BGM", or "add SFX to my game". Do NOT use for gameplay features or visual design./add-featureAdd a new gameplay feature to an existing browser game following its architecture patterns. Use when the user says "add a feature", "add double-jump", "add a power-up", "add a leaderboard", or describes a specific game mechanic to implement. Do NOT use for visual-only changes (use design-game) or replacing shapes with sprites (use add-assets)./add-multiplayerAdd real-time or turn-based multiplayer to an existing browser game using PartyKit (Cloudflare Durable Objects). Scaffolds a room-based server, a NetworkManager client, EventBus events, GameState fields, Constants, and extends render_game_to_text(). Use when the user says "add multiplayer", "make this multiplayer", "add real-time co-op", "add online play", "scaffold multiplayer", or "add netcode". Do NOT use for solo leaderboards (use monetize-game), single-player AI opponents (use add-feature), or peer-to-peer/WebRTC games./design-gameAudit and improve the visual design, polish, and player experience of an existing game. Use when the user says "make my game look better", "improve the design", "add polish", "add juice", "add particles", "fix the UI", or "make it more visually appealing". Do NOT use for gameplay logic changes (use add-feature instead).Other plugins' skills for the same job