Langsung ke konten
Skillpedia
Pemrograman umum6.6k ยท #13810

puzzle

Fungsinya

Skill ini memandu pembuatan puzzle papan diskret, di mana setiap gerakan mengubah papan menurut aturan tetap. Skill ini ditujukan untuk pengembang yang membuat game match-3, pendorong balok, atau puzzle logika.

Kapan dipakai

  • โœ“Saat Anda membangun game match-3 dengan cascade atau pendorong balok bergaya sokoban.
  • โœ“Saat Anda memerlukan undo untuk puzzle berbasis grid.
  • โœ“Saat Anda menginginkan level yang dapat diselesaikan dan aturan yang selalu menghasilkan hasil yang sama.

Link skill

https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/genres/puzzle/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/genres/puzzle/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit โ†’

Contoh permintaan ke AI

โ€œSaya membuat game puzzle match-3. Bisakah Anda menyiapkan grid, deteksi kecocokan, cascade, dan tombol undo?โ€

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent membangun model papan sebagai satu sumber kebenaran, menerapkan setiap gerakan melalui aturan tetap seperti pencocokan, jatuh, dan pengisian, serta menyelesaikan cascade secara berurutan. Agent menyimpan gerakan agar pemain dapat membatalkannya.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

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

  1. Board model โ€” a grid of cells holding pieces; the single source of truth (logic, not visuals).
  2. Move input โ€” swap, push, drag, rotate, or place; validate legality before applying.
  3. Rule resolution โ€” detect and apply the genre's rule (matches, pushes, logic) until stable.
  4. Cascades/chains โ€” when resolution changes the board, re-resolve until no more changes.
  5. Objectives + scoring โ€” win/lose conditions (score, clear all, reach goal); move/time limits.
  6. Undo โ€” revert the last move (and its resolution) exactly; essential for thinky puzzles.
  7. Level progression + (often) generation โ€” hand-authored or generated solvable boards.
  8. 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
Pertanyaan umum

Mengapa papan harus diselesaikan secara deterministik?

Skill menyebutkan bahwa gerakan yang sama harus selalu menghasilkan hasil yang sama, sehingga puzzle tetap adil dan bug dapat diulang.

Apakah mencakup aksi grid real-time?

Tidak. Aksi grid real-time dengan permadeath dicakup oleh skill roguelike.

Apakah mencakup rendering tile?

Penggambaran tile dicakup oleh skill tilemap engine, yang ditunjuk oleh skill ini.

Detail

Deskripsi asli dari pembuat

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.

repo: gamedev-skills/awesome-gamedev-agent-skills

Popularitas

Bintang GitHub
6.6k
Peringkat
#13810
Lisensi
Apache-2.0
Diperbarui
28/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • โ€ฆ

Skill lain dari repositori ini

Skill serupa