Saltar al contenido
Skillpedia
Programación general6,6 mil · #13807

card-game

Qué hace

Guía la creación de juegos de cartas en los que las cartas se mueven entre un mazo, una mano, una zona de juego y una pila de descarte. Es para desarrolladores que hacen constructores de mazos, juegos de cartas coleccionables o juegos de cartas roguelike.

Cuándo usarla

  • ✓Cuando estás creando un constructor de mazos o un juego de cartas coleccionables.
  • ✓Cuando necesitas reglas de robar, barajar y volver a barajar que funcionen correctamente.
  • ✓Cuando quieres que los efectos de las cartas se resuelvan en un orden claro y predecible.

Link de la skill

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

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/genres/card-game/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“Estoy haciendo un constructor de mazos. ¿Puedes configurar el mazo, las pilas de mano y descarte, y hacer que funcione la estructura de turnos?”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

El agente modela las cartas como datos con costes y efectos, crea zonas para el mazo, la mano, la zona de juego y el descarte, y define el orden de turnos. Resuelve cada efecto de carta en una secuencia fija para que los resultados sean predecibles.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de 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
Preguntas frecuentes

¿Los efectos de carta deben ser código o datos?

La skill indica definir los efectos como datos, lo que hace que las cartas sean más fáciles de equilibrar y cambiar.

¿Cubre la interfaz de arrastrar y soltar cartas?

La mano y la interfaz de arrastre las cubre la skill de interfaz del motor, a la que remite esta skill.

¿Qué tipos de juegos de cartas encaja?

Encaja con constructores de mazos, juegos de cartas tipo TCG y CCG, solitario y constructores de mazos roguelike.

Detalles

Descripción original del autor

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

Popularidad

Estrellas en GitHub
6,6 mil
Posición en el ranking
#13807
Licencia
Apache-2.0
Actualizada
28/10/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas