Game Design & Development · Tiny-Loop Tutorial · Archetype #3
Tutorial: Clicker Game
This is the exact Clicker Game archetype from What Makes a Game? — already built and running below. Play it, then swap the pre-built sprite, upgrade cost, and win goal using the panel underneath. You can't break the loop itself; that part is locked. Once you've tuned a version you like, you'll build this same architecture two more times: with Scratch's blocks, then from real scratch in JavaScript.
🗺️ The Architecture
Every tiny-loop game starts as a concept, then gets broken into a core loop, a systems list, and a structure — before anyone touches sprites or colors. Here's the Clicker Game's architecture:
The three systems, in order of execution on every click:
- Click system — detects a click on the target sprite and fires once per click (not held down).
- Score system — adds the current "click power" to the score, then checks the win condition.
- Upgrade system — spends score on an upgrade that permanently increases click power, and raises the next upgrade's cost.
🎮 Play & Customize
Click the sprite to earn points. Buy the upgrade when you can afford it to earn more per click. Reach the score goal to win.
Tune the Game (limited, on purpose)
Notice what you can't change here: there's no field for "how the upgrade math works" or "how clicking is detected." That's the engine — the part every version of this game shares. You're only tuning content, not rewriting architecture. That's the limit, on purpose.
What the sliders actually touch in the engine: Starting Upgrade Cost only sets the very first value of upgradeCost — the ×1.6 growth per purchase (Math.round(upgradeCost * 1.6)) is fixed either way, so a higher start just means every later upgrade costs proportionally more too. Score to Win only changes the number score is compared against; the +1-per-upgrade click power math never changes.
👀 Peek at the Code
The game running above is this code — nothing hidden. It's split into two parts on purpose: a small config object you just edited with the panel, and a locked engine that reads it.
✏️ Config — this is what the panel above editsconst config = { target: '🍪', bg: 'space', upgradeCost: 10, winScore: 100 };
👆 This block updates live — hit "Apply & Restart" above and watch the exact values change here. There's no separate "demo" version of the code; this is it.
🔒 Engine — locked, shared by every version of this gamelet score = 0, clickPower = 1, upgradeCost = config.upgradeCost; target.addEventListener('click', () => { score += clickPower; // 1. click adds current power updateHUD(); if (score >= config.winScore) endGame(true); // 2. check win condition }); upgradeBtn.addEventListener('click', () => { if (score < upgradeCost) return; // can't afford it yet score -= upgradeCost; // 3. spend score clickPower += 1; // permanently earn more per click upgradeCost = Math.round(upgradeCost * 1.6); // next one costs more });
🛠️ Now Build It For Real
You've played a working Clicker Game and seen exactly how it's built. Next, build this same architecture yourself — twice, in two different tools.
🧩 Step 1 — Build It in Scratch
The "Build the Loop with Blocks" section above already shows the exact scripts — backdrop, sprites, variables, and all three scripts, block by block, in Scratch's own category colors. Open a Scratch tab side-by-side and copy each script exactly; the game should come to life the same way it does here.
Open a blank Scratch project tab →Want more practice first? Scratch's official tutorial builds a similar click-for-points loop with a shop/upgrade system.
Open the official Scratch Clicker Game tutorial →