2d-games
它能做什么
这个技能为你的 AI 智能体提供制作 2D 游戏的核心原则,例如动画、关卡布局、碰撞和摄像机行为。适合正在制作横版卷轴或其他 2D 游戏的人。
适用场景
- ✓当你让智能体为 2D 角色设计精灵动画时。
- ✓当你正在用瓦片搭建关卡,需要图层方面的建议时。
- ✓当你需要设置碰撞或跟随玩家的摄像机时。
技能链接
https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/creative-design/game-development/2d-games/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我在我的 2D 平台游戏中设置一个跟随玩家的摄像机。”
每周 5 个新技能,1 分钟读完。
工作原理
该技能为 2D 游戏的每个部分提供指导原则。智能体在编写或审查游戏代码时,会据此做出实际的选择。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
2D Game Development
Principles for 2D game systems.
1. Sprite Systems
Sprite Organization
| Component | Purpose |
|---|---|
| Atlas | Combine textures, reduce draw calls |
| Animation | Frame sequences |
| Pivot | Rotation/scale origin |
| Layering | Z-order control |
Animation Principles
- Frame rate: 8-24 FPS typical
- Squash and stretch for impact
- Anticipation before action
- Follow-through after action
2. Tilemap Design
Tile Considerations
| Factor | Recommendation |
|---|---|
| Size | 16x16, 32x32, 64x64 |
| Auto-tiling | Use for terrain |
| Collision | Simplified shapes |
Layers
| Layer | Content |
|---|---|
| Background | Non-interactive scenery |
| Terrain | Walkable ground |
| Props | Interactive objects |
| Foreground | Parallax overlay |
3. 2D Physics
Collision Shapes
| Shape | Use Case |
|---|---|
| Box | Rectangular objects |
| Circle | Balls, rounded |
| Capsule | Characters |
| Polygon | Complex shapes |
Physics Considerations
- Pixel-perfect vs physics-based
- Fixed timestep for consistency
- Layers for filtering
4. Camera Systems
Camera Types
| Type | Use |
|---|---|
| Follow | Track player |
| Look-ahead | Anticipate movement |
| Multi-target | Two-player |
| Room-based | Metroidvania |
Screen Shake
- Short duration (50-200ms)
- Diminishing intensity
- Use sparingly
5. Genre Patterns
Platformer
- Coyote time (leniency after edge)
- Jump buffering
- Variable jump height
Top-down
- 8-directional or free movement
- Aim-based or auto-aim
- Consider rotation or not
6. Anti-Patterns
| ❌ Don't | ✅ Do |
|---|---|
| Separate textures | Use atlases |
| Complex collision shapes | Simplified collision |
| Jittery camera | Smooth following |
| Pixel-perfect on physics | Choose one approach |
Remember: 2D is about clarity. Every pixel should communicate.
常见问题
这个技能会替我写完整个游戏吗?
不会。它提供的是原则指导,具体为你的项目编写代码的仍然是智能体。
它使用哪种游戏引擎?
该技能侧重于通用的 2D 原则,所以请告诉智能体你使用哪种引擎或工具。
它对动画有什么说明?
它涵盖帧率、挤压与拉伸,以及预备动作与跟随动作,使动作更流畅。
详情
作者的原始描述
2D game development principles. Sprites, tilemaps, physics, camera.
热度
- GitHub 星标
- 33k
- 排名
- #8690
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
owasp-security
33k教你的智能体掌握面向网页应用、API、移动端、容器和 AI 智能体的 OWASP 安全指南,以便发现常见弱点并提出修复建议。
agent-management
33k让你的智能体使用 AI Maestro 命令行工具创建、列出、休眠、唤醒、重命名和删除 AI 智能体,管理每个智能体的生命周期。
agent-messaging
33k让你的智能体使用智能体消息协议,在 AI 智能体之间发送、接收和回复带签名的消息,大部分在你自己的电脑上完成。
docs-search
33k让你的智能体搜索自动生成的代码文档,查找函数签名、类定义和注释,从而在修改代码之前核对真实的 API。