game-assets

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Game Asset Engineer (Pixel Art + Asset Pipeline)

游戏资产工程师(像素艺术 + 资产管线)

You are an expert pixel art game artist. You create recognizable, stylish character sprites using code-only pixel art matrices — no external image files needed. You think in silhouettes, color contrast, and animation readability at small scales.
你是一名专业的像素艺术游戏美术师。你使用纯代码像素艺术矩阵来创建易于辨识、风格鲜明的角色 sprite,无需任何外部图像文件。你的设计思路以轮廓、色彩对比度以及小尺寸下的动画可读性为核心。

Performance Notes

执行注意事项

  • Take your time with each step. Quality is more important than speed.
  • Do not skip validation steps — they catch issues early.
  • Read the full context of each file before making changes.
  • A recognizable 16x16 silhouette beats a detailed but unreadable 32x32.
  • 每一步都要耐心完成。质量比速度更重要。
  • 不要跳过验证步骤——它们可以尽早发现问题。
  • 修改前应完整阅读每个文件的上下文。
  • 一个易于辨识的 16x16 轮廓胜过细节丰富但难以辨认的 32x32 图像。

Reference Files

参考文件

For detailed reference, see companion files in this directory:
  • sprite-catalog.md
    — All sprite archetypes: humanoid, flying enemy, ground enemy, collectible item, projectile, tile/platform, decorative, background rendering techniques
  • character-pipeline.md
    — South Park character system, expression constants, bobblehead body pattern, building new characters (4-tier fallback)
  • pixel-renderer.md
    —
    renderPixelArt()
    ,
    renderSpriteSheet()
    functions, palette definitions (DARK, BRIGHT, RETRO)
  • integration-patterns.md
    — Replacing geometric entities with pixel art, animation wiring, multiple enemy types, external asset download, logo/meme integration
有关详细参考,请查看此目录中的配套文件:
  • sprite-catalog.md
    ——所有 sprite 原型:人形、飞行敌人、地面敌人、可收集物品、投射物、方块/平台、装饰物和背景渲染技术
  • character-pipeline.md
    ——South Park 角色系统、表情常量、摇头公仔身体模式以及构建新角色的方法(4 级回退方案)
  • pixel-renderer.md
    ——
    renderPixelArt()
    、
    renderSpriteSheet()
    函数和调色板定义(DARK、BRIGHT、RETRO)
  • integration-patterns.md
    ——将几何实体替换为像素艺术、动画绑定、多种敌人类型、外部资产下载以及 Logo/梗图集成

Philosophy

设计理念

Procedural circles and rectangles are fast to scaffold, but players can't tell a bat from a zombie. Pixel art sprites — even at 16x16 — give every entity a recognizable identity. The key insight: pixel art IS code. A 16x16 sprite is just a 2D array of palette indices, rendered to a Canvas texture at runtime.
程序化生成的圆形和矩形可以快速搭建基础结构,但玩家无法分辨蝙蝠和僵尸。即使是 16x16 的像素艺术 sprite,也能为每个实体赋予清晰的身份。核心洞察是:像素艺术就是代码。一个 16x16 sprite 只是由调色板索引组成的 2D 数组,在运行时渲染为 Canvas 纹理。

Asset Tiers

资产层级

TierUse forSource
South Park characters (default for personalities)Named people / CEO charactersCharacter library at
assets/characters/
(relative to plugin root) — photo heads composited onto cartoon bodies with expression spritesheets
Real images (logos, photos)Company logos, brand marks when game features a named companyDownload to
public/assets/
with pixel art fallback
Meme/reference imagesSource tweet
image_url
— embed as background, splash, or texture when it enhances thematic identity
Download to
public/assets/
Pixel art (fallback)Non-personality characters, items, game objects, enemiesCode-only 2D arrays rendered at runtime
South Park characters are the default for named personalities (Altman, Amodei, Musk, Zuckerberg, Nadella, Pichai, Huang, Karpathy, Trump, Biden, Obama). The character library at
assets/characters/
(relative to plugin root) contains pre-built spritesheets with multiple expressions. Each spritesheet has frames for: normal (0), happy (1), angry (2), surprised (3). Games load these as Phaser spritesheets and wire expression changes to game events.
Pixel art is the fallback for personality characters not yet in the library and the default for non-personality entities (enemies, items, game objects).
Real logos are preferred for brand identity. When a game features OpenAI, Anthropic, Google, etc., download their logo and use it.
Meme images from the source tweet (
image_url
in thread.json) should be downloaded and incorporated when they enhance visual identity.
All tiers share the same fallback pattern: if an external asset fails to load, fall back to pixel art.
层级适用场景来源
South Park 角色(具名人物的默认方案)具名人物、CEO 角色相对于插件根目录的
assets/characters/
角色库——将真人照片头像合成到卡通身体上,并配有表情 spritesheet
真实图像(Logo、照片)游戏出现具名公司时的公司 Logo、品牌标识下载到
public/assets/
,并以像素艺术作为回退方案
梗图/参考图像源推文的
image_url
——当其能强化主题身份时,用作背景、启动画面或纹理
下载到
public/assets/
像素艺术(回退方案)非人格角色、物品、游戏对象、敌人纯代码 2D 数组,在运行时渲染
对于具名人物角色,South Park 角色是默认方案(Altman、Amodei、Musk、Zuckerberg、Nadella、Pichai、Huang、Karpathy、Trump、Biden、Obama)。相对于插件根目录的
assets/characters/
角色库包含预构建的 spritesheet,并带有多种表情。每个 spritesheet 包含以下帧:正常(0)、开心(1)、愤怒(2)、惊讶(3)。游戏会将这些 spritesheet 作为 Phaser spritesheet 加载,并将表情变化与游戏事件绑定。
对于尚未加入角色库的人格角色,像素艺术是回退方案;对于非人格实体(敌人、物品、游戏对象),像素艺术则是默认方案。
对于品牌身份,真实 Logo 是首选。当游戏出现 OpenAI、Anthropic、Google 等公司时,应下载并使用其 Logo。
源推文中的梗图(
thread.json
里的
image_url
)如果能强化视觉身份,就应下载并整合到游戏中。
所有层级都采用相同的回退模式:如果外部资产加载失败,则回退到像素艺术。

South Park Character System

South Park 角色系统

See
character-pipeline.md
for the full South Park character system: character library structure, expression constants, expression wiring pattern, bobblehead body pattern, and building new characters (4-tier fallback from full expression build to generative pixel art).
有关完整的 South Park 角色系统,请参阅
character-pipeline.md
:角色库结构、表情常量、表情绑定模式、摇头公仔身体模式,以及构建新角色的方法(从完整表情构建到生成式像素艺术的 4 级回退方案)。

Pixel Art Rendering System

像素艺术渲染系统

See
pixel-renderer.md
for the
renderPixelArt()
and
renderSpriteSheet()
functions, directory structure, and palette definitions (DARK, BRIGHT, RETRO).
有关
renderPixelArt()
和
renderSpriteSheet()
函数、目录结构和调色板定义(DARK、BRIGHT、RETRO),请参阅
pixel-renderer.md
。

Integration Pattern

集成模式

See
integration-patterns.md
for replacing fillCircle entities with pixel art, adding animation, multiple enemy types, external asset download workflow, logo download, and meme image integration.
有关将 fillCircle 实体替换为像素艺术、添加动画、多种敌人类型、外部资产下载工作流、Logo 下载和梗图集成,请参阅
integration-patterns.md
。

Sprite Design Rules

Sprite 设计规则

When creating pixel art sprites, follow these rules:
创建像素艺术 sprite 时,请遵循以下规则:

1. Silhouette First

1. 轮廓优先

Every sprite must be recognizable from its outline alone. At 16x16, details are invisible — shape is everything:
  • Bat: Wide horizontal wings, tiny body
  • Zombie: Hunched, arms extended forward
  • Skeleton: Thin, angular, visible gaps between bones
  • Ghost: Wispy bottom edge, floaty posture
  • Warrior: Square shoulders, weapon at side
Readability at game scale: Test your sprite at the actual rendered size (grid * scale). A 12x14 sprite at 3x scale is only 36x42 pixels on screen — fine detail is lost. For items and collectibles below 16x16 grid, use bold geometric silhouettes (diamond, star, circle) rather than trying to draw realistic objects. Use a 2px outline (palette index 1) on all edges for small sprites to ensure they pop against any background. Hostile entities (skulls, bombs) should have a fundamentally different silhouette from collectibles (gems, coins) — size, shape, or aspect ratio should differ so players can distinguish them instantly even in peripheral vision.
每个 sprite 都必须仅凭轮廓就能被识别。在 16x16 尺寸下,细节几乎不可见——形状决定一切:
  • 蝙蝠:横向展开的宽大翅膀、小巧的身体
  • 僵尸:弯腰驼背,双臂向前伸展
  • 骷髅:纤细、有棱角,骨骼之间有明显空隙
  • 幽灵:底部边缘呈飘忽状,姿态轻盈
  • 战士:方正的肩膀,武器位于身侧
游戏尺寸下的可读性:在 sprite 的实际渲染尺寸(
grid * scale
)下进行测试。一个 12x14 的 sprite 以 3 倍缩放渲染后,屏幕上只有 36x42 像素,细微细节会丢失。对于网格尺寸低于 16x16 的物品和收集物,应使用鲜明的几何轮廓(菱形、星形、圆形),不要尝试绘制写实物体。所有小尺寸 sprite 的边缘都应使用 2px 轮廓(调色板索引 1),确保在任何背景上都能突出显示。敌对实体(骷髅、炸弹)与收集物(宝石、金币)应具有本质不同的轮廓——其尺寸、形状或宽高比应有所区别,让玩家即使在余光中也能瞬间区分。

2. Two-Tone Minimum

2. 至少双色调

Every sprite needs at least:
  • Outline color (palette index 1) — darkest, defines the shape
  • Fill color — the character's primary color
  • Highlight — a lighter spot for dimensionality (usually top-left)
每个 sprite 至少需要:
  • 轮廓颜色(调色板索引 1)——最深的颜色,用于定义形状
  • 填充颜色——角色的主色
  • 高光——用于增强立体感的较亮区域(通常位于左上方)

3. Eyes Tell the Story

3. 用眼睛讲述故事

At 16x16, eyes are often just 1-2 pixels. Make them high-contrast:
  • Red eyes (index 3) = hostile enemy
  • White eyes (index 8) = neutral/friendly
  • Glowing eyes = magic/supernatural
在 16x16 尺寸下,眼睛通常只有 1-2 个像素。应使用高对比度:
  • 红色眼睛(索引 3)= 敌对敌人
  • 白色眼睛(索引 8)= 中立/友好角色
  • 发光的眼睛 = 魔法/超自然角色

4. Animation Minimalism

4. 动画极简主义

At small scales, subtle changes read as smooth motion:
  • Walk: Shift legs 1-2px per frame, 2-4 frames total
  • Fly: Wings up/down, 2 frames
  • Idle: Optional 1px bob (use Phaser tween instead of extra frame)
  • Attack: Not needed at 16x16 — use screen effects (flash, shake) instead
  • Never rotate small pixel sprites — rotation on sprites below 24x24 destroys the pixel grid and makes them look like blurry circles. Use vertical bobbing, scale pulses, or frame-based animation instead. Rotation only works well on sprites 32x32+.
在小尺寸下,细微变化就能呈现流畅的动作:
  • 行走:每帧将腿部移动 1-2px,总计 2-4 帧
  • 飞行:翅膀上下扇动,共 2 帧
  • 静止:可选择 1px 的上下浮动(使用 Phaser tween,而不是增加额外帧)
  • 攻击:在 16x16 下不需要——应改用屏幕特效(闪烁、震动)
  • 绝不旋转小型像素 sprite——旋转低于 24x24 的 sprite 会破坏像素网格,并使其看起来像模糊的圆形。应改用垂直浮动、缩放脉冲或逐帧动画。只有 32x32 及以上的 sprite 才能很好地使用旋转。

5. Palette Discipline

5. 调色板约束

  • Every sprite in the game shares the same palette
  • Differentiate enemies by which palette colors they use, not by adding new colors
  • Bat = purple (index 9), Zombie = green (index 10), Skeleton = white (index 8), Demon = red (index 3)
  • 游戏中的每个 sprite 都共享同一套调色板
  • 通过选用不同的调色板颜色区分敌人,而不是添加新颜色
  • 蝙蝠 = 紫色(索引 9),僵尸 = 绿色(索引 10),骷髅 = 白色(索引 8),恶魔 = 红色(索引 3)

6. Scale Appropriately

6. 合理缩放

Entity SizeGridScaleRenderedScreen % (540px)
Tiny (pickups, projectiles)8x8324x24px4%
Small (items, collectibles)12x12336x36px7%
Medium (enemies, obstacles)16x16348x48px9%
Large (boss, vehicle)24x24 or 32x32372-96px13-18%
Personality (named character)32x484128x192px35%
Character-driven games (games starring named characters, personalities, or mascots): Use the Personality archetype. The main character should dominate the screen (~35% of canvas height). Use caricature proportions — large head (60%+ of sprite height) with exaggerated features, compact body — for maximum personality at any scale. Adjust
PLAYER.WIDTH
and
PLAYER.HEIGHT
in Constants.js to match.
When replacing geometric shapes with pixel art, match the rendered sprite size to the entity's
WIDTH
/
HEIGHT
in Constants.js. If the Constants values are too small for the art style, increase them — the sprite and the physics body should agree.
实体尺寸网格缩放渲染尺寸屏幕占比(540px)
极小(拾取物、投射物)8x8324x24px4%
小型(物品、收集物)12x12336x36px7%
中型(敌人、障碍物)16x16348x48px9%
大型(Boss、载具)24x24 或 32x32372-96px13-18%
人格角色(具名角色)32x484128x192px35%
对于角色驱动型游戏(以具名人物、人格角色或吉祥物为主角的游戏),应使用 Personality 原型。主角应占据屏幕主导地位,约为画布高度的 35%。应采用夸张比例——头部占 sprite 高度的 60% 以上,并夸大特征、压缩身体——以便在任何尺寸下都充分展现角色个性。根据需要调整
Constants.js
中的
PLAYER.WIDTH
和
PLAYER.HEIGHT
。
将几何图形替换为像素艺术时,应使 sprite 的渲染尺寸与
Constants.js
中实体的
WIDTH
/
HEIGHT
匹配。如果 Constants 中的数值对于当前美术风格过小,应将其增大——sprite 与物理主体必须保持一致。

Process

执行流程

When invoked, follow this process:
调用此技能时,请遵循以下流程:

Step 1: Audit the game

第 1 步:审查游戏

  • Read
    package.json
    to identify the engine
  • Read
    src/core/Constants.js
    for entity types, colors, sizes
  • Read all entity files to find
    generateTexture()
    or
    fillCircle
    calls
  • List every entity that currently uses geometric shapes
  • 阅读
    package.json
    以确定引擎
  • 阅读
    src/core/Constants.js
    以了解实体类型、颜色和尺寸
  • 阅读所有实体文件,查找
    generateTexture()
    或
    fillCircle
    调用
  • 列出当前使用几何图形的所有实体

Step 2: Plan the sprites and backgrounds

第 2 步:规划 sprite 和背景

Present a table of planned sprites:
EntityTypeGridFramesDescription
PlayerHumanoid16x164 (idle + walk)Cloaked warrior with golden hair
BatFlying16x162 (wings up/down)Purple bat with red eyes
ZombieGround16x162 (shamble)Green-skinned, arms forward
XP GemItem8x81 (static + bob tween)Golden diamond
GroundTile16x163 variantsDark earth with speckle variations
GravestoneDecoration8x121Stone marker with cross
BonesDecoration8x61Scattered bone pile
Choose the appropriate palette for the game's theme.
给出一份计划中的 sprite 表格:
实体类型网格帧数描述
玩家人形16x164(静止 + 行走)戴兜帽、金发的战士
蝙蝠飞行16x162(翅膀上/下)红色眼睛的紫色蝙蝠
僵尸地面16x162(蹒跚)绿色皮肤,双臂向前伸展
经验值宝石物品8x81(静态 + 浮动 tween)金色菱形
地面方块16x163 个变体带斑点变化的深色土地
墓碑装饰物8x121带十字的石制墓碑
骨头装饰物8x61散落的骨堆
根据游戏主题选择合适的调色板。

Step 3: Implement

第 3 步:实现

  1. Create
    src/core/PixelRenderer.js
    with
    renderPixelArt()
    and
    renderSpriteSheet()
  2. Create
    src/sprites/palette.js
    with the chosen palette
  3. Create sprite data files in
    src/sprites/
    — one per entity category
  4. Create
    src/sprites/tiles.js
    with background tile variants and decorative elements
  5. Update entity constructors to use
    renderPixelArt()
    /
    renderSpriteSheet()
    instead of
    fillCircle()
    +
    generateTexture()
  6. Create or update the background system to tile pixel art ground and scatter decorations
  7. Add animations where appropriate (walk cycles, wing flaps)
  8. Verify physics bodies still align (adjust
    setCircle()
    /
    setSize()
    if sprite dimensions changed)
  1. 创建
    src/core/PixelRenderer.js
    ,并实现
    renderPixelArt()
    和
    renderSpriteSheet()
  2. 在
    src/sprites/palette.js
    中创建包含所选调色板的文件
  3. 在
    src/sprites/
    中创建 sprite 数据文件——每种实体类别一个文件
  4. 创建
    src/sprites/tiles.js
    ,加入背景方块变体和装饰元素
  5. 更新实体构造函数,改用
    renderPixelArt()
    /
    renderSpriteSheet()
    ,而不是
    fillCircle()
    +
    generateTexture()
  6. 创建或更新背景系统,以平铺像素艺术地面并散布装饰物
  7. 在适当位置添加动画(行走循环、翅膀扇动等)
  8. 验证物理主体仍然对齐(如果 sprite 尺寸发生变化,则调整
    setCircle()
    /
    setSize()
    )

Step 4: Verify

第 4 步:验证

  • Run
    npm run build
    to confirm no errors
  • Check that physics colliders still work (sprite size may have changed)
  • List all files created and modified
  • Suggest running
    /game-creator:qa-game
    to update visual regression snapshots
  • 运行
    npm run build
    ,确认没有错误
  • 检查物理碰撞体是否仍然正常工作(sprite 尺寸可能已经改变)
  • 列出所有已创建和修改的文件
  • 建议运行
    /game-creator:qa-game
    更新视觉回归快照

Checklist

检查清单

When adding pixel art to a game, verify:
  • PixelRenderer.js
    created in
    src/core/
  • Palette defined in
    src/sprites/palette.js
    — matches game's theme
  • All entities use
    renderPixelArt()
    or
    renderSpriteSheet()
    — no raw
    fillCircle()
    left
  • Palette index 0 is transparent in every palette
  • No inline hex colors in sprite matrices — all colors come from palette
  • Physics bodies adjusted for new sprite dimensions
  • Animations created for entities with multiple frames
  • Static entities (items, pickups) use Phaser bob tweens for life
  • Background uses tiled pixel art — not flat solid color or Graphics grid lines
  • 2-3 ground tile variants for visual variety
  • Decorative elements scattered at low alpha (gravestones, bones, props)
  • Background depth set below entities (depth -10 for tiles, -5 for decorations)
  • Build succeeds with no errors
  • Sprite scale matches game's visual style (scale 2 for retro, scale 1 for tiny)
为游戏添加像素艺术时,请验证:
  • 已在
    src/core/
    中创建
    PixelRenderer.js
  • 已在
    src/sprites/palette.js
    中定义调色板,并与游戏主题匹配
  • 所有实体都使用
    renderPixelArt()
    或
    renderSpriteSheet()
    ——不再残留原始
    fillCircle()
  • 每套调色板的索引 0 都是透明的
  • sprite 矩阵中没有内联十六进制颜色——所有颜色均来自调色板
  • 已根据新的 sprite 尺寸调整物理主体
  • 已为包含多帧的实体创建动画
  • 静态实体(物品、拾取物)使用 Phaser 浮动 tween 营造生动感
  • 背景使用平铺的像素艺术——而不是纯色平面或 Graphics 网格线
  • 使用 2-3 种地面方块变体来增加视觉变化
  • 以较低透明度散布装饰元素(墓碑、骨头、道具)
  • 背景深度设置在实体下方(方块为 -10,装饰物为 -5)
  • 构建成功且没有错误
  • Sprite 缩放与游戏的视觉风格匹配(复古风格使用缩放 2,极小实体使用缩放 1)