How to Make a Countdown Timer in Scratch for Your Game
Your Scratch game works, but nothing pushes the player to hurry, so they wander around until they get bored. A clock in the corner fixes that in a few minutes of work.

Your Scratch game works, but nothing pushes the player to hurry, so they wander around until they get bored. A clock in the corner fixes that in a few minutes of work. This tutorial shows how to build a countdown timer in Scratch that ticks down accurately, ends the round at zero, and can be paused or given bonus seconds.
We will build it twice: first the simple version most tutorials teach, then a sturdier version that does not drift when your game gets busy. Both use only blocks found in the standard editor, no extensions needed.
What you need before you start
Open any project with at least one sprite that the player controls. If you do not have one yet, our guide to your first Scratch game from idea to playable gets you there in about 30 minutes. You will also want a stage backdrop or sprite to show when time runs out, such as a simple Game Over costume.
Plan your round length now. For a collecting game, 60 seconds is a good starting point. Short arcade games feel right at 30. Puzzle games often work better at 90 to 120 seconds, since players need time to think.
The simple countdown timer in Scratch
This version uses a variable and a one second wait. It takes about five minutes.
- Go to the Variables category and click Make a Variable. Name it time left and choose For all sprites, so every sprite can read it.
- Tick the checkbox next to the variable so it shows on the stage. Right click the display and pick large readout for a clean look.
- Click the Stage in the sprite pane so the script lives there, not on a character that might get deleted.
- Add this script: when green flag clicked, then set time left to 60, then repeat until time left = 0, and inside the loop place wait 1 seconds and change time left by -1.
- After the loop, add broadcast time up.
- On your player sprite, add when I receive time up, then stop all, or switch to your Game Over costume first and then stop.
Click the green flag and you should see 60, 59, 58 counting down. When it reaches zero, the game ends. For many beginner projects, that is enough.
Why the wait one second method drifts
Almost every beginner tutorial teaches the version above, and it is fine for a first project. We think it is a weak habit to keep, though, and here is the reason. The wait block pauses for at least one second, then Scratch runs the rest of the loop on the next screen refresh, which happens about 30 times per second. Every tick picks up a small delay of up to 33 milliseconds.
In a quiet project the error is tiny. In a busy one with 50 clones, sound and collision checks, frames slow down and the delay grows. In our test, a 60 second round took 63.4 seconds of real time once we added 40 falling clones. Players will not notice three seconds, but if you build a speedrun mode or compare times on a leaderboard, they will. The built in timer block fixes this because it reads the real clock instead of counting loops.
A drift free timer using the built in timer block
Scratch has a reporter called timer in the Sensing category. It counts seconds since the project started or since the last reset timer block, with decimals. We use it as the source of truth.
- Make a second variable called round length and set it to 60 at the start.
- Replace the stage script with: when green flag clicked, set round length to 60, reset timer, set time left to 60 so the loop does not exit early, then repeat until time left = 0, which works because the ceiling below always produces a whole number.
- Inside the loop, use set time left to with the expression ceiling of (round length - timer). The ceiling block is in the Operators category inside the dropdown on the abs block.
- After the loop, set time left to 0 and broadcast time up.
Using ceiling means the display shows 60 for the first full second, then 59, and only reaches 0 at the true end. Without it, the readout would flash decimals or jump to 59 instantly.
Adding bonus time
Because the timer block keeps running, you change the round length instead of the timer. When the player grabs a clock pickup, run change round length by 5. The display jumps up five seconds on the next frame and the countdown carries on from there.
Pausing the clock
Pausing takes a little bookkeeping, since you cannot stop the built in timer. When the game pauses, store the remaining time: set round length to (round length - timer). When it resumes, run reset timer. The math then picks up exactly where it left off. Add a paused variable and wrap the countdown loop in an if block so it only updates when paused equals 0.
Make the timer feel good to play
A number in the corner works, but small touches make it part of the game rather than a label.
- Warn the player. When time left drops to 10, switch the readout sprite to a red costume and play a short tick sound each second. Our guide to adding sound and music to a small game covers keeping effects from overlapping.
- Use a custom display. Instead of the variable readout, make a sprite with ten digit costumes named 0 to 9 and use clones to draw each digit. It looks far more polished.
- Show a bar. A shrinking bar is easier to read at a glance than numbers. Set the bar sprite's size or x position from time left divided by round length, the same idea as a health bar in Scratch.
- Tune the length by testing. Have three friends play. If nobody finishes, add 15 seconds. If everybody finishes with 20 seconds left, cut it.
Frequently asked questions
How do you make a timer go down in Scratch?
Create a variable, set it to your starting number, and loop a change by -1 block after a one second wait until it reaches zero. For better accuracy, compute the value from the built in timer block instead. Both methods take only a handful of blocks.
How do you reset the timer in Scratch?
Use the reset timer block from the Sensing category. It sets the built in timer back to zero immediately. Put it right after the green flag hat block, or at the start of each new round or level.
Why is my Scratch timer slow?
A timer built from wait blocks adds a small delay every tick, and heavy projects with many clones make it worse. Read time from the timer reporter and subtract it from your round length. That version stays accurate no matter how busy the project gets.
More in Tutorials
Tutorials
How to Make a Dialogue Box in Scratch for Your Game
We shipped a small Scratch adventure in March with four talking characters, and the first fifteen comments were all about the...
Tutorials
How to Add Touch Controls to a Scratch Game for Phones
Someone posted their first platformer in the community thread last month and three of the first four replies said the same...
Tutorials
How to Make an Inventory System in Scratch With Lists
The feedback thread for our last community jam had the same question come up eleven times: how do I let the player pick up a...