2d Games

davila7/claude-code-templates/cli-tool/components/skills/creative-design/game-development/2d-games

作者 davila78da17d671b6f无许可证32K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库今天更新

2D game development principles. Sprites, tilemaps, physics, camera.

AI 生成的概览

关于 2D 游戏开发原则的参考指南,涵盖精灵、瓦片地图、物理、摄像机与类型模式。

功能
该技能提供一份 2D 游戏开发原则的参考文档。内容涵盖精灵组织与动画、瓦片尺寸、自动拼接与分层、2D 碰撞形状与物理考量、摄像机类型与屏幕震动,以及平台跳跃和俯视视角游戏的常见类型模式。它还列出了应避免的反模式。它只产出指导内容,不产出代码或素材。
适用场景
在规划或审查 2D 游戏系统时使用,例如决定精灵图集、瓦片地图分层、碰撞形状或摄像机行为。也适合用来检查平台跳跃或俯视视角设计中的常见陷阱。
运行要求
除智能体本身外无需任何工具、软件包或凭据;仅为说明文档,不附带脚本。

2D Game Development

Principles for 2D game systems.


1. Sprite Systems

Sprite Organization

ComponentPurpose
AtlasCombine textures, reduce draw calls
AnimationFrame sequences
PivotRotation/scale origin
LayeringZ-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

FactorRecommendation
Size16x16, 32x32, 64x64
Auto-tilingUse for terrain
CollisionSimplified shapes

Layers

LayerContent
BackgroundNon-interactive scenery
TerrainWalkable ground
PropsInteractive objects
ForegroundParallax overlay

3. 2D Physics

Collision Shapes

ShapeUse Case
BoxRectangular objects
CircleBalls, rounded
CapsuleCharacters
PolygonComplex shapes

Physics Considerations

  • Pixel-perfect vs physics-based
  • Fixed timestep for consistency
  • Layers for filtering

4. Camera Systems

Camera Types

TypeUse
FollowTrack player
Look-aheadAnticipate movement
Multi-targetTwo-player
Room-basedMetroidvania

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 texturesUse atlases
Complex collision shapesSimplified collision
Jittery cameraSmooth following
Pixel-perfect on physicsChoose one approach

Remember: 2D is about clarity. Every pixel should communicate.

来源与署名

来源:davila7/claude-code-templates位于cli-tool/components/skills/creative-design/game-development/2d-games提交8da17d6

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架