Multi-Resolution Game Development With GameBuilder Studio Check it out!
NEW Version 0.9.7 has arrived! New Blazing Fast Particle Engine & More Game Actions. Check it out
A system to get time and date from the pc.
  • Hi guys! I want make a clicker game... You know. And i want know how to make offline time counting... Like the game is closed but the money still encreasing. So i think the best way its get the time ande date from the pc, then use an global variable to subtract the date on the last login and this login, then multiply with the money per second.
    Someone help me how to get time and date from the pc please!
  • 4 Comments sorted by
  • @sonic the ideal way to achieve something like this would be to use a backend server to keep track of time as it passes. The Roar Engine plugin was great for this but they have since moved to a self install process where you have to buy a server license and install the server your self.

    However you can get the current system time in milliseconds from the global Game.Time.gameTime property. You could store that and then calculate how much time has passed since the last value was stored.
  • Really thanks!
  • @Lavon Well, but when the program is closed, the global with the Game.Time.gameTime propriety will not count right? So the only way it´s just have a server.
  • @Sonic you could store the gameTime then when you load the game again check the difference of the values and calculate the increase in money based on how much time has passed since the last time save. This only works per platform tho. So if the player erased the game data or something you would loose it on the device unless you saved the time and the money to a database server. Using a service like Playfab or your own backend server and the URL Loader action.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Tagged