You are browsing as a guest. Sign up (or log in) to start making projects!

Open comments for this post

2h 26m 52s logged

How I spent 3 hours making a clicker game and lost my mind
I sat down yesterday thinking, “A basic Cookie Clicker clone will take me 1 hour top.” Three hours later, I have 15 buildings, a full prestige system with a separate diamond shop, and a main JavaScript file named scrpit.js that I refuse to rename because I’ve accepted my typo as a feature.
What happened in those 3 hours?
Hour 1: Making it look shiny.
Before writing any actual game logic, I spent way too long tweaking CSS. I added glassmorphism to the menus, gave the main button a fake 3D shadow that squishes when you click it, and added a neon glow that pulses behind it. The game didn’t work yet, but clicking that empty button felt good.
Hour 2: Feature creep.
I started with 5 buildings, then thought, “let’s add synergies where buying 10 of the same building doubles its output.” Then I added Golden Cookies that spawn randomly to give you a x777 click frenzy (yes i got it from Cookie Clicker).
Hour 3: The Prestige System.
I decided to add a reset mechanic. Once you hit 1 million points, you can reset for Diamonds. But instead of a boring flat multiplier, I built a whole separate Diamond Shop where you spend your hard-earned gems on permanent upgrades that carry over into your next run. Getting the localStorage save function to remember both your normal run AND your permanent prestige upgrades was… chaotic.

The Code
It is absolute spaghetti, but it works.I used innerHTML += to render the building shop because I was too lazy to do proper DOM manipulation. I wrote manual for loops to search through arrays instead of using .find() because my brain was fried.
The only “clean” thing I did was implement a proper requestAnimationFrame game loop with Delta Time so your passive income doesn’t break if you minimize the browser tab. The game is completely unbalanced and the numbers get stupidly huge, but it was a fun 3 hours. Check out the repo if you want to look at scrpit.js and judge my variable names. Let me know what CPS you can hit!

0
2

Comments 0

No comments yet. Be the first!