Spielerando

Build a game where you play cards from a hand against an enemy that shows what it will do

A card duel runs on a draw pile, a hand, a discard pile and a small supply of energy per turn. The classic slip is a draw pile that runs dry in the middle of drawing. Here is a loop that reshuffles at the right moment and keeps every card.

Why this works

A deck is a promise that every card will come back. Three piles, with a single place where drawing happens, mean no card is ever lost or doubled, and the player can plan around what is still to come.

When not to use it

Skip it for games where hidden luck frustrates, or where the player should always have every option open. Give a fixed set of moves each turn instead of a shuffled deck.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 3 common mistakes and the fix
  • 55 lines of example code with 4 checks that pass
  • How your AI shows you that it works

Say this to your AI

Use the Spielerando entry "Build a game where you play cards from a hand against an enemy that shows what it will do" (read_entry genre-card-duel-core-loop) in my game. Build it step by step, and show me how you checked that it works.

Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP