Most beginners who search "how to make a poker game" want the Texas hold’em feel - a green felt table with a dealer button rotating between seats, two face-down hole cards sliding to each player, a flop of three community cards flipping up in unison, a betting action bar with FOLD, CALL, and RAISE lit up, and a showdown that reveals a two pair beating a busted flush draw - not a real-money platform with rake calculations and Know Your Customer flows on day one. Live poker is famously demanding at commercial scale because a single project juggles cryptographically fair shuffling, four staged betting rounds with position and blinds, a hand ranker that scores seven-card sets correctly, AI opponents that fold-check-call-raise plausibly, and a chip economy that survives 200 hands of tilted play. A browser poker game aimed at a portfolio piece or a jam is a different animal. A coding agent scaffolds the deck, the shuffle, the hand ranker, and the four-round betting flow from a single prompt, and AI generation covers the felt, the card faces, the opponent portraits, and the chip clacks. On desktop or web, that means WizardGenie for the hand-loop interpreter, AI Image Gen for the felt, cards, and opponent avatars, and SFX Gen for the card slides and chip clacks. This guide is the honest end-to-end for how to make a poker game in 2026, as a weekend build you can actually finish.
What how to make a poker game actually means in 2026
The query "how to make a poker game" hides three distinct intents. Some searchers want a game-theory deep dive on pot odds, expected value, and GTO ranges - a strategy article, not a browser build. A second intent is the broader how to make a deck builder game guide covering any deck-shuffle-hand mechanic including Slay the Spire clones - useful, but that guide correctly targets deckbuilding progression, not staged betting. The intent this article targets is the third: a browser poker game that boots into a single-page HTML shell with a green felt table, four seats (you and three AI opponents), fair Fisher-Yates shuffle of a 52-card deck, no-limit Texas hold’em with a small blind and a big blind rotating on a dealer button, four staged betting rounds (preflop, flop, turn, river), a correct five-card hand ranker for seven-card sets, three AI opponents that fold trash and call medium hands with an occasional bluff, a chip stack that carries between hands, and a winner banner at showdown. That is a weekend build, it demos the Sorceress toolset honestly, and it is the format most poker game tutorial and javascript poker searchers actually want.
The presentation contract is small and strict. A green felt fills most of the viewport, with four seats spaced around the rim, a dealer button chip near the seat that acts last, and a community-card row across the horizontal center. Two hole cards sit at the front of the player seat, face-up for the human and face-down for the AI opponents until showdown. A pot chip stack in the middle grows as bets go in. A betting action bar sits at the bottom with FOLD, CHECK, CALL, RAISE (with an amount slider), and ALL-IN buttons - the buttons that are illegal in the current state (CHECK when there is a live bet, CALL when there is no bet) grey out automatically. The poker overview on Wikipedia (verified 2026-08-30) traces the game from its 19th-century Mississippi roots through Texas hold’em’s mid-2000s online-poker boom, confirming the ranking hierarchy and the flop-turn-river street structure - cite that page in your itch.io blurb so players know you shipped a browser hand loop, not a video poker slot machine.
The poker hand loop in one minute (ante, deal, bet, showdown)
Five moving parts, cycled every hand. First, post blinds - the small blind and big blind chips go in from the two seats left of the dealer button; the button rotates one seat clockwise between hands. Second, deal hole cards - two face-down cards go to each seat starting from the small blind, and a preflop betting round opens on the seat left of the big blind. Third, street loop - after the preflop round settles, the flop deals three face-up community cards and opens a second betting round; the turn deals a fourth community card and opens a third round; the river deals a fifth and opens a fourth. Fourth, showdown - if two or more players remain after the river round, all remaining hole cards flip up and the ranker scores each seven-card set (hole cards plus community board) to find the best five-card hand. Fifth, award pot - chips slide from the pot to the winning seat, the dealer button rotates, and the loop restarts. That five-step cycle, wrapped by a chip-stack tracker between hands, is the whole html5 poker loop - everything else (side pots, all-in equity splits, hand history, tournament blind schedules) is polish on top.
Pick your engine for how to make a poker game: Canvas, Phaser, or WizardGenie
Three good targets in 2026, each with a different trade-off. Plain HTML Canvas 2D is the honest default and the pick this guide recommends for a first build. Poker is light on physics - there is no collision solver, no continuous motion outside of a short card-slide easing curve, and the biggest render loads are the static felt and the card sprites, both of which are cheap. The MDN Canvas API reference (verified 2026-08-30) covers the drawImage sprite-atlas pattern that lets you pack all 52 card faces plus the card-back into a single texture and stamp any card at any table position with one blit. Cache the felt backdrop to an offscreen canvas once at boot, redraw only the moving card sprites and the pot chip stack each frame, and the whole browser texas holdem experience holds a stable 60 fps in any modern browser without any WebGL overhead.
Separate the simulation tick from the render frame - poker is inherently turn-based and does not need per-frame simulation. A single tick fires when a player action commits (fold, check, call, raise); everything between actions is either idle or animating a card slide or chip cascade off the render loop. This is the same discipline the sibling how to make blackjack guide uses for its deal loop - poker just adds three more streets and multi-player action instead of a dealer-only response.
Phaser v4.2.1 "Giedi" (released 9 July 2026, verified 2026-08-30 on the official Phaser stable download page) becomes the right pick when a browser poker game wants Phaser’s Scene system, tween library, and input plugins out of the box. Phaser scenes map cleanly to poker screens - LobbyScene, TableScene, ShowdownScene, GameOverScene - and Phaser’s tween chain is a natural fit for the "deal two cards to each of four seats, one card at a time, 80 ms apart" animation without hand-writing an easing loop. For a first weekend hand loop where the card-slide animation is the biggest UX bet, Phaser saves an hour; for a pure vanilla-JavaScript learning build, plain Canvas is more instructive.
WizardGenie is not a separate poker engine - it scaffolds whichever of the two you pick from a single natural-language prompt. WizardGenie ships as both a desktop app (Windows installer with auto-update, available to Early Access supporters and above) and a no-install web build. Its coding-model lineup covers Claude Opus 4.7, Claude Sonnet 4.6, GPT-5.5, Gemini 3.1 Pro, DeepSeek V4 Pro, Kimi K2.5, Grok 4.2, and MiniMax M2.7 (verified 2026-08-30 in src/app/_home-v2/_data/tools.ts lines 767-772). For a first poker hand loop, any frontier model scaffolds the deck-shuffle-deal-bet-showdown state machine in one prompt. Pair a frontier planner with a budget executor like DeepSeek V4 Pro or Kimi K2.5 for the typing pass - the dual-agent pattern lands most projects at roughly one-fifth the single-frontier cost.
Step 1 - model deck, hand rankings, and betting rounds
Nothing else in the pipeline matters if the deck is not fair and the ranker is not correct. Start with a small, testable model:
const SUITS = ["c", "d", "h", "s"];
const RANKS = ["2","3","4","5","6","7","8","9","T","J","Q","K","A"];
const RANK_VALUE = Object.fromEntries(RANKS.map((r, i) => [r, i + 2]));
function freshDeck() {
const deck = [];
for (const s of SUITS) for (const r of RANKS) deck.push(r + s);
return deck;
}
function shuffle(deck) {
for (let i = deck.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[deck[i], deck[j]] = [deck[j], deck[i]];
}
return deck;
}
const state = {
seats: [
{ id: "you", name: "You", stack: 1000, hole: [], folded: false, allIn: false, bet: 0 },
{ id: "ai1", name: "Rook", stack: 1000, hole: [], folded: false, allIn: false, bet: 0 },
{ id: "ai2", name: "Vera", stack: 1000, hole: [], folded: false, allIn: false, bet: 0 },
{ id: "ai3", name: "Otto", stack: 1000, hole: [], folded: false, allIn: false, bet: 0 },
],
dealerIndex: 0,
smallBlind: 5,
bigBlind: 10,
board: [],
pot: 0,
toCall: 0,
street: "preflop",
deck: [],
};
function dealHand() {
state.deck = shuffle(freshDeck());
state.board = [];
state.pot = 0;
state.toCall = state.bigBlind;
state.street = "preflop";
for (const s of state.seats) { s.hole = []; s.folded = false; s.allIn = false; s.bet = 0; }
postBlinds();
for (let i = 0; i < 2; i++) for (const s of state.seats) s.hole.push(state.deck.pop());
}
The Fisher-Yates shuffle above is the correct O(n) algorithm - the loop counter starts at the end and picks a random index only from the unshuffled prefix, which is what produces a uniform permutation. The common naive-shuffle bug of writing Math.floor(Math.random() * deck.length) on every iteration produces a biased distribution that leaves cluster patterns detectable after roughly fifty hands (the Fisher-Yates shuffle overview on Wikipedia, verified 2026-08-30, has the classic proof and the wrong-vs-right-way comparison). For a single-player casual browser poker game, MDN’s Math.random reference (verified 2026-08-30) is honest and passes casual scrutiny; for any build that ever ships against another human on the same URL, swap the RNG source for Crypto.getRandomValues (verified 2026-08-30) to close the "I inspected the client seed" attack.
The hand ranker is the second must-get-right component. Rank a seven-card set (two hole cards plus the five community cards) by enumerating all C(7, 5) = 21 five-card subsets and returning the maximum. Score each five-card hand as a tuple (category, tiebreak-ranks) where category is an integer from 0 (high card) to 9 (royal flush) - a straight-flush of nines beats every full house, and comparing tuples lexicographically resolves the kicker rules correctly. Unit-test five cases before you generate any art: a pair of eights with an ace kicker beats a pair of eights with a king kicker; a wheel straight (A-2-3-4-5) is a valid straight and loses to any straight starting at 2 or higher; a flush ties correctly by high card down to the fifth card; a full house of aces over twos beats a full house of kings over queens; four of a kind beats any straight-flush-less full house. Those five tests catch ninety percent of javascript poker ranker bugs.