Timer even when game is closed

Hey all,

How can i make a timer (30min) that adds a +1 to a global variable.
This timer needs to run down time, even when the app is closed down.

How to do this?

You can’t ask the game to do something when it’s not running.
So you need to find another way. You can probably compare date and time before closing and after opening.

I thought about that. But how can i check that. I could not find it in gdevelop. So how do i do that? It does’nt have to be necessarily server side, i dont mind if it can read only the device time & date.

Thanks for your answers, i highly appriciate it!

Here are the time functions you can use:
http://wiki.compilgames.net/doku.php/gdevelop5/all-features/expressions-reference#time

2 Likes

I see what you’re saying. It’s like the sims freeplay or something, where the time just keeps going even while off of the game. Tons of apps do this. This is something I wouldn’t mind knowing as well

1 Like

I really need help with this. I tried Time(hour) to test if i could show the time. I can’t find on the wiki what im looking for.

This thread might help Clock with Date and Time you would have to store the time you stopped the app in a variable, then get the new time when it opened again - calculate how long App had been closed and process whatever data needed updating to that time…

1 Like