本文へスキップ
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がスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/genres/card-game/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に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

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル