How to Build a Cookie Clicker Game
Vibe code a clicker game where every tap earns cookies, upgrades earn them for you, and the numbers grow to silly sizes.
About this tutorial
A cookie clicker is the simplest game there is: click a thing, a number goes up. What makes it addictive is what comes next, upgrades that click for you, prices that rise, and numbers that grow so big they need names like million and billion.
Building one teaches you about variables, timers and balance. You will set a price for each upgrade, test whether the game feels too slow or too fast, and adjust the numbers until progress feels just right. That balancing act is real game design work.
What you need
Step by step
- 1
Describe the game
Prompt: build a cookie clicker game with a giant cookie in the middle and a score counter above it
- 2
Make the click count
Every click adds 1 cookie and the counter updates instantly
- 3
Add juice
Ask for the cookie to squish when clicked and for a small plus one to float up and fade
- 4
Open a shop
Add a shop panel on the right with one upgrade called Extra Fingers that costs 10 cookies
- 5
Make it pay off
Extra Fingers makes each click worth 2 cookies instead of 1
- 6
Add an auto clicker
Add Grandma for 50 cookies that earns 1 cookie every second without clicking
- 7
Raise the prices
Each time you buy an upgrade its price goes up by about 15 percent
- 8
Format big numbers
Show 1200 as 1.2K and 3400000 as 3.4M so the score stays readable
- 9
Add milestones
Pop a message at 100, 1000 and 10000 cookies to celebrate progress
- 10
Save the game
Save the score and upgrades so closing the tab does not lose progress
- 11
Balance it
Play for two minutes, then change prices or earn rates so it never feels stuck
- 12
Publish it
Publish your clicker and challenge friends to reach one million cookies
Screenshots
Fun facts
How do you build a cookie clicker game step by step?
Build the loop before the polish. Get a click adding to a counter, then add one upgrade, then one auto earner, then price scaling. Only once the loop feels good should you add particles, sounds and themes. If you decorate first, you will not be able to tell whether the game is fun or just pretty.
How do you balance upgrade prices in an idle game?
A good rule is that the first upgrade should be reachable in under 20 seconds, and each purchase should raise the price by 10 to 20 percent. Test by playing for two minutes and asking whether you always know what you are saving up for. If you ever feel stuck with nothing to buy, prices are too steep.
What does a clicker game teach about coding?
Counters teach variables, upgrades teach conditionals and state, auto earners teach timers and intervals, and price scaling teaches multiplication and growth. Saving progress introduces the idea of storing data between sessions, which is the very beginning of thinking about databases.
How can you make your clicker feel original?
Change the theme, the upgrade names and the celebration moments. A slime clicker with squelch sounds, a space clicker where upgrades are rockets, or a homework clicker with funny excuses all play the same but feel completely different. Personality is the cheapest upgrade in game design.
Need help?
My upgrade button lets me buy things I cannot afford, what is wrong?
Ask the chat to check the cost before buying: only subtract cookies and apply the upgrade if the score is greater than or equal to the price, and grey the button out when it is too expensive.
The game gets boring after a minute, how do I fix it?
Boredom usually means the next goal is too far away. Add a cheap upgrade early, a new upgrade type every few levels, and a visible progress bar toward the next milestone.
Why do my numbers turn into things like 1.0000000002e21?
That is scientific notation from very large numbers. Ask for a number formatter that shows K, M, B and T so the score always reads cleanly.
Can I reskin it as something other than cookies?
Yes, that is the fun part. Ask to swap the cookie for a pizza, a slime, a capybara or a planet, and rename the upgrades to match your theme.



