puzzle
Skill này làm gì
Skill này hướng dẫn xây dựng các game đố trên bàn rời rạc, trong đó mỗi nước đi thay đổi bàn theo luật cố định. Nó dành cho nhà phát triển làm game match-3, đẩy khối hoặc đố logic.
Khi nào nên dùng
- ✓Khi bạn đang xây dựng game match-3 có chuỗi rơi liên tiếp hoặc game đẩy khối kiểu sokoban.
- ✓Khi bạn cần hoàn tác cho một trò đố trên lưới.
- ✓Khi bạn muốn màn chơi giải được và các luật xử lý giống nhau mỗi lần.
Liên kết skill
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/genres/puzzle/SKILL.mdSao 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
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tôi đang làm game giải đố match-3. Bạn có thể thiết lập lưới, việc phát hiện ghép, các chuỗi rơi liên tiếp và nút hoàn tác không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent xây dựng mô hình bàn làm nguồn sự thật duy nhất, áp dụng mỗi nước đi qua các luật cố định như ghép, rơi và lấp đầy, rồi xử lý các chuỗi liên tiếp theo thứ tự. Nó lưu các nước đi để người chơi có thể hoàn tác.
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.
Puzzle
A playbook for grid/board puzzle games — the board model, move input, rule resolution (matching, pushing, logic), scoring, undo, and level progression. This is a compositional skill: it models board state and rules and presents them through a tilemap/UI. It does not re-teach tilemaps; it defines the resolution loop and the correctness rules (clean state, deterministic resolution, undo) that keep a puzzle fair and bug-free.
When to use
- Use when the game is a discrete board the player changes with moves, and the board resolves by rules: match-3/tile-matching, sokoban/block-pusher, sliding puzzle, logic grid.
- Use when designing match/cascade resolution, undo, level progression, or solvability.
When not to use: real-time grid action with permadeath → roguelike. Card zones/turns →
card-game. Physics-based "puzzle platformer" → platformer + physics-tuning. For the tile
rendering, use godot-tilemap / unity-tilemap-2d.
Core loop
Read the board → plan a move → make the move → the board resolves by its rules (match, push, fall, fill, cascade) → see progress toward the objective → repeat until solved/failed. The fun is the planning; the engine's job is to resolve each move deterministically and present it clearly.
Must-have systems
- Board model — a grid of cells holding pieces; the single source of truth (logic, not visuals).
- Move input — swap, push, drag, rotate, or place; validate legality before applying.
- Rule resolution — detect and apply the genre's rule (matches, pushes, logic) until stable.
- Cascades/chains — when resolution changes the board, re-resolve until no more changes.
- Objectives + scoring — win/lose conditions (score, clear all, reach goal); move/time limits.
- Undo — revert the last move (and its resolution) exactly; essential for thinky puzzles.
- Level progression + (often) generation — hand-authored or generated solvable boards.
- Feedback ("juice") — clear, satisfying animation/sound for matches, falls, and chains.
Design knobs
| Knob | Effect | Notes |
|---|---|---|
| Grid size / shape | complexity | Square is standard; hex/irregular change feel. |
| Match/push rule | genre identity | 3-in-a-row, shapes, push-into-goal, etc. |
| Cascade scoring | reward depth | Bigger chains = exponential payoff. |
| Move / time limit | pressure | Move-limited = puzzly; time = arcade. |
| Difficulty curve | learning | Introduce one mechanic at a time. |
| Undo depth | forgiveness | Single-step vs. full history. |
| Solvability guarantee | fairness | Generated boards must be solvable. |
| Deadlock handling | no dead ends | Detect no-moves; shuffle or end (refs). |
Patterns
1. Board model + match detection (logic separate from visuals)
# Pseudocode. The board is the truth; rendering reads from it. (0,0) top-left, y grows down.
board = [[piece_or_empty for _ in range(W)] for _ in range(H)]
def find_matches(board):
matched = set()
for y in range(H): # horizontal runs of >= 3 equal pieces
run = 1
for x in range(1, W):
if board[y][x] and board[y][x] == board[y][x-1]: run += 1
else:
if run >= 3: matched |= {(y, k) for k in range(x-run, x)}
run = 1
if run >= 3: matched |= {(y, k) for k in range(W-run, W)}
# ... repeat the same scan vertically (columns) ...
return matched
2. Resolve → collapse → refill → cascade (repeat to stability)
# Pseudocode. One player move can trigger a chain; loop until the board stops changing.
def resolve(board):
chain = 0
while True:
matches = find_matches(board)
if not matches: break # stable: resolution complete
chain += 1
score += score_for(matches, chain) # later chain steps score more (see refs)
clear(board, matches) # remove matched pieces
apply_gravity(board) # pieces fall into the gaps
refill(board, rng) # spawn new pieces at the top (seeded RNG)
return chain
3. Undo via state snapshot or command
# Pseudocode. Snapshot before each move; undo restores it exactly (board + score + counters + RNG).
def make_move(move):
history.append(snapshot(board, score, moves_left, rng.state)) # push BEFORE applying
apply(move); resolve(board); moves
Câu hỏi thường gặp
Vì sao bàn phải xử lý có tính xác định?
Skill nói cùng một nước đi phải luôn cho cùng một kết quả, để trò chơi công bằng và lỗi có thể lặp lại.
Nó có bao quát hành động lưới theo thời gian thực không?
Không. Hành động lưới theo thời gian thực với chết vĩnh viễn do skill roguelike bao quát.
Nó có bao quát việc vẽ tile không?
Vẽ tile do các skill tilemap của engine bao quát, và skill này dẫn tới đó.
Chi tiết
Mô tả gốc của tác giả
Build a puzzle game: grid/board state, move input, rule-based resolution (match-3 cascades, sokoban pushes, tile logic), scoring, and undo. Use for a match-3, sokoban, or grid-logic puzzle.
Độ phổ biến
- Sao GitHub
- 6.6k
- Vị trí xếp hạng
- #13810
- Giấy phép
- Apache-2.0
- Cập nhật
- 28/10/2026
Bình luận
- …
Thêm skill từ kho mã này
router
6.6kGiúp agent của bạn chọn đúng skill phát triển game cho yêu cầu, dựa trên engine bạn dùng và loại công việc cần làm.
ai-behavior-trees-utility-ai
6.6kGiúp agent của bạn xây dựng behavior tree và hệ thống utility AI cho kẻ thù và nhân vật trong game, chọn hành động theo độ ưu tiên và điểm số.
audio-design
6.6kDạy agent cách trộn âm thanh game: bus, âm lượng theo decibel, hạ nhạc khi có thoại, nhạc thích ứng và biến thể hiệu ứng âm thanh.
camera-systems
6.6kGiúp agent của bạn xây dựng camera game bám theo mượt, giữ trong phạm vi màn chơi, và xoay quanh hoặc nhìn quanh trong 3D.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.