Test store. Prices are the planned list prices stored as test data, license terms are drafts, and payments go to a Stripe test-mode account. No real money moves.

HTML5 Strategy Game Source Code

Tower defense, tactics and deckbuilding with data-driven balance. Every game is playable in the browser and ships as a buildable TypeScript project.

6 games in this collection

Filters

How to choose HTML5 strategy game source code

The strategy games above cover five styles: tower defense, turn-based hex strategy, a deckbuilding roguelite, a merge auto-battler and a survival resource game. All six are built on Phaser 4.2.1 and written in TypeScript, and all have a daily challenge, achievements and local saves. Strategy games live or die on balance, so the useful question is how easy each one is to tune, and how long a session lasts on the screens your players use.

Strategy game specs

GameStyleModesOrientationInitial download
Pocket Tower DefenseTower defense with repositionable towers and elemental combinationsCampaign, daily, challenge modifiers, masteryLandscape565 KB
Train DefenseMoving-base tower defense on train carriagesCampaign, daily, endless, challengesLandscape700 KB
Hex KingdomsTurn-based hex strategy with fog of warCampaign, skirmish, procedural maps, AI difficulty tiersLandscape590 KB
Card Combo RogueDeckbuilding rogueliteRuns with relics, branching map, ascension, dailyLandscape650 KB
Merge Army TacticsMerge auto-battler with toy soldiersCampaign, daily, ladder, researchPortrait650 KB
Island Survival StrategyResource strategy, survival-liteCampaign, challenges, endless, sandbox, dailyLandscape600 KB

Mechanics and who they suit

Tower defense. Pocket Tower Defense lets players move towers between lanes and combine elements, with bosses, challenge modifiers and tower mastery for replay value. Train Defense turns the base into a moving train: players mount and rearrange weapons on carriages while crossing enemy territory, with route choices and a steampunk look. Both suit portals with returning players who want short, replayable levels.

Turn-based strategy. Hex Kingdoms is a compact 4X-lite: expand across a hex map, gather resources, capture towns and outmaneuver AI kingdoms under fog of war. Skirmish mode on procedural maps keeps it playable after the campaign. It fits desktop players who like to think between turns.

Deckbuilding. Card Combo Rogue builds a temporary deck each run around tag synergies across fire, machine, nature, magic and poison cards. Enemy intents are shown in advance, a guided tutorial teaches the rules, and a run can be resumed at any time.

Auto-battle and survival. Merge Army Tactics is the only portrait strategy game here: merge identical units into stronger ones, arrange the formation, then watch the battle play out. That loop works well in short phone sessions. Island Survival Strategy has players assign a small group of survivors to gather food, build shelter, explore and defend an island, and it is tagged family-friendly.

Rebalancing without rewriting

In five of the six games, unit stats, waves, maps, scenarios or rules are JSON data files in the game's data/ folder. You can make a tower cheaper, an enemy wave tougher or a map smaller by editing data, then run the game's tests and rebuild. Card Combo Rogue keeps its cards, enemies and relics in TypeScript data modules instead, so adding a card means editing typed data and running the type checker. Within your license you can also rename the game and replace art; ASSETS.md lists where every asset comes from.

If you want to understand the systems before you buy, our guide on how to make an HTML5 strategy game explains turns, AI and balance, and the free tower defense code walks through a minimal version in one file.

Frequently asked questions

Is there tower defense source code here?

Yes, two games. Pocket Tower Defense is a classic lane defense with repositionable towers and elemental combinations. Train Defense is a moving-base variant where the weapons ride on train carriages. Both are landscape games on Phaser 4.2.1.

Do the strategy games have AI opponents?

Hex Kingdoms plays against AI kingdoms with several difficulty tiers. Card Combo Rogue shows each enemy's intent before it acts. In the tower defense games, players face waves and bosses, and in Merge Army Tactics battles resolve automatically once the formation is set.

Are any of them multiplayer?

No. All our games are single-player, which keeps them static: no game server, no accounts, progress saved on the player's device. Daily challenges give players a reason to come back.

Which strategy game works best on phones?

Merge Army Tactics, because it is designed for portrait. The other five are landscape games that support touch, so they work on phones held sideways and on tablets. Play the demos on your target devices before you choose.