⚡ PromptLoot

Home › Gaming

2D Game Asset Rules for AI Agents: Sprites & Colliders

An ASSETS.md for Claude Code, Cursor, or Codex in Godot, Unity, Phaser, or Canvas: sprite sheet layout, naming, pixel-art import, animations, and colliders.

Added

Save as ASSETS.md in your game repo and reference it from AGENTS.md or CLAUDE.md ("Before touching art, sprites, animations, or colliders, read ASSETS.md"). Edit every [BRACKETED] part.

# ASSETS.md: 2D asset rules for [GAME]
Engine: [Godot 4 / Unity 6 (2D) / Phaser 3 / plain HTML Canvas] · Style: [pixel art / hi-res hand-drawn]
Base unit: [16] px per tile · Unity Pixels Per Unit: [16] · Base resolution: [320x180], integer scaling

## 1. Folders and names
- Exported art: assets/sprites/[category]/[name]_[action]_[direction].png (player_run_right.png, slime_idle.png)
- Sheets: [name]_sheet_[frameW]x[frameH].png (player_sheet_32x32.png)
- lowercase_snake_case, no spaces, no "final2". Source files (.aseprite, .psd, .kra) live in art-src/; re-export instead of editing an exported PNG.
- Never rename or move existing assets without asking: scenes and prefabs reference them by path or ID. In Unity, move the .meta file with the asset; in Godot, move files inside the editor so references update.

## 2. Sprite sheets
- Grid layout: every frame the same size ([32x32]); one animation per row, frames left to right; no padding (tile atlases: [1 px extrude] to stop bleeding).
- Same pivot in every frame: bottom-center (feet) for characters, center for projectiles and pickups. A drifting pivot makes sprites jitter.
- Transparent PNG background. No baked drop shadows unless the art style uses them.
- Describe each sheet in a sidecar file the code reads, no magic numbers: [name]_sheet.json with frame size, pivot, and per animation: row, frames, fps, loop, hitFrame.

## 3. Import settings
Pixel art:
- Godot 4: Default Texture Filter = Nearest (Project Settings > Rendering > Textures), no mipmaps, Lossless compression; Window Stretch mode viewport, scale mode integer.
- Unity: Texture Type Sprite (2D and UI), Sprite Mode Multiple for sheets, Pixels Per Unit [16], Filter Mode Point (no filter), Compression None, mipmaps off; slice in the Sprite Editor by cell size; use a Pixel Perfect Camera.
- Phaser 3: pixelArt: true in the game config; load sheets with this.load.spritesheet(key, url, { frameWidth, frameHeight }).
- Canvas: ctx.imageSmoothingEnabled = false; draw at whole-pixel positions and whole-number scale.
Hi-res art: linear filtering, mipmaps on if it is scaled down, pack into atlases.

## 4. Animations
- Names: idle, run, jump, fall, attack, hurt, die (prefix with the entity in shared atlases: slime_hurt).
- FPS and looping come from the sidecar: [idle 6 fps loop, run 10 fps loop, attack 12 fps once].
- Gameplay timing (active frames, cancel windows) comes from the mechanic spec. Mark the hit frame in the sidecar; never change animation length to make code work without asking.

## 5. Colliders and hitboxes
- Simple shapes only for moving things (rectangle, capsule, circle), smaller than the drawn sprite: body about [70]% of the visible width, from the feet up. No pixel-perfect polygons on characters.
- Separate hurtbox (can be hit) and hitbox (attack area). Hitboxes are enabled only on active frames.
- Collision layers (do not invent new ones; add rows here and tell me):
  1 world · 2 player · 3 enemies · 4 player_attacks · 5 enemy_attacks · 6 pickups
  [Write who detects whom, e.g. player_attacks hits enemies only]
- Tiles: solid tiles get full-tile collision; one-way platforms marked [one_way]; slopes only where listed.
- Keep a debug toggle on [F1] that draws colliders, hitboxes, and pivots.

## 6. Missing art and licenses
- If art doesn't exist, make a labeled placeholder (solid color, right size and pivot, name written on it) named [name]_placeholder.png and add it to ASSETS_TODO.md. Never silently reuse another entity's sprite.
- Never download art or generate copyrighted characters. Every third-party file gets a line in assets/LICENSES.md: file, source URL, author, license.

## 7. Before you finish
List every asset added or changed with its import settings, then confirm: pixel art is crisp (nearest/point filter), pivots match across frames, colliders look right in the debug view, no missing-texture sprites, and every changed scene or prefab opens without broken references.

---
EXAMPLE (filled in): Godot 4 pixel platformer, 16 px tiles
player_sheet_32x32.png + player_sheet.json: row 0 idle (4 frames, 6 fps, loop), row 1 run (6, 10 fps, loop), row 2 jump (2, once), row 3 attack (5, 12 fps, once, hitFrame 2). Pivot bottom-center (16, 32).
Body: CapsuleShape2D radius 5, height 26, bottom at the feet, layer 2. Hurtbox: Area2D 12x24, layer 2. Sword hitbox: Area2D 14x10 on layer 4, mask 3, enabled on frames 2 to 3 only.
Project: Default Texture Filter Nearest, base 320x180, stretch mode viewport, scale mode integer, camera zoom 1.

How to use it

  1. Click Copy template.
  2. Paste into ChatGPT, Claude, Grok, Cursor, or your agent framework.
  3. Replace the [BRACKETED] parts with your details.
Sponsor this page · Reach builders who use AI daily. Get details

FAQ

Why do AI agents get sprites and colliders wrong?

Agents can't see your art the way you do, so they guess frame sizes, pivots, and collider shapes, and default to smooth filtering that blurs pixel art. Writing the sheet layout, pivots, import settings, and collision layers in an ASSETS.md gives the agent exact numbers instead of guesses.

How do I stop pixel art looking blurry in Godot, Unity, or Phaser?

Turn off texture filtering. In Godot 4 set the default texture filter to Nearest, in Unity set Filter Mode to Point (no filter) with compression off, in Phaser set pixelArt: true, and on a canvas set imageSmoothingEnabled to false. Also scale by whole numbers so pixels stay square.

How big should a character's collider be compared to the sprite?

Usually smaller than the drawing: around 60 to 80 percent of the visible width, anchored at the feet, using a capsule or rectangle. Slightly forgiving colliders feel fairer to players than pixel-perfect ones and avoid snagging on tile edges.

Can the AI make the sprites too?

It can make labeled placeholder art and wire up animations from a sheet you provide. For final art, use your own drawings or properly licensed packs, and log each third-party file's source and license in LICENSES.md so you can ship the game safely.

Get 3 new templates every week

Free. Unsubscribe anytime.

Related templates

Game Mechanic Spec: Decide the Details Before AI Codes It

Turn one game feature, like throwing a rock, into a spec of controls, timing, physics, and feedback, so your AI agent builds the game feel you imagined.

One-Prompt Browser Game Builder

Vibe code a complete, playable HTML5 game from a single prompt: one file, no build step, runs in any browser.

Inspired-By Game Rules: Copy the Mechanics, Not the Names or Art

A rules block for Claude Code, Codex, or Cursor that lets you build a game inspired by a classic: it recreates the mechanics and feel with your own names, art, levels, and sound.

One-Page Game Design Doc Prompt

Turn a game idea into a tight one-page design doc.

Browse all Gaming templates

New on PromptLoot

Check Current Docs First: Stop Agents Using Outdated APIs

Rules that make Claude Code, Cursor, and Codex check your installed versions and current docs before calling any API, cite the version, and flag deprecations.

Minimal Diff Rules: Stop AI Agents Rewriting Unrelated Code

Rules for Claude Code, Cursor, and Codex: change only what you asked, no drive-by renames, refactors, or reformatting, and list every changed file.
PromptLoot Pro Pack · 200+ advanced templates, agent workflows, and Cursor rules bundles. Coming soon