跳到正文
Skillpedia
通用编程33k · #8690

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/creative-design/game-development/2d-games/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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.

repo: davila7/claude-code-templates

热度

GitHub 星标
33k
排名
#8690
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能