跳到主要内容
知仓学习社ZHICANG

2d-games

>-

不碰外部(只输出文字)无严重或高危命中sickn33/agentic-awesome-skills

它会碰到什么

扫了多少1 个文本文件,3 KB
它会碰到什么不碰外部(只输出文字)
命中总数0 处
命中统计严重 0 · 高 0 · 中 0 · 低 0

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

2D Game Development

> Principles for 2D game systems. Pair with game-development/web-games / game-development/engine-selection for framework choice.


Shell vs guest (web)

| Setup | 2D systems live… |

|-------|------------------|

| Full-screen 2D game | Entire app (Phaser/Kaplay/Pixi/Canvas) |

| Hybrid DOM + challenges | Only inside guest viewports; tear down when done |


1. Sprite Systems

| Component | Purpose |

|-----------|---------|

| Atlas | Combine textures, reduce draw calls |

| Animation | Frame sequences (often 8-24 FPS) |

| Pivot | Rotation/scale origin |

| Layering | Z-order control |

Animation Principles

  • Squash and stretch for impact
  • Anticipation before action
  • Follow-through after action

2. Tilemap Design

| Factor | Recommendation |

|--------|----------------|

| Size | 16x16, 32x32, 64x64 |

| Auto-tiling | Use for terrain |

| Collision | Simplified shapes |

| Layer | Content |

|-------|---------|

| Background | Non-interactive scenery |

| Terrain | Walkable ground |

| Props | Interactive objects |

| Foreground | Parallax overlay |


3. 2D Physics

| Shape | Use Case |

|-------|----------|

| Box | Rectangular objects |

| Circle | Balls, rounded |

| Capsule | Characters |

| Polygon | Complex shapes |

  • Pixel-perfect vs physics-based: pick one approach per game
  • Fixed timestep for consistency
  • Layers for filtering

4. Camera Systems

| Type | Use |

|------|-----|

| Follow | Track player |

| Look-ahead | Anticipate movement |

| Multi-target | Two-player |

| Room-based | Metroidvania |

| Static | Board games, modal skill-checks |

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
  • Decide whether rotation matters

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 |

| Orphaned RAF/listeners after a guest closes | Full teardown |


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

When to Use

Use for canvas/Phaser/Kaplay/Pixi 2D systems, or guest viewports inside hybrid web apps.

Example

User request:

> Use @2d-games for this task: 2D game development principles.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。

同名技能的其他版本

有 4 个不同仓库或目录里都有叫 2d-games 的技能。它们内容并不相同,别混用: