• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML Real Time Upgrades

A

AndrewCampbell

Guest
Hi,

I was wondering if it is possible to use GMS2 to code a real life timer into an app that runs even when the app isnt open. (Such as how an upgrade in the popular game Clash of Clans can take 2+ days in real time).

I cannot think of code I would use to even start this, which is bugging me.

Any sample code or suggestions on how to do this would be greatly appreciated!



---------------------------------------------------------------------------------------------------------------------------------------------------
Andrew Campbell

Check out my work on the Apple App Store
www.ACDev.biz
 

2Dcube

Member
Simply save the current time when you want the timer to start, and check it again when they come back to the app.

If you didn't know already look up how to save to a ini file in the manual.
And look up date_current_datetime();

I don't think there is a way for Game Maker to really run a timer when the app is not open.
Checking and comparing time stamps is the easiest, but can be cheated by users simply changing their device's time. However I don't think most people would go through that trouble?

Some games check the time on a server to prevent cheating, but that's a lot more work to set up and requires an internet connection.
 
Top