Timer like candy crush

Hi,

somebody help me how to make a timer?

timer like in Candy Crush for generating a life :slight_smile:

in my case, every 15mins. i should increment the Energy of the player. hhmmm that is not hard enough

but the hard thing to do is even the application is not active

it should still count the :frowning: so, when i closed the application for 3o mins, and open again, i should genarate 2 energies :frowning:

please help me and give some suggestions, thanks!!!

The basic thing what you need - is to save level of Energy and time when it was changed last time. You should save it local or at webserver depends on the architecture of your game. When player will run your game again, you should restore this values, compare with current time (local or at the webserver), and increment Energy.