跳过主要内容
WEB
Skill免费GameSkill 出品GameSkill 原创

Code Sprites 16 (pixel sprites drawn in code, locked palette)

/code-sprites-16

A GameSkill original for browser games whose sprites are written in code: text rows of palette indices over a locked 16-colour palette, no image files. A dependency-free sprites.js validates, bakes and draws them crisp by origin; a Node checker fails ragged rows, illegal characters, empty or resized frames, extra colours and wrong sizes and writes a PNG contact sheet. Ships Seed Courier, an original 16-colour platformer tested in headless Chrome so every pixel on screen is a palette colour.

许可证
MIT
出品
GameSkill 出品
下载 ZIP

我们测过

在 Canvas 2D in headless Chrome + Node 22 上通过 30/30 项检查(2026-11-09):能触发、有可运行示例、有截图和自检清单、单一职责、中英文文档齐全。触发检查是把提示词和 skill 描述做匹配,不是真实 agent 运行。

测试报告

GameSkill 测过的版本

GameSkill 为 gameskill.dev 原创编写并测过。ZIP 里是完整的 skill:SKILL.md 及中文版、脚本、可运行示例、测试、自检清单和我们的测试报告。

下载测过的 ZIP(33 KB)路线图:美术资产

GameSkill 原创,协议 MIT。ZIP 保留 LICENSE 和 CREDITS.md,里面列出了流程灵感来源、CC0 测试素材和第三方库及其协议。

Code Sprites 16 (pixel sprites drawn in code, locked palette)

自检清单

  • sprite_check 全部 PASS,并看过总览图 / sprite_check passes and the contact sheet was looked at
  • 画面上每个像素都是调色板颜色 / Every pixel on screen is a palette colour
  • 整数倍缩放、关闭平滑 / Whole-number scaling with smoothing off

中文指南

这个 skill 做什么

GameSkill 原创(MIT)。网页小游戏的所有精灵都写在代码里:每行是一串调色板索引,调色板锁定 16 色,不需要任何图片文件。无依赖的 sprites.js 负责校验、烘焙(整数倍缩放并带镜像)和按原点清晰绘制;Node 检查工具会报出长短不齐的行、非法字符、空帧或尺寸不同的帧、多余颜色和尺寸错误,并导出 PNG 总览图。

什么时候用

  • agent 做像素风网页小游戏,没有美术流程
  • 代码画的精灵行不齐、放大发糊、颜色跑出调色板
  • 要求所有素材都写在源码里的 Game Jam

怎么装

下载本页的 ZIP,把 code-sprites-16/ 文件夹放进 .claude/skills/(Claude Code)或 .agents/skills/(Codex、Cursor),重启 agent。检查工具需要 Node 22;自测需要 Chrome。

最小示例

  1. node tools/sprite_check.mjs example/seed-courier/sprites.data.js --sheet out/sheet.png --scale 6
  2. 在 code-sprites-16/ 目录起一个静态服务器,打开 example/seed-courier/index.html。

我们怎么测的

示例是我们原创的平台跳跃游戏 Seed Courier:甲虫信使收集种子送回洞穴,躲开黄蜂。test/run_tests.mjs 共 18 项检查:检查工具通过示例数据,并且对故意写坏的数据正好报出 5 个错误;总览图是整数倍;库在 Node 中可用;在无界面 Chrome 里,整个 320x180 画面(含 HUD 和 game over 文字)只用调色板颜色,奔跑速度、跳跃高度、拾取与存放种子、被黄蜂击中三次结束、回车重开都正确,没有控制台错误。截图是放大 3 倍的游戏画面。

致谢

"纯代码画 16 色精灵的网页游戏"这个思路来自 X 上 @0xShoopy 的帖子(只放链接,没有使用任何代码或文字)。调色板是 GrafxKid 的 Sweetie 16。代码、游戏和文字都是我们自己的。

搭配

  • pixel-diorama-game:等距像素小场景游戏
  • style-cards:固定调色板的风格卡
  • browser-game-input-check:网页游戏键盘输入自检

安装

告诉你的 AI

Install the skill from https://gameskill.dev/skills/code-sprites-16/install.md

GameSkill 测过的版本

测过的版本装到 .claude/skills/
mkdir -p .claude/skills
curl -fsSL https://gameskill.dev/dl/skills/code-sprites-16.zip -o /tmp/gameskill-code-sprites-16.zip
unzip -oq /tmp/gameskill-code-sprites-16.zip -d .claude/skills
rm /tmp/gameskill-code-sprites-16.zip

包含内容

  • sprites.js: validate, bake (integer scale, mirrored copies), draw by origin, frame timing, toRGBA for Node
  • tools/sprite_check.mjs: data checks with fixes, colour budget, size checks and a PNG contact sheet
  • Seed Courier: an original platformer with 10 code-drawn sprites, a 3x5 pixel font and a test hook
  • 18 checks in test/run_tests.mjs, including a palette-only screen test in headless Chrome

适合

  • Small pixel-art browser games made by an agent without an art pipeline
  • Code-drawn sprites that come out ragged, blurry or off-palette
  • Game jams where every asset must live in the source

不适合

  • Cleaning up AI-generated pixel images: use pixel-snap-cleanup
  • Turning 3D scenes into pixel art: use pixel-render-3d
  • Large sprite sheets drawn in an editor

试试这条提示词

提示词
Make an original 16-colour pixel platformer for the browser with every sprite drawn in code, check the sprite data, and test that only palette colours reach the screen.

关于这个 Skill

A GameSkill original. Agents can draw pixel art as text, and it goes wrong in predictable ways: a row one character short, a colour outside the palette, a frame of a different size, smoothing that blurs it, fillText that adds dozens of off-palette shades. This skill keeps sprites as data over a locked palette of up to 16 colours, checks the data with tools/sprite_check.mjs before the game runs (with a PNG contact sheet to look at), and draws it through sprites.js the one way that stays crisp: baked once, whole-number scale, drawn by origin at whole pixels.

Agent steps

  1. Fix the palette first and draw every sprite as rows of palette indices.
  2. Check the data with sprite_check and look at the contact sheet.
  3. Draw through the sprite set, with a pixel font for text, and test that every pixel on screen is a palette colour.

Common problems it solves

  • Ragged rows, wrong-size frames and illegal characters in hand-written sprites.
  • Blurry scaling and half-pixel positions.
  • Anti-aliased canvas text that breaks the palette.

Credits

The idea of a pure-code 16-colour sprite browser game comes from a post by @0xShoopy (link only; no code or text was used). The palette is Sweetie 16 by GrafxKid. Seed Courier, the code and the text are ours.

环境要求

  • Any browser for the game; sprites.js has no dependencies
  • Node 22+ for tools/sprite_check.mjs (standard library only)
  • Chrome or Chromium for the self-test

相关主题

常见问题

同赛道 PRO 商业源码$49/yr

AI 2D 美术与序列帧管线 Sprite Asset Pipeline

把 AI 生成的原始视频直接变成商业级透明 2D 游戏序列帧:绿幕/溢色消除命令、0px 脚底锚点锁死排版、动作非线性重定时(4.33s → ~1.88s 含打击顿帧)与 Phaser / Godot 4 图集一键导出。

基于 Pure-code 16-colour sprite browser game (post, idea only) (作者 @0xShoopy,no licence, idea only, no code or text used)的思路。代码和文字由 GameSkill 编写,ZIP 里的 CREDITS.md 列出所有来源。

搭配使用

作者标注的相关 Skills,或更适合相邻任务的 Skills。

Pixel Diorama Game
WEB
Skill
GameSkill 出品

Pixel Diorama Game (tiny isometric pixel games with seamless ambience)

A GameSkill original for making a small browser game as an isometric pixel diorama: one place floating on white, a fixed 30-degree camera, a 360x280 canvas scaled by whole pixels, hue-shifted shading, long hard shadows and one physical action, plus rain, ripples, smoke, embers and lamp flicker drawn by code in loops that wrap without a seam. Ships the Pixel Plays renderer (MIT), our ambience kit and a tested example game.

Web (Phaser / Three.js)Engine-agnosticClaude Code · Codex +2
Pixel Snap Cleanup
GDT
Skill
GameSkill 出品

Pixel Snap Cleanup (AI fake pixels to true pixel art)

A GameSkill original that turns AI "fake pixel" art into true pixel art at the grid you choose: snap to a real grid with the bundled Pixel Snapper (MIT), force 0/255 alpha and a fixed palette, hit the exact size, then check it is CLEAN and imports crisp into Godot 4. Works on single sprites and on animation frames, which share one grid.

GodotWeb (Phaser / Three.js)Engine-agnosticClaude Code · Codex +2
Style Cards
B3D
Skill
GameSkill 出品

Style Cards (one art style as hard limits, switch looks by switching cards)

A GameSkill original that writes a game's art style down as a card of measurable limits (canvas, colours and palette, alpha, triangles, shading, materials, textures, voxel grid), pastes it into every asset request and checks every asset against it. Ships 16 cards from pixel (including fixed PICO-8, CGA, four-greens LCD and Endesga 32 palettes) and one-bit to low-poly, voxel and toon, a no-dependency PNG checker, a Blender GLB checker and a palette locker; switch the whole look by switching the card.

Engine-agnosticBlenderGodotClaude Code · Codex +2

相似 skills