The Shared Tap Turn Timer
Simulator preview
Follow instruction sequences to guide the character to the goal.
📁 Tools
▴
- Web browser (Chrome, Edge, Firefox)
- Internet connection
- Scratch 3.0 online editor
🔧 Build Your Shared Tap Turn Timer
1
Initialize a countdown variable 'timer_seconds' to 20 when the green flag is clicked.
2
Create a loop that decrements the timer every 1 second while displaying the remaining time.
3
Program a yellow warning signal when the countdown reaches 5 seconds so the user can rinse.
4
Trigger a red stop screen and a buzzer chime when the timer hits zero!
🧩 Block plan / Starter code
▴
when [green flag] clicked
set [timer_seconds v] to [20]
switch backdrop to [Green-Safe v]
repeat until <(timer_seconds) = [0]>
say (join [Time left: ] (timer_seconds))
wait (1) seconds
change [timer_seconds v] by (-1)
if <(timer_seconds) = [5]> then
switch backdrop to [Yellow-Warning v]
play sound [Beep v]
end
end
switch backdrop to [Red-Stop v]
play sound [Buzzer v]
say [Turn complete! Step aside for next friend.]
The repeat loop decrements timer_seconds each second until zero is reached.
⚗️ Test your model
| Test Condition / Action | Expected Result |
|---|---|
| Start Timer (20s) | Green backdrop active; timer counts down steadily: 20, 19, 18... |
| At exactly 5s | Backdrop switches to Yellow; audio warning beep sounds |
| Hits 0s | Backdrop turns Red; buzzer sounds; 'Turn complete!' is announced |
⚑ Try a challenge
Add an 'Add 5 Seconds' emergency button for pupils washing muddy hands after sports!
❓ Quick check
How many times does a 'repeat 30' loop with a 'wait 1 seconds' block inside it execute?
📖 Our Story & Concepts
When dozens of pupils wash their hands before school lunch, everyone needs sufficient time to lather with soap and rinse thoroughly, but no single pupil can hoard the water tap all afternoon.
A visual countdown timer acts as a fair, automated referee. Giving users a 5-second warning before stopping allows them to finish gracefully instead of cutting them off abruptly. This project introduces loops, time delays, and multi-stage status indicators.
</> Full Annotated Code Walkthrough
// Complete Shared Tap Station Timer with Reset Control
when [green flag] clicked
broadcast [reset_tap v]
when I receive [reset_tap v]
set [timer_seconds v] to [20]
switch backdrop to [Green-Safe v]
say [Press Space to start 20s handwash timer.]
when [space v] key pressed
repeat until <(timer_seconds) = [0]>
wait (1) seconds
change [timer_seconds v] by (-1)
if <(timer_seconds) <= [5]> and <(timer_seconds) > [0]> then
switch backdrop to [Yellow-Warning v]
play sound [Pop v]
end
end
switch backdrop to [Red-Stop v]
play sound [Buzzer v]
say [Turn finished! Next pupil please.]
The repeat loop decrements timer_seconds each second until zero is reached.
▷ Expected Results & Troubleshooting
| Test Condition / Action | Expected Result |
|---|---|
| Start Timer (20s) | Green backdrop active; timer counts down steadily: 20, 19, 18... |
| At exactly 5s | Backdrop switches to Yellow; audio warning beep sounds |
| Hits 0s | Backdrop turns Red; buzzer sounds; 'Turn complete!' is announced |
⚑ Extension Challenges & Blueprints
⚑ Extension Challenges
- Level 1: Change the total timer length to 30 seconds for deep surgical handwashing.
- Level 2: Display an animated soap bubbles sprite that pops when the timer reaches 0.
- Level 3: Add a Reset button (R key) so the teacher can restart the timer instantly.
❓ Check Your Understanding
Question 1: How many times does a 'repeat 30' loop with a 'wait 1 seconds' block inside it execute?
Question 2: What costume color should our tap timer display when only 5 seconds remain on a pupil's turn?
Question 3: What happens when the countdown timer reaches zero (0 seconds)?
Question 4: Why is a digital turn timer fairer than having pupils guess how long they have been using the tap?
Feedback appears after you check your answer.