Skip to content
AI-powered appsNewChat, vision, voice, generationBookings & schedulingAppointments that book themselvesShops & sellingA storefront in every pocketClient & businessRun the operation from one placeCommunities & clubsA home that is not a group chat
Health & wellnessHabits, tracking and calmGames2D, 3D and multiplayerPersonal & toolsThe tool you wish existedInternal toolsThe tool ops never had time for
See all use cases
ArcadeNewPricingSecurity
EngineThe game engine and World EditorHow it worksFrom one sentence to a live productDocsGuides for building and publishingBlogStories, guides and newsChangelogWhat shipped latelyStatusUptime of every serviceSupportGet help from the team
AI-powered appsBookings & schedulingShops & sellingClient & businessCommunities & clubsHealth & wellnessGamesPersonal & toolsInternal tools
See all use cases
ArcadeNewPricingSecurity
EngineHow it worksDocsBlogChangelogStatusSupport
Language
Blog
Prompt libraryNovember 22, 20266 min read

A Prompt for a Card Battler

A card battler is a rules engine with a lot of personality. This brief gives the agent both: exact turn rules and keywords, a card table you can edit, and an opponent that plays sensibly.

Startbase Team
Editorial ink illustration of a fanned hand of cards beside a brass hourglass and dice, the top card corner gem in ember orange

Key takeaways

  • Write the turn order as numbered steps. Card games break on timing questions: what happens first, and when.
  • Keep cards as a data table with a small set of keywords. New cards become rows, not code.
  • Ask for a simple scoring AI that tries each legal play and picks the best. It is easy to understand and easy to tune.

Use this prompt for a card battler with clear rules and a real opponent: two players, three lanes, mana that grows by one each turn, units that fight across lanes, spells, five keywords, a pool of 24 original cards stored as data, deck building from that pool and an AI that plays its turn sensibly. It is a 2D game built for phones and desktop, with drag-to-play and a tap alternative. The brief is precise about turn order, because that is where card games go wrong.

The card battler prompt

Make a 2D card battler for desktop and phones (landscape), in a rich illustrated fantasy style with clean, readable card frames. Two players: the human and an AI. Each has a hero with 20 health. The board has 3 lanes; each player has one slot per lane on their side. Turn order, in this exact sequence: 1) the active player gains 1 max mana (up to 10) and refills mana; 2) draws 1 card (hand limit 8, extra cards are burned with a short animation); 3) plays any number of cards they can afford, placing units in empty slots on their side and casting spells on valid targets; 4) presses End turn; 5) combat: from left lane to right, each of the active player's units that was not played this turn attacks the opposite slot, dealing its attack to the enemy unit there (which hits back) or to the enemy hero if the slot is empty; 6) units with 0 health are removed; 7) the turn passes. Both players start with 3 cards; the player going second gets a 4th card and a one-time Spark (a 0 cost card that gives 1 temporary mana). Keywords: Guard (an enemy unit in an adjacent lane must attack this unit instead of the hero), Swift (can attack on the turn it is played), Shield (ignores the first damage it takes), Drain (heals your hero by the damage it deals), Echo (when this dies, return a 1/1 copy to your hand). Card pool: 24 original cards as a data table with name, cost, type (unit or spell), attack, health, keywords, text and art description. Make about 16 units and 8 spells, costs 1 to 7, with effects such as 'deal 2 damage to a unit', 'give a unit +2 attack this turn', 'draw 2 cards', 'swap two of your units' lanes'. Decks: 20 cards, at most 2 copies of a card; two prebuilt starter decks (aggressive and defensive) and a deck builder screen. AI: on its turn, try every affordable play and placement, score the resulting board (enemy hero damage, unit value, threats removed, its own hero safety), make the best play, and repeat until nothing scores better than passing; wait 0.6 s between plays so the player can follow. Controls: drag a card from the hand to a slot or target; or tap a card, then tap a highlighted slot or target; long press (or right click) any card to see it large with its full text. Valid targets glow; invalid drops return the card to the hand. Feel: cards lift and tilt when picked up, units lunge on attack, numbers pop when damage is dealt, a deep hit and shake when a hero takes damage. Sound: card swishes, a thunk on placement, distinct sounds for each keyword triggering, a calm tavern-like music loop. Screens: title, deck select, deck builder, the battle (hands, board, heroes, mana as gems, deck counts, End turn button), victory and defeat with a rematch button.

The reasoning behind each part

  • Numbered turn order. When do units attack? Before or after the player's plays? Can a unit attack the turn it arrives? Every one of these is a choice, and an agent forced to guess will guess differently in different places. Seven numbered steps settle it. The card game guide covers rules engines and turn structure more broadly.
  • Three lanes. Lanes turn placement into a decision: block the enemy's big unit or open a path to their hero. Three is enough to think about, and fits a phone screen in landscape.
  • Mana that grows to 10. It gives every game a shape: cheap cards early, big plays late. The second player's extra card and Spark compensate for going second, a common fix for first-turn advantage.
  • Five keywords. Keywords are a vocabulary players learn once and see on many cards. Five is enough for interesting combinations and few enough to explain on a single help screen.
  • Cards as data. A data table with an art description per card lets you add, balance and rewrite cards without a rules change, and generate art in a consistent style from the descriptions.
  • A scoring AI. Trying every play and scoring the result is simple, predictable and good enough to beat new players while still making visible mistakes. The pause between plays makes its turn readable.
  • Drag or tap. Dragging is satisfying with a mouse; on a phone, the finger hides the card. Supporting both, plus a long press to read, makes the game comfortable everywhere.

Three follow-up prompts

  1. 01Balance check. Run 200 AI-versus-AI games with each starter deck against the other and against itself, and report win rates and the 5 cards with the highest and lowest win rates when drawn. Do not change anything yet.
  2. 02Tune from the report. Based on that report, change at most 4 cards' costs or numbers to bring the starter decks within 45 to 55 percent against each other. List every change.
  3. 03Add a short campaign. Add a campaign of 6 opponents with their own decks and a portrait, each beaten opponent unlocking 2 new cards for the player's collection.

Splitting the balance check from the changes is deliberate. You see the numbers first and decide, instead of letting several changes land at once and losing track of which one helped. Use checkpoints to return to an earlier balance if a round of tuning makes things worse.

Two variations

Roguelike card run

Keep the battle rules and replace deck building with a run: start with 10 weak cards, beat a sequence of 8 opponents, and after each win pick 1 of 3 new cards to add. It changes the long-term loop completely. The deckbuilder guide explains card pools, synergies and encounter design for this format.

Play a friend online

Add online matches with a room server: one player creates a room and shares a code, the server holds both decks and hands so neither browser can see the other's cards, and turns have a 60 s timer. Hidden information must live on the server. Previews run the room server on every plan; publishing a game with it needs a paid plan, see the multiplayer docs.

What usually goes wrong

  • Effects resolve in a strange order. Two units with death effects die at once. Ask for a rule: "Resolve simultaneous effects left lane to right, active player's side first," and for a test that covers it.
  • The AI freezes or takes ages. Trying every combination of plays explodes with a big hand. Ask the AI to choose one play at a time, greedily, and to stop thinking after 300 ms.
  • Card text and behavior disagree. Ask the agent to generate each card's text from its data fields where possible, and to add a test per card that checks its effect does what the text says.
  • Cards are unreadable on phones. Ask for a minimum font size of 14 px on cards in play, cost and stats in large corner gems, and the long-press view for full text.
  • Art styles differ between cards. Ask for all card art to be generated with the same style line and frame, and review all 24 side by side.

Scope it right

Twenty-four cards and two decks are a complete first game. Resist adding more cards until the starter decks feel balanced against each other, because every new card multiplies the balance work. When matches feel close and decisions feel real, publish and invite people to beat the AI.

Frequently asked questions

How many cards does a first card battler need?

Around 20 to 30 unique cards is plenty for two starter decks and a deck builder. Balance those before adding more, because each new card interacts with every existing one.

How does the AI opponent decide what to play?

In this brief it tries each affordable play, scores the resulting board and picks the best, repeating until passing scores higher. It is simple to build, easy to tune and good enough for new players.

Can two people play each other online?

Yes, with a room server that keeps each player's hand hidden from the other. Previews run it on every plan, and publishing a game with its room server needs a paid plan.

On this page

  • The card battler prompt
  • The reasoning behind each part
  • Three follow-up prompts
  • Two variations
  • What usually goes wrong
  • Scope it right

Keep reading

More in Prompt library
Editorial ink illustration of an open seed packet beside a wooden hoe and a watering can, one sprouted seed in ember orange
Prompt libraryNovember 22, 2026

A Prompt for a Cozy Farming Game

Paste this brief to get a calm, playable farm on the first build: four crops with real numbers, an eight-minute day, two seasons and controls that work under a thumb.

7 min read
Editorial ink illustration of an iron dungeon key, a die and a skull candle holder, the candle flame in ember orange
Prompt libraryNovember 22, 2026

A Prompt for a Roguelite Dungeon Crawler

One brief for a top-down roguelite that is fun on the first build: a dodge with real frame values, enemies that telegraph, relics that change runs and a hub that keeps progress after death.

6 min read

Read less. Ship more.

Everything in this post is one prompt away. Describe your app and watch it build.

Start building

Apps, games, backends and publishing from one conversation.

Product

  • Features
  • Use cases
  • Pricing
  • Changelog

Resources

  • Blog
  • Docs
  • Support
  • Status
  • Security

Contact

  • w@startbase.ai
  • X / Twitter
  • LinkedIn
  • Instagram

Legal

  • Terms
  • Privacy

© 2026 Startbase. All rights reserved.