Increase Score even if game is closed.

I am making a cookie clicker like game and I want the score to increase even if the game is closed. The game is for android. I have no idea how I could actually do that and there’s little to none info on this subject.

Have you tried this?

Edit: Oh sorry, I misunderstood and thought you meant updating the score when closed, opposed to increasing the score while closed.

Perhaps you use OnApplicationQuit and store the time when the game is closed, then compare that to the time when the game is started. You could just extrapolate the score based on the time that has elapsed.

2 Likes

Learn the System namespace (or at least System.DateTime and System.TimeSpan)

I’ve replied to this question before, the way it’s done is what Yash said: record the time the app was closed when it is closed, then when it is next opened, you know how much time has elapsed, so you increment the score based on how much time has passed.

Thanks all, i’m going to try that thing and see if I get a result.

You may also wish to verify the time against a server somewhere. Device time can be manipulated.

1 Like