Real-Time Upgrades

0 favourites
  • 3 posts
From the Asset Store
An educational game for Times Table. An easy to use template for developers to build larger games
  • Hello again,

    I was wondering if it would be possible to create real-time upgrades. For example you can click the upgrade button, the game waits however long (i.e. 1 day), and then the item gets upgraded. The twist is that you will have to be able to shut your device down/ close the tab, and then when you re-open it, it will take however much time has passed. Also, would it be possible to add some coins to a mine every so often, and then when you click/ touch the mine you get that amount? Again, it must be in real time. Would the best way be to read the device's date and time, and then when you log on it compares the date and time from when you started and the current time and date to see how much time has passed. Thanks.

  • You can use unixtime expression. It's a real-time clock on the device.

    When the upgrade button is clicked, save unixtime in local storage.

    To check how much time has passed:

    int((unixtime-saved_unixtime)/1000)=number of seconds

    int((unixtime-saved_unixtime)/60000)=number of minutes

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I will give that a try. Thank you!

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