How to make power-up recharge timer persist when game is closed?

Not favoritedFavorited Favorited 0 favourites
  • 2 posts
From the Asset Store
75 power-up sound effects; bonus and notification sounds, fanfares, harp glissandi, stabs, clock ticks, etc.
  • Hi all,

    For my game I want to implement a power-up that takes a few hours to recharge before it becomes available again.

    How can I make the recharge timer continue even when the player closes the game? For example, if the power-up takes 3 hours to recharge and the player exits the game, I want it to be ready when they return after 3 hours.

    What’s the best way to store and compare time so the timer syncs correctly when the game is reopened?

    And also important, how to avoid cheats like changing the local time on devices.

    Thanks in advance!

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi. Record the time when you activated the bonus in local storage. After loading, check the saved time and the current time. If more than 3 hours have passed, activate the bonus.

    Fraud is a little more complicated; you will need to take the time from some server on the Internet. But I wouldn't waste my energy on it if it doesn't ruin the game for other players.

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