Timer

Just started using Construct 2? Post your questions here

Post » Wed Apr 19, 2017 7:19 am

Hi
How can we add a timer which even runs when we are not playing the game?
I mean suppose we have a button on clicking this button 15 points should be added to he score and this button should be enabled only after some time (say 1 hour).Please help me.
Thanks in advance
B
23
S
8
G
1
Posts: 35
Reputation: 2,095

Post » Wed Apr 19, 2017 8:15 am

B
17
S
6
G
1
Posts: 41
Reputation: 1,725

Post » Wed Apr 19, 2017 8:56 am

Thanks but is there any other way
B
23
S
8
G
1
Posts: 35
Reputation: 2,095

Post » Wed Apr 19, 2017 9:28 am

Hmm, Geolocation object has timestamp which you might be able to use.
Edit: Also https://www.scirra.com/tutorials/940/ho ... -a-project might help
B
17
S
6
G
1
Posts: 41
Reputation: 1,725

Post » Sat Apr 22, 2017 4:11 am

The expression Browser.ExecJS("Date.now()") will get you Unix time in milliseconds. You can keep track of this by regularly saving it to local storage, and upon starting up your app you can compare the difference between the saved time and the current time to see how much time he passed.
Mistakes were made.
B
53
S
27
G
114
Posts: 1,697
Reputation: 64,442


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 5 guests