Phaser AE

Solitaire games

Pro packv3.0.0-02DGrid

The patience card games, Klondike, FreeCell and Spider, as three rule tables over one engine. Moves come back as a journal to animate, a hint is always a real move, and a solver deals games it has actually won.

This is a Pro pack. Upgrade to Phaser Pro to use it in your games.See Phaser Pro →

Released October 19, 2026

Solitaire games: a screenshot of its demo
A note about these graphics

Expansion packs don't come with graphics. This screenshot is one way of drawing what the pack does, made for its demo: none of the sprites, tiles or backgrounds in it are in the pack.

That's by design. A pack is a game's logic, mechanics and effects, and it works with whatever art you give it. Some packs draw effects, backdrops or 3D scenes of their own, but none carries a game's sprites.

So the look is yours. Make the art on phaser.io, bring your own, or let your agent draw it in code: the same pack can look like anything.

What it does

A card game here is a deal, a set of piles and a small number of legal moves. Each variant is a table of rules: how many tableau columns, foundations and free cells, whether there is a stock and what clicking it does, how many cards it draws and how many times it may be recycled, what may land on an empty column, what stacks on what, which runs lift together and whether foundations take single cards or whole runs. The engine plays any table, so the three built-in games are configuration, and a patience game of your own is a Variant you write.

The table's verbs, move, draw, autoMove and collect, each return an ordered list of steps: cards moving, a card flipping, a draw to the waste, a recycle, Spider dealing a card to every column, a completed run leaving, a win or a dead end. Your presenter plays them at its own pace. Undo and redo treat a cascade, a move that flips a card that completes a foundation that frees a column, as one step. FreeCell's supermove is counted for you from the free cells and empty columns.

A random deal cannot be won perhaps a fifth of the time, and the player cannot tell. dealWinnable, or winnable on createSolitaire, deals until a bounded best-first solver has won one and marks the game proven; when every attempt runs out of budget it says unproven instead, or throws if you ask it to be strict. rateDeal gives the length of the solver's winning line as a measure of difficulty. The hint comes from the same move finder the solver uses, so it never suggests something the rules refuse.

Features

  • Three games built in — Klondike with draw one or draw three and limited or unlimited redeals, FreeCell with any number of cells, and Spider in one, two or four suits.
  • Rule tables — a Variant sets the piles, the stock, the stacking and run rules and the deal, for patience games beyond the three.
  • Step journal — move, flip, draw, recycle, dealAll, complete, win and stuck steps in play order.
  • One-step undo — undo and redo unwind a whole cascade together and roll the move count back with it.
  • Real hints — hint and findMoves come from the solver's own move finder, ranked by value.
  • Winnable deals — a solver-proven deal, with dealProof saying proven, unproven or unchecked.
  • Deal rating — rateDeal reports whether the solver won and in how many moves.
  • Auto-finish — canAutoComplete says when nothing is face-down, and collect sweeps every playable card up.
  • Seeded and headless — the same seed gives the same deal, and games autoplay and rate without a screen.

Good for

  • Classic Klondike solitaire with draw-one and draw-three modes and a "winnable deals only" option.
  • FreeCell, with the number of free cells as a difficulty setting.
  • Spider, from the gentle one-suit game to four suits.
  • Daily deals, where a seed gives every player the same game and the solver says whether it can be won.
  • Patience games of your own, such as a variant with different columns, stacking or stock rules.
  • 3D card tables, since the rules and the journal are independent of how the cards are drawn.

Make it yours

Each built-in game takes options: klondike({ drawCount, redeals }), freecell({ cells }) and spider({ suits }), and createSolitaire also accepts the names 'klondike', 'klondike-3', 'freecell', 'spider', 'spider-1' and 'spider-2'. The winnable search takes a node budget per candidate deal, a number of attempts and a strict switch. Beyond those, a Variant is yours to write: the counts of each kind of pile, the stock, the draw count and redeals, the rules for empty columns, stacking and lifting runs, the foundation rule and the deal itself.

Two materially different games: a draw-three Klondike with three redeals and proven-winnable deals for players who want a challenge they know can be won; and a one-suit Spider with ten columns and a stock that deals a card to every column, for a relaxed game where runs complete themselves into the foundations.

A quick look

A Klondike deal the solver has won, a move, and its steps animated:

const table = game.solitaire.createSolitaire({ variant: 'klondike', seed: 7, winnable: true, attempts: 40 });
if (table.dealProof !== 'proven') { /* not proven: tell the player, deal again, or raise maxNodes */ }
const r = table.move('t3', 4, 't6');
for (const step of r.steps) animate(step);
const hint = table.hint();

Works with

  • cards — required: the deck and piles the games are dealt from.
  • card-art — card faces and backs to draw the table with.
  • card-motion — cards that glide, flip and deal in style, from the journal's steps.
  • blackjack — for a casino card game rather than patience.

Good to know

  • The solver is a bounded beam search, not an exhaustive one: a "no" means not found within the budget, not impossible.
  • At the default budget a quick check won about 3 of 8 Klondike deals, 6 of 8 FreeCell deals and none of 8 Spider deals, so Spider with winnable usually comes back unproven unless the budget is raised a long way.
  • Check dealProof before you tell a player a deal is winnable.
  • The rating is the length of the solver's line, not a proven minimum number of moves.

More Grid packs

Show all →