How to Create a 2048-Style Puzzle Game with AI

You've probably played 2048 before, the game where you combine numbers to reach that famous tile. Millions of players, over the years, have loved it. Its success comes down to how simple it is to understand, a clear goal, and a difficulty that's perfectly balanced to feel satisfying. Today, with AI, you can have your own version of the game in a few minutes, without writing a single line of code.
What makes a good puzzle game
Before asking the AI for anything, lay out the rules of the game. You need a grid (usually 4×4), numbered tiles that appear as you play, and a slide in four directions that pushes all the tiles at once. When two identical tiles touch, they merge into one worth double. The score goes up with every merge, and the game ends when the grid is full.
Those are the rules to give the AI. The more precise you are, the less it makes up on its own.
The prompt to copy to create your 2048
This prompt asks for the right format straight away, a single HTML file, along with the touch controls you need on mobile:
Create a 2048-style puzzle game in a single standalone HTML file (HTML, CSS and JS included, no external resources). Portrait 9:16 format. 4×4 grid: identical tiles merge when you slide (touch swipe and keyboard arrows). The score is the sum of the merges, shown at the top. A new tile appears after every move. Game over screen when the grid is blocked, with a "Play Again" button. Add smooth movement and merge animations, and a distinct color for each value.
And there you go, you have your 2048. Open it, test it, and move on to the next step. If you want to understand the logic behind this kind of prompt, our guide on creating a game with ai covers it all from the start.
Iterating to make your game really enjoyable
The first version works, but it's by tweaking it that your game becomes really fun. Stay in the same conversation and send these requests one by one:
- The feel. "Add a small pop animation when a tile appears, a light effect when two tiles merge, and show the points gained floating up."
- The urge to replay. "Add a best score kept during the session and a message when it's beaten."
- Mobile. "Make sure the swipe feels smooth under the finger, that the tiles are easy to read on a small screen, and that the page doesn't scroll while playing." This is often the one that changes the most, because AIs think of the keyboard first.
You'll find more prompts in this style to improve your game in our article on prompts to create an html5 game.
Customizing your 2048 to stand out
The classic 2048 already exists. If you want a game that leaves a mark, a few changes are enough to give yours its own identity:
- The tiles. Replace the numbers with emojis, animals or a themed evolution (seed, sprout, flower, or egg, baby dragon, dragon, etc.).
- The grid. Go 5×5 for more chaotic games, or 3×3 for quick ones.
- The goal. Nothing forces you to aim for 2048.
Just describe your idea to the AI, for example "replace the numbers with a creature evolution, from egg to dragon", and it takes care of adapting everything. If you want to revisit another classic with the same method, our guide to creating a snake game with ai works the same way.
Publishing your puzzle online
Whatever theme you pick, you end up with a standalone HTML file that contains all of the game's JavaScript. The catch is that as long as it stays on your computer, you're the only one who can play it. That's where Hoora comes in: you import your file and it becomes playable online by the whole community.
Go to the website and click the purple "Import" button in the left-hand menu.

- Drop in your HTML file, and a playable preview appears right away.
- Add a title and a description.
- Publish.
It's free, and the only limit is a maximum file size of 100 KB. Want the details of each step? It's all in our article on publishing your ai creations.

Once published, your 2048 shows up on your creator profile, with its stats: views, likes, shares, comments.

This kind of game does very well on Hoora, and this format has already passed 40,000 views on the platform. Most of those games are played on phones, through the app available on Android and iOS, which you can also find on Gizmodo's download page.
Frequently asked questions
- Do you need to know how to code to create a 2048 with AI? No. The prompt above is enough to get a playable game: you copy it, paste it, and get the file back.
- Which AI should you use? ChatGPT, Claude, Gemini or Mistral, they all do the job. The result depends mostly on your prompt and the tweaks you make.
- My game doesn't handle swipes well on mobile, what can I do? Ask the AI to smooth out the touch controls and block page scrolling during play. Then check on your phone, and our guide to testing an html5 game on mobile shows you how.
- Can I change the rules or the theme? Yes. Grid size, goal, tile look: describe your version to the AI and it adapts it.
- How big is a game like this? A few dozen kilobytes, well under the import limit, since everything is drawn in CSS with no external image.
- Where do I publish my puzzle once it's made? On the Hoora website, with the "Import" button. It becomes playable by the community, with no hosting to set up.
Now that you know how to make your own 2048, try your hand at new games and create your own version of your favorite ones.