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

2d-games

Skill này làm gì

Công cụ này giúp tạo game 2D. Nó giải thích cách làm nhân vật di chuyển, dùng tilemap, thiết lập camera và áp dụng vật lý, tất cả cho game chạy trên trình duyệt hoặc ứng dụng.

Khi nào nên dùng

  • ✓Khi tạo một game platformer với cơ chế nhảy đặc biệt.
  • ✓Khi phát triển game nhìn từ trên xuống với chuyển động tự do.
  • ✓Khi thêm một phần game 2D nhỏ trong một ứng dụng lớn hơn.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/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/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/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

“Làm thế nào để nhân vật game 2D của tôi nhảy phản hồi tốt hơn, ví dụ nhảy được ngay sau khi vừa rời khỏi bục?”

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

Cách hoạt động

Nó dùng các nguyên tắc thiết kế game 2D như gom hình ảnh thành atlas, tạo hoạt ảnh, thiết lập va chạm và điều khiển camera. Hãy xem nó như một hướng dẫn tổ chức các phần hình ảnh và tương tác của 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. 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.
Câu hỏi thường gặp

'Atlas' là gì?

Đây là cách gộp nhiều hình ảnh nhỏ thành một hình lớn, giúp game tải nhanh hơn và chạy mượt hơn.

'Tilemap' là gì?

Đây là bản đồ được tạo từ các khối nhỏ (ô), như trong các game cổ điển, dùng để dựng cảnh một cách hiệu quả.

'Coyote time' là gì?

Đây là một sự hỗ trợ nhỏ mà game dành cho người chơi, cho phép họ nhảy ngay cả khi hơi lệch khỏi bục, giúp game dễ tha thứ hơn.

Chi tiết

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

2D game development principles. Sprites, atlases, tilemaps, physics, cameras, and genre patterns (platformer, top-down). Use for canvas/Phaser/Kaplay/Pixi 2D games or guest viewports inside hybrid web apps.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#4682
Giấy phép
MIT
Cập nhật
15/10/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ự