2d-games – skill Thiết kế & UI cho agent AI
Nguyên tắc phát triển game 2D. Sprite, atlas, tilemap, vật lý, camera và các mẫu thể loại (platformer, top-down). Dùng cho game 2D trên canvas/Phaser/Kaplay/Pixi hoặc viewport khách trong ứng dụng web lai.
Cài skill 2d-games bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/2d-games-9f897.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /2d-games – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/2d-games-9f897.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $2d-games – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/2d-games-9f897.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /2d-games – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/2d-games-9f897.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /2d-games – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
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 |
- Choose a movement/collision model per mechanic; pixel-art rendering can coexist with physics
- 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 |
| Uncoordinated movement and physics | Define one authority per body |
| 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:
> Add coyote time and jump buffering to our platformer while preserving the fixed physics timestep and testing corner collisions.
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.
Skill liên quan
- 3d-ui – Hướng dẫn triển khai web và ứng dụng cho giao diện 3D. Kích hoạt khi người dùng muốn đối…
- accessibility-compliance – Triển khai giao diện tuân thủ WCAG 2.2 với khả năng tiếp cận trên di động, mẫu thiết kế…
- brand-guidelines – Áp dụng màu thương hiệu và kiểu chữ của OpenAI cho bất kỳ sản phẩm nào cần khớp với giao…
- chatgpt-apps – Xây dựng, scaffold, refactor và xử lý sự cố ứng dụng ChatGPT Apps SDK kết hợp máy chủ…
- baoyu-comic – Công cụ tạo truyện tranh kiến thức, hỗ trợ nhiều phong cách nghệ thuật và giọng điệu…
- canvas-design – Tạo tác phẩm hình ảnh đẹp dưới dạng tài liệu .png và .pdf dựa trên triết lý thiết kế…
- image-generator – Tạo hoặc chỉnh sửa ảnh từ văn bản và file cục bộ, URL ảnh hoặc data URL qua image API…
- adversarial-ux-test – Nhập vai người dùng thù địch để tìm và phân loại các điểm đau UX.