본문으로 건너뛰기
Skillpedia
일반 코딩6.6k · #13807

card-game

하는 일

카드가 덱, 손패, 플레이 영역, 버림 더미 사이를 이동하는 카드 게임을 만드는 과정을 안내합니다. 덱빌더, 수집형 카드 게임, 로그라이크 카드 게임을 만드는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓덱빌더나 수집형 카드 게임을 만들고 있을 때.
  • ✓드로우, 셔플, 리셔플 규칙이 올바르게 작동해야 할 때.
  • ✓카드 효과가 명확하고 예측 가능한 순서로 처리되어야 할 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/genres/card-game/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“덱빌더를 만들고 있어요. 덱, 손패, 버림 더미를 설정하고 턴 구조가 작동하도록 해 주시겠어요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 카드를 비용과 효과를 가진 데이터로 모델링하고, 덱, 손패, 플레이 영역, 버림 더미를 위한 영역을 설정한 뒤 턴 순서를 작성합니다. 각 카드 효과는 고정된 순서로 처리되어 결과가 예측 가능하게 합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Card Game

A playbook for card games — card data, the deck/hand/discard zones, the turn structure, and how card effects resolve. This is a compositional skill: it models cards as data and wires them to UI. It does not re-teach data assets or UI nodes; it defines the zone model, the draw machinery, and the effect-resolution rules that keep a card game correct and bug-free.

When to use

  • Use when building any game where the core objects are cards moving between zones (deck → hand → play → discard): deckbuilder, TCG/CCG, solitaire, roguelike deckbuilder.
  • Use when designing draw/shuffle/reshuffle, turn structure, card costs, or how effects resolve.

When not to use: board/tile state with matching rules → puzzle. RPG with an incidental card battler → start from rpg. For defining cards as assets, use godot-resources / unity-scriptableobjects; for the hand/drag UI, use godot-ui-control.

Core loop

Draw to your hand → spend resources to play cards → effects resolve and change the board → end the turn (cleanup/discard) → opponent/next phase → repeat until a win condition. Depth comes from the combinations a hand allows; the engine's job is to resolve them unambiguously.

Must-have systems

  1. Card data — id, name, cost, type, text, and an effect spec (data, not code).
  2. Zones — deck (draw pile), hand, play/board, discard, exile/removed; cards live in exactly one.
  3. Draw + shuffle + reshuffle — draw from deck to hand; reshuffle discard into deck when empty.
  4. Turn structure — phases (untap/draw/main/combat/end) as a state machine.
  5. Resource system — mana/energy/actions that gate how much you do per turn.
  6. Effect resolution — apply a card's effects in a defined order; handle targets and triggers.
  7. Win/loss condition — life total, deck-out, objective.
  8. UI — hand layout, drag/drop or tap-to-play, zone counts, targeting affordances.

Design knobs

Knob Effect Notes
Starting hand / draw-per-turn tempo, consistency More draw = less variance.
Hand size limit hoarding vs. use Discard down at end of turn.
Deck size (min) consistency Smaller = more reliable combos.
Resource curve what's playable when "Mana curve" paces power.
Card rarity / power budget balance Stronger cards cost more / are rarer.
Determinism vs. randomness skill vs. swing Shuffle + random effects add variance.
Reshuffle rules deck-out, fatigue Reshuffle discard, or punish empty deck.
Removal / answers counterplay Every threat needs an answer in the pool.

Patterns

1. Zones + draw with automatic reshuffle

# Pseudocode. A card is in exactly one zone at a time; moving = remove here, add there.
def draw(n):
    for _ in range(n):
        if not deck:
            if not discard:          # truly empty: deck-out (lose, or take fatigue)
                on_deck_out(); return
            deck.extend(discard)     # reshuffle discard into deck
            discard.clear()
            shuffle(deck, rng)       # use a seeded RNG (see save-systems for replays)
        hand.append(deck.pop())

2. Card as data + effect resolution

# Pseudocode. Effects are a data list interpreted by the engine — not bespoke code per card.
card = {
    "id": "fireball", "cost": 3, "type": "spell",
    "effects": [ {"op": "damage", "amount": 6, "target": "chosen_enemy"} ],
}
def play(card, caster, chosen_targets):
    # Validate everything first; a failed check must leave zones and resources untouched.
    if resources[caster] < card.cost: return False      # can't afford
    if not targets_legal(card, chosen_targets): return False
    resources[caster] -= card.cost                      # commit: pay, then move, then resolve
    move(card, from_zone=hand, to_zone=play_or_discard(card))
    for fx in card.effects:
        resolve_effect(fx, caster, chosen_targets)      # one interpreter handles every card
    return True

3. Turn structure as a phase machine

# Pseudocode. Fixed phases keep timing windows (triggers, priority) unambiguous.
PHASES = ["untap", "draw", "main", "combat", "end"]
def take_turn(player):
    for phase in PHASES:
        enter_phase(player, phase)        # fire "on_phase" triggers here
        if phase == "draw":   draw(1)
        if phase == "main":   await player_plays_cards()
        if phase == "combat": resolve_combat()
        if pha
자주 묻는 질문

카드 효과는 코드여야 하나요, 데이터여야 하나요?

스킬은 효과를 데이터로 정의하라고 합니다. 그래야 카드의 밸런스를 맞추고 바꾸기 쉽습니다.

카드를 드래그하는 UI도 다루나요?

손패와 드래그 UI는 엔진 UI 스킬에서 다루며, 이 스킬은 그쪽을 안내합니다.

어떤 카드 게임에 맞나요?

덱빌더, TCG와 CCG 스타일 게임, 솔리테어, 로그라이크 덱빌더에 맞습니다.

상세 정보

작성자의 원본 설명

Build a card game: card data, deck/hand/discard zones, draw/shuffle/reshuffle, a turn structure, costs, and effect resolution. Use for a deckbuilder, TCG/CCG, or roguelike deckbuilder.

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

인기도

GitHub 스타
6.6k
순위
#13807
라이선스
Apache-2.0
업데이트
2026. 10. 28.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬