In my mobile game the player is a rocket with a certain number of energy, and each time they decide to enter a new level, one point of energy is taken away. The player will be able to have max 20 energy points. I want to make a timer that will countdown maybe from 5 minutes, and after 5 minutes it will reward the player with one energy point and will reset itself and countdown from 5 minutes again until the player is at full energy points which is 20. However, I would like the timer to keep running even after the user closes my ios app or presses the home button. How would I be able to accomplish this?
↧