How do I add Clock Time to a Global Variable?

0 favourites
  • 3 posts
From the Asset Store
Kids Game
$49 USD
New Sounds Added Update: 115 new sound effects added for no additional cost!
  • I'm NOT trying to store a score I'm trying to store a time, and since the Global Variable is set to 0 it keeps showing zero. My game is time-based so the faster you finish the level the better so I want to keep track of the time when the level ends so I can store how long it took each time but the faster time is stored over the slower time and saved in local storage and displayed in the Fastest time txt.

    I have my Game Time witch is tracked by -

    "Game Timer: "&Minutes&":"&zeropad(floor(Seconds),2)

    Which gives me this 0:00

    I feel like I'm bypassing the GV but I don't know how to send it there to store the GV value.

    Thank you in advance for your time.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It would be simpler if you posted your project, this way we could answer your question accordingly to how you setup your project.

    You normally have some variable in which you keep your global time in seconds, and that you then display as a 00:00 format. In your code, you apparently have a "Minute" variable, as well as a "Second".

    Save the time in seconds (all seconds passed since the beginning of the level), and keep the display format as a way to display your time from your "total seconds elapsed" variable.

    In the end, it is like a score, a floating number that you display on screen in a meaningful format (00:00).

  • Kyatric Understood, and I thank you for your time. I found a video that may help me. It's not exactly what I want but it will get the mechanics part of working and I can live with that. It actually goes with what you said so again thank you.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)