Chuyển đến nội dung
Skillpedia
Lập trình chung33k · #8690

2d-games

Skill này làm gì

Skill này cung cấp cho AI của bạn các nguyên tắc cốt lõi để làm game 2D, như hoạt ảnh, bố cục màn chơi, va chạm và hành vi camera. Nó dành cho người làm game cuộn ngang hoặc các game 2D khác.

Khi nào nên dùng

  • ✓Khi bạn nhờ agent thiết kế hoạt ảnh sprite cho một nhân vật 2D.
  • ✓Khi bạn đang xây dựng một màn chơi bằng tile và cần lời khuyên về các lớp.
  • ✓Khi bạn cần giúp thiết lập va chạm hoặc một camera đi theo người chơi.

Liên kết skill

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/creative-design/game-development/2d-games/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/creative-design/game-development/2d-games/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Hãy giúp tôi thiết lập một camera đi theo người chơi trong game platformer 2D của tôi.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill đưa cho agent các hướng dẫn cho từng phần của game 2D. Agent dùng chúng để đưa ra lựa chọn thực tế khi viết hoặc xem xét code game.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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.

Câu hỏi thường gặp

Skill này có tự viết cả game cho tôi không?

Không, nó chỉ đưa ra hướng dẫn về nguyên tắc, còn agent vẫn viết code cho dự án của bạn.

Skill dùng game engine nào?

Skill tập trung vào các nguyên tắc 2D chung, nên hãy cho agent biết engine hoặc công cụ bạn đang dùng.

Skill nói gì về hoạt ảnh?

Skill đề cập đến tốc độ khung hình, co giãn (squash and stretch), và báo trước (anticipation) cùng chuyển động nối tiếp (follow-through) để chuyển động mượt hơn.

Chi tiết

Mô tả gốc của tác giả

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

repo: davila7/claude-code-templates

Độ phổ biến

Sao GitHub
33k
Vị trí xếp hạng
#8690
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự