There is a specific kind of gaming nostalgia reserved for the hidden gems of the early mobile gaming era. For me, that gem was Triple Town.
Released by Spry Fox, it wasn’t just a simple match-3 game; it was a deeply strategic, grid-based puzzle simulation. You merged three patches of grass to make a bush, three bushes to make a tree, three trees to make a hut, and so on, all while trying to trap roaming bears that blocked your paths. It was charming, infuriating, and brilliant.
Lately, I found myself deeply missing that gameplay loop. Instead of just searching the app stores for a clone, I decided to see if I could build my own version from scratch. The twist? I’m not an expert game developer. I decided to team up with an AI assistant to see how far we could push a single-file web game.
Here is the step-by-step journey of how we built Merge Kingdom: Tactical Simulation—complete with the exact prompts used to evolve it from a basic grid into a living, breathing simulation.
Step 1: Laying the Foundation (The 12×12 Grid)
Every great journey begins with a single step—or in this case, a single grid. I wanted a classic, self-contained browser game that handled the basic logic of matching three identical items to upgrade them to the next tier.
The Prompt Used:
“Create a complete, single-file HTML/JS/CSS game based on a 12×12 grid. It should have a match-three merge mechanic where placing three items of the same tier adjacent to each other merges them into one item of the next tier at the clicked location. Include an item queue showing upcoming items, a simple save/load system using localStorage, and a basic scoring system.”
The Result:
The AI generated a clean, fully functional prototype. It created the item hierarchy—Grass (🌱) to Bush (🌿) to Tree (🌳) to Hut (🏠) and beyond. It also built the core recursive merging function, meaning if a merge created a third tree next to two other trees, it would automatically trigger a chain reaction into a hut.
Step 2: Injecting Life (The Ambient Growth Engine)
The original prototype felt a bit too sterile. I wanted the map to feel alive, like an actual ecosystem where nature reclaims empty spaces. However, if things spawn randomly, it can easily ruin a player’s strategy. I needed the mechanic to be “ambient” but completely non-disruptive.
The Prompt Used:
“To make it like a real-life simulation, plants need to grow randomly during gameplay but shouldn’t be too disruptive.”
The Result:
The AI introduced a brilliant three-part constraint system:
- Low Probability Ticking: Nature updates slowly via a background interval, with only a small chance to sprout grass map-wide.
- Fragile Nature (Overwrite Rule): Wild growth never blocks the player. If you click to place a building on a wild plant, your item instantly overwrites it.
- Natural Progression: If nature organically places a third piece of grass making a cluster, it automatically triggers the merge mechanic—effectively clearing up board real estate on its own!
Step 3: Upgrading to a Tactical Simulation
With the basics down, it was time to turn up the heat. I wanted to add elements that forced the player to constantly pivot their strategy: moving threats, economic incentives, weather patterns, and geographical bonuses.
The Prompt Used:
“Add the monster threat system, dynamic weather, villager occupations, and strategic terrain bonuses.”
The Result:
This prompt turned the casual puzzle game into a legitimate tactical simulation by adding four massive layers of depth:
- The Monster Threat System: Dangerous monsters (
🐗) now spawn and wander the board. If you successfully surround them so they can’t move, they turn into Tombstones (🪦). Match three tombstones, and you build a Church (⛪), turning a nuisance into massive end-game points. - Dynamic Weather Engine: Every 25 turns, the seasons change. Monsoon season triggers rapid plant growth, Autumn spikes monster spawns, and Winter forces your villagers to seek shelter inside.
- Villager Occupations: Houses spawn villagers who wander the map. If a villager stands next to a Tree, they dynamically become a Woodcutter (
🪓); next to a River, they become a Fisherman (🎣). Working citizens generate passive points every turn. - Strategic Terrain Bonuses: The map generation now includes Golden Fertile Soil patches (which reduce the required merge count from 3 items to just 2) and Blue Dockland tiles (which grant bonus points for residential structures).
Step 4: The Ultimate Flex (The Autoplay AI)
To cap it all off, I wanted to see if the AI could write an algorithm smart enough to play the very game it just helped design. I asked for a toggleable autoplay feature.
The Prompt Used:
“One last thing, add an option for the game to autoplay.”
The Result:
The AI implemented a highly responsive heuristic algorithm. When you toggle “Autoplay,” a computer player evaluates the board every second. It isn’t just placing items randomly; it actively prioritizes matching lower-tier items on Fertile Soil, hoards houses for Dockland tiles, hunts down monsters using the Imperial Sword item, and calculates adjacency values to maximize chain-reaction merges.
Lessons Learned From AI Co-Development
Building this game taught me a massive lesson about the current state of software creation. AI isn’t just a copy-paste code generator; it is an incredible design collaborator.
By starting with a strict architectural boundary (a single-file HTML game) and layering features one prompt at a time—moving from core mechanics to ambient systems, and finally to advanced behavior trees—we built a deeply complex simulation in a fraction of the time it would take to build traditionally.
The best part? The game is entirely self-contained. I can open the HTML file on my laptop, turn on autoplay, and watch a digital kingdom build, battle monsters, and battle the seasons entirely on its own.
https://playground.oladipo.com.ng/merge-kingdom.html
Have you tried rebuilding any of your childhood gaming favorites using AI? What mechanics did you change? Let me know in the comments below!