How to make a unstoppable timer

Get help using Construct 2

Post » Tue Jul 07, 2015 10:05 am

I am using construct 2 r200 and i need to make a timer that starts running when you enter a mode in my game and then you cannot enter that mode again till the timer is done, and this timer should continue running even if you close the game. :lol: any ideas?
B
6
Posts: 38
Reputation: 338

Post » Tue Jul 07, 2015 12:37 pm

Hi,

you have to capture the start datetime of a timer and save it with LocalStorrage.
then you have to compare the start datetime with the actual date.

you can do this in different ways. one way would be to make a ajaxrequest to a php file, which returns the current date (pretty easy)
another way would be to use https://www.scirra.com/tutorials/940/ho ... -a-project

i personally would use the php and work directly with unix time stamp.

kind regards
Patrick
B
19
S
7
G
1
Posts: 222
Reputation: 2,546

Post » Tue Jul 07, 2015 12:42 pm

Hello,
Thanks for your help, I really needed a solution.
B
6
Posts: 38
Reputation: 338


Return to How do I....?

Who is online

Users browsing this forum: mageekm and 27 guests