Stoppable Timer
Материал из Поле цифровой дидактики
This tutorial explains how to make a stoppable timer.
Programming
Three variables are needed:
— the custom timer
— the timer to be incremented while the custom timer is paused
— a boolean that determines whether the custom timer is paused
Three broadcasts are used:
- "reset" — resets all counters
- "stop" — pauses the custom timer
- "start" — starts the custom timer
Example Uses
A few possible uses for a stoppable timer include:
- A racing game
- Timed events
- Pausing while using a timer