๐Ÿฑ My First Scratch Game ยท Episode 5 of 6 ยท See All Episodes
๐Ÿ–ฑ๏ธ Episode 5 ยท Click ยท Upgrades ยท Auto-Earn ยท Multiplier

Click Frenzy!
Idle Clicker Game

Click a big button to earn coins, spend them on upgrades that earn automatically, and keep growing your coin empire. A classic idle clicker built entirely in Scratch!

๐Ÿ‘ถ Ages 8+ โฑ๏ธ ~1.5 Hours ๐Ÿฑ Scratch โœ“ Free
๐Ÿ“ฆ Variables ๐Ÿ” Loops ๐Ÿ‘ฏ Clones โž• Math operators โœจ Visual effects ๐Ÿ“ก Broadcasts
โญ
0 XP
Level 1
๐Ÿ”ฅ0
Your Progress0 / 11 steps
1
๐Ÿ“Š
Set Up Variables
Create all the number trackers the game needs before building anything
Active
๐ŸŽฏ
Goal for this step

Create all variables first so they're ready to use when building each feature.

๐Ÿ‘จโ€๐Ÿ‘ง
Parent note: Clicker games are all about numbers changing over time. Every feature โ€” coins, upgrades, auto-earn โ€” is just a variable being increased or decreased at the right moment. Setting them all up first makes the rest much easier to follow.
  • 1Open scratch.mit.edu, start a new project, name it "Click Frenzy". Delete the cat.
  • 2Go to Variables โ†’ Make a Variable. Create these one by one: Coins, CoinsPerClick, AutoEarner1, AutoEarner2, Multiplier.
  • 3Keep Coins visible (ticked). Uncheck all others โ€” we'll display them differently.
  • 4Also create Upgrade1Cost, Upgrade2Cost, Upgrade3Cost โ€” these will be the prices of upgrades.
๐Ÿ’ก
Drag the Coins counter to the top-centre of the stage so it's the most prominent number on screen.
โœ๏ธConcept Fill+15 XP

In Scratch, a is a named container that stores a number or text. We keep visible on stage because it's the main score the player watches.

๐Ÿง 
Knowledge Check
+15 XP
How many variables did you create in total in this step?
A5
B6
C8 (Coins, CoinsPerClick, AutoEarner1, AutoEarner2, Multiplier, Upgrade1Cost, Upgrade2Cost, Upgrade3Cost)
2
๐Ÿช™
Create the Click Button
Draw a big clickable button in the centre of the stage
Locked
๐ŸŽฏ
Goal for this step

Add a large, satisfying button in the middle of the stage. Clicking it is the core mechanic!

  • 1Click Paint to draw a new sprite. Draw a big circle in gold/yellow โ€” about half the stage width. Add a coin symbol or star inside.
  • 2Name the sprite CoinButton. Set its size to 150 and centre it on stage.
  • 3In the Code tab, add: "when ๐Ÿณ clicked โ†’ set Coins to 0 โ†’ set CoinsPerClick to 1 โ†’ set Multiplier to 1 โ†’ set Upgrade1Cost to 10 โ†’ set Upgrade2Cost to 50 โ†’ set Upgrade3Cost to 200".
  • 4Add a second event block: "when this sprite clicked โ†’ change Coins by (CoinsPerClick ร— Multiplier)".
  • 5Also add a bounce effect: "when this sprite clicked โ†’ change size by (-10) โ†’ wait 0.05 seconds โ†’ change size by (10)".
๐Ÿช™ CoinButton โ€” Click to earn
when this sprite clicked change [Coins] by ((CoinsPerClick) * (Multiplier)) change size by (-10) wait (0.05) seconds change size by (10)
๐Ÿ’ก
Test it! Press Green Flag, then click the button rapidly. The coins should go up with every click.
๐Ÿ’ป
Code Challenge
+20 XP
Fill in the blanks to make each click earn coins based on CoinsPerClick and Multiplier:
when this sprite clicked change [Coins] by (() * ())
๐Ÿ’ก Hint: Which two variables multiply together to determine how many coins you earn per click?
โšกTrue or False?+15 XP
"when this sprite clicked" only runs when the player clicks that specific sprite.
Multiplying CoinsPerClick by Multiplier is the same as adding them together.
The bounce effect (change size by -10 then +10) is purely visual and doesn't affect coin earnings.
๐Ÿง 
Knowledge Check
+15 XP
Why do we use "when this sprite clicked" instead of "when ๐Ÿณ clicked" for earning coins?
ABecause "when ๐Ÿณ clicked" doesn't work with variables
BBecause we want coins to increase only when the player clicks the button, not when the game starts
CBecause Scratch can only have one "when ๐Ÿณ clicked" block
3
๐Ÿช
Build the Shop Panel
Draw the upgrade shop area on the right side of the stage
Locked
๐ŸŽฏ
Goal for this step

Create a shop panel sprite on the right side of the stage where upgrade buttons will live.

  • 1Click Paint to draw a new sprite. Draw a tall dark rectangle to fill the right third of the stage (roughly x: 120 to 240, full height). Use a dark colour like dark grey.
  • 2Add white text labels in the costume: "UPGRADES" at the top. Name the sprite ShopPanel.
  • 3In Code: "when ๐Ÿณ clicked โ†’ go to x: 170 y: 0" to pin it to the right.
  • 4Add a backdrop โ€” choose something simple like "Blue Sky" or paint a gradient background.
๐Ÿ”ขOrder the Steps+15 XP

Put these steps in order to build the shop panel:

Add code: "when ๐Ÿณ clicked โ†’ go to x: 170 y: 0"
Click Paint to draw a new sprite โ€” a tall dark rectangle
Choose a backdrop from the library
Add "UPGRADES" text and name the sprite ShopPanel
๐Ÿง 
Knowledge Check
+15 XP
Why do we use "go to x: 170 y: 0" in the shop panel's code?
ATo pin it to the right side of the stage every time the game starts
BTo make it move when clicked
CTo centre it on the stage
4
โฌ†๏ธ
Add Upgrade 1 โ€” More Per Click
Buy this to earn more coins with each click
Locked
๐ŸŽฏ
Goal for this step

Add the first upgrade button. Costs 10 coins. Doubles CoinsPerClick.

  • 1Paint a new sprite โ€” a rounded rectangle button. Add text: "Better Click ๐Ÿ–ฑ๏ธ" and "Cost: 10". Name it Upgrade1.
  • 2Position it in the top section of the shop panel: x: 170, y: 100.
  • 3In the Code tab: "when ๐Ÿณ clicked โ†’ go to x: 170 y: 100 โ†’ forever โ†’ if Coins โ‰ฅ Upgrade1Cost then set colour effect to 0 else set colour effect to 25" โ€” this dims the button when you can't afford it.
  • 4Add: "when this sprite clicked โ†’ if Coins โ‰ฅ Upgrade1Cost then change Coins by (-Upgrade1Cost) โ†’ change CoinsPerClick by 1 โ†’ change Upgrade1Cost by 10".
โฌ†๏ธ Upgrade1 โ€” Click to buy
when this sprite clicked if (Coins) >= (Upgrade1Cost) then change [Coins] by (-(Upgrade1Cost)) change [CoinsPerClick] by (1) change [Upgrade1Cost] by (10) end
๐Ÿ“–
Each time you buy it, the cost goes up by 10 โ€” that's the classic idle game loop! You have to keep clicking to afford the next one.
๐Ÿ’ป
Code Challenge
+20 XP
Fill in the blanks to buy Upgrade 1 โ€” deduct the cost and increase CoinsPerClick:
if (Coins) >= () then change [Coins] by (-(Upgrade1Cost)) change [CoinsPerClick] by () end
๐Ÿ’ก Hint: The condition checks if you have enough coins. Each upgrade adds 1 to CoinsPerClick.
๐Ÿ”ฎPredict What Happens+15 XP
Scenario: You have 25 coins. Upgrade1Cost is 20. You click the upgrade button. What happens to your coins and CoinsPerClick?
ANothing โ€” 25 is less than 20
BCoins drop to 5, CoinsPerClick goes up by 1, and Upgrade1Cost increases by 10
CCoins drop to 0 and CoinsPerClick doubles
๐Ÿง 
Knowledge Check
+15 XP
Why does the upgrade cost increase each time you buy it?
AIt's a bug in the code
BTo make the button change colour
CIt's the classic idle game loop โ€” upgrades get more expensive to keep the game challenging
5
๐Ÿค–
Add Upgrade 2 โ€” Auto Clicker
Earns 1 coin per second automatically โ€” forever!
Locked
๐ŸŽฏ
Goal for this step

Add an auto-clicker upgrade that passively earns coins every second without clicking.

  • 1Paint Upgrade2 button. Text: "Auto Clicker ๐Ÿค–", "Cost: 50". Position at x: 170, y: 30.
  • 2Same affordability dimming script as Upgrade1 (copy and adjust).
  • 3Buy script: "if Coins โ‰ฅ Upgrade2Cost then change Coins by (-50) โ†’ change AutoEarner1 by 1 โ†’ change Upgrade2Cost by 50".
  • 4Now create the auto-earn loop. Add a NEW script stack in Upgrade2: "when ๐Ÿณ clicked โ†’ forever โ†’ wait 1 second โ†’ change Coins by (AutoEarner1)".
๐Ÿค– Upgrade2 โ€” Auto earn loop
when ๐Ÿณ clicked forever wait (1) seconds change [Coins] by (AutoEarner1) end
๐ŸŽ‰
Buy one auto clicker and watch your coins tick up on their own โ€” the satisfying heart of every idle game!
๐Ÿ’ป
Code Challenge
+20 XP
Fill in the blanks to make the auto-earn loop add coins every second:
forever wait () seconds change [Coins] by () end
๐Ÿ’ก Hint: We wait 1 second between each auto-earn. The variable that tracks how many auto-earners you own is AutoEarner1.
โœ๏ธConcept Fill+15 XP

The auto-earn loop uses a block so it never stops running. Inside, it waits second(s) then adds the value of to Coins.

๐Ÿง 
Knowledge Check
+15 XP
What does the "forever โ†’ wait 1 second โ†’ change Coins by AutoEarner1" loop do?
AIt adds coins only when you click the button
BIt passively earns coins every second based on how many auto-clickers you own
CIt speeds up how fast the button bounces
6
โœ–๏ธ
Add Upgrade 3 โ€” Multiplier
Doubles ALL coin earnings โ€” the most powerful upgrade
Locked
๐ŸŽฏ
Goal for this step

Add a multiplier upgrade that doubles how many coins each click earns.

  • 1Paint Upgrade3 button. Text: "ร—2 Multiplier โœจ", "Cost: 200". Position at x: 170, y: -40.
  • 2Same affordability dimming script.
  • 3Buy script: "if Coins โ‰ฅ Upgrade3Cost then change Coins by (-200) โ†’ change Multiplier by 1 โ†’ change Upgrade3Cost by 200".
๐Ÿ“–
Remember โ€” the click script uses CoinsPerClick ร— Multiplier. So if CoinsPerClick is 3 and Multiplier is 2, each click earns 6 coins. Stack upgrades for explosive growth!
๐Ÿ”ฎPredict What Happens+15 XP
Scenario: CoinsPerClick is 5 and Multiplier is 1. You buy the ร—2 Multiplier upgrade, which changes Multiplier by 1 (so it becomes 2). How many coins does each click earn now?
A7 coins (5 + 2)
B5 coins (unchanged)
C10 coins (5 ร— 2)
๐Ÿง 
Knowledge Check
+15 XP
If CoinsPerClick is 3 and Multiplier is 2, how many coins does each click earn?
A5 (3 + 2)
B3
C6 (3 ร— 2)
7
๐Ÿ“บ
Add Stats Display
Show Coins Per Click, Auto Earn/sec and Multiplier on screen
Locked
๐ŸŽฏ
Goal for this step

Create a stats sprite that shows the player's current earnings numbers.

  • 1Paint a new sprite called StatsDisplay. Draw a dark rectangle for the left side of the stage. Position at x: -155, y: 0.
  • 2In Code, add: "when ๐Ÿณ clicked โ†’ forever โ†’ switch costume to [blank] โ†’ stamp" โ€” actually, use Looks โ†’ say blocks instead.
  • 3Simpler approach: tick the CoinsPerClick, AutoEarner1 and Multiplier variables in the Variables panel so they show on stage. Drag them to tidy positions below the coin counter.
  • 4Right-click each variable display on stage and choose "large readout" for Coins, and "normal readout" for the others.
๐Ÿง 
Knowledge Check
+15 XP
How do you change a variable display to "large readout" on the stage?
ADrag it to a bigger size
BRight-click the variable display on the stage and choose "large readout"
CChange it in the Variables panel settings
8
๐ŸŒŸ
Add a Milestone & Prestige
Celebrate reaching 1000 coins with a special reward
Locked
๐ŸŽฏ
Goal for this step

When coins hit 1000, show a celebration and grant a prestige bonus.

  • 1In the CoinButton sprite, add a new script: "when ๐Ÿณ clicked โ†’ forever โ†’ if Coins โ‰ฅ 1000 and Milestone1 = 0 then say [๐ŸŒŸ 1000 Coins! You unlocked a bonus!] for 3 seconds โ†’ set Milestone1 to 1 โ†’ change CoinsPerClick by 5".
  • 2Create a variable Milestone1 (hidden) so this only triggers once.
  • 3Add more milestones at 5000 and 10000 for extra rewards โ€” copy the same pattern.
๐ŸŽ‰
Milestones give players a goal to work towards and reward them with a surprise. It's one of the best feelings in idle games!
โšกTrue or False?+15 XP
Without a Milestone1 variable, the celebration message would trigger every single frame once Coins reaches 1000.
Setting Milestone1 to 1 makes the milestone reward disappear from the stage.
You can add more milestones (e.g. at 5000 coins) by creating new variables like Milestone2 and using the same pattern.
๐Ÿง 
Knowledge Check
+15 XP
Why do we use a Milestone1 variable set to 0 or 1?
ATo make sure the milestone reward only triggers once, not every frame
BTo count how many milestones the player has reached
CTo display the milestone number on screen
9
๐Ÿ’ฅ
Add Floating Coin Particles
A +1 floats up from the button when you click โ€” satisfying!
Locked
๐ŸŽฏ
Goal for this step

Create a small coin sprite that clones itself on each click and floats upward before disappearing.

  • 1Paint a tiny sprite โ€” a small gold circle with "+1" text. Name it CoinParticle. Hide it in the sprite panel (tick "hide" in properties).
  • 2In CoinButton's click script, add: "create clone of [CoinParticle]".
  • 3In CoinParticle's code: "when I start as a clone โ†’ go to [CoinButton] โ†’ show โ†’ repeat 20 โ†’ change y by 5 โ†’ change ghost effect by 5 โ†’ end โ†’ delete this clone".
๐Ÿ’ฅ CoinParticle โ€” Float and fade
when I start as a clone go to [CoinButton v] show repeat (20) change y by (5) change [ghost v] effect by (5) end delete this clone
๐Ÿ’ป
Code Challenge
+20 XP
Fill in the blanks to make the coin particle float up and fade out:
repeat (20) change y by () change [] effect by (5) end
๐Ÿ’ก Hint: The particle moves up 5 pixels each step. The "ghost" effect makes it transparent. At the end, we delete the clone.
โœ๏ธConcept Fill+15 XP

The CoinButton creates a of CoinParticle each time it is clicked. The clone runs its own script starting with "", then deletes itself after fading out.

๐Ÿง 
Knowledge Check
+15 XP
What does "change ghost effect by 5" do to the clone?
AMakes it bigger
BGradually makes it more transparent until it disappears
CChanges its colour to white
10
๐Ÿ”Š
Add Click Sound & Background Music
A coin clink on every click and upbeat background music
Locked
๐ŸŽฏ
Goal for this step

Add a satisfying coin sound on each click and looping background music.

  • 1Select CoinButton โ†’ Sounds tab โ†’ Choose a Sound. Add "Coin" or "Ding".
  • 2In the click script, add "start sound [Coin]" (not "play until done" โ€” that would pause clicking!).
  • 3Click the Stage โ†’ Sounds โ†’ add a fun upbeat loop like "Dance Around" or "Bossa Nova".
  • 4Stage code: "when ๐Ÿณ clicked โ†’ forever โ†’ play sound [Dance Around] until done".
โšกTrue or False?+15 XP
"start sound" lets the script keep running immediately while the sound plays in the background.
Background music should use "start sound" inside a forever loop.
You add sounds to a sprite through the Sounds tab, not the Code tab.
๐Ÿง 
Knowledge Check
+15 XP
Why do we use "start sound" instead of "play sound until done" for the click sound?
A"start sound" is louder
B"play sound until done" doesn't work with clicks
C"play sound until done" would pause the script and block rapid clicking
11
๐ŸŒ
Test & Share!
Play through the full upgrade loop and publish your clicker
Locked
๐ŸŽฏ
Goal for this step

Test the full upgrade loop from 0 coins to all 3 upgrades purchased, then share it!

  • 1Press Green Flag. Click until you can buy Upgrade 1 (10 coins). Buy it โ€” notice each click earns more!
  • 2Keep going until Upgrade 2 (50 coins). Buy the auto clicker โ€” watch coins tick up on their own!
  • 3Grind to 200 coins for the Multiplier. Notice the explosive growth after buying it.
  • 4Check the 1000-coin milestone triggers. Does the floating +1 particle look good?
  • 5Click File โ†’ Save now then Share. Challenge a friend to reach 10,000 coins!
๐ŸŽ‰
You built an idle clicker with manual clicking, auto-earn, a multiplier, milestones AND particle effects. That's a proper game!
๐Ÿ”ขOrder the Steps+15 XP

Click the steps in the correct order to test and share your clicker game:

Buy all 3 upgrades and check the Multiplier works
Press the Green Flag to start the game
Click File โ†’ Save now, then click Share
Click the coin button to earn enough for Upgrade 1
๐Ÿง 
Final Knowledge Check
+15 XP
Which of these is NOT a feature you built in this clicker game?
AAuto-earning coins every second
BA high-score leaderboard
CFloating coin particles
DA coin multiplier upgrade
๐ŸŽ‰๐Ÿ–ฑ๏ธ๐Ÿช™๐ŸŽŠโœจ
You Built a Clicker Game!

Coins, upgrades, auto-earn, a multiplier, particles and milestones. You've mastered variables in Scratch!

0
Total XP
1
Level
0
Best Streak
0%
Accuracy
๐Ÿ“– Episode 6: Story Game โ†’ โญ View My Progress & Certificates

This workshop was free and took many hours to build. If it helped you learn something new, consider supporting the project.

☕ Support on Ko-fi