Timer show remaining time

Hi! I am working on a game that you collect items in under 2 minutes. If time runs out it goes to a certain slide. If the person collects all items under 2 minutes, I would like the timer to stop and then show the remaining time on another slide. How do I do that? Thanks!

This is a bit more complex.
Again, I personally would work with JavaScript but it may be a bit easier to use native actions.
Time running out is a bit easier. If you are using the animated timer interaction and If that is all you need… just do a timer complete action.

In the case where all objects are found before time is up - I would stick to JavaScript for the control and build my own timer rather than using the animated timer via the GUI.
I don’t have time at the moment to work up the example but can perhaps later in the day.

Hopefully this helps get you started.

In this setup, I have JavaScript in three places.

  1. onLoad
  2. On a Begin Button
  3. On a click object

In the onLoad area I execute some JavaScript

// function for the countdown timer
// this function counts down, checks if all found by using totalScore
// and it checks if the timer has reached zero
window.countdown = function() {
    if (prez.variable("totalPoints") >= 1000) {

    if (prez.variable("myTimer") == 0) {

Next we have the begin button.

// this code starts the timer and disables the button
// button is disabled because clicking it again would speed up countdown

Finally we have the click object.

// Here we just add points for the object.

You might consider disabling or hiding all your objects at the start and use the begin button to re-enable or show them so that learners are not allowed to click on objects prior to the timer starting.

Hopefully this helps.


Hi @Kimberly_Wymer,

Your game logic appears to be similar to that of the “Defuse the Bomb” game: https://www.youtube.com/watch?v=gKlMrIRxwuA. You can refer to the project linked in the video description for more details.

I used the default events and actions along with JavaScript code to pause and hide the timer and audio.


1 Like