[SOLVED] How do I get a system time stamp?

Get help using Construct 2

Post » Fri May 23, 2014 8:49 pm

Basically I want to take a time stamp. Close the game. Then when the game next opens I want to check if so much time has elapsed.

Any ideas how I can do this?
Last edited by TheWyrm on Fri May 23, 2014 10:21 pm, edited 1 time in total.
ImageImageImageImageImage
B
19
S
5
G
1
Posts: 614
Reputation: 2,542

Post » Fri May 23, 2014 10:04 pm

ok, partially solved. I found the rex_date plugin that allows me to do date.UnixTimestamp. So I just need to subtract one from the other to get a difference in seconds.

So now I need to work out how to tell if the player has minimized the game on a mobile platform so I know when to call it.

Any ideas?
ImageImageImageImageImage
B
19
S
5
G
1
Posts: 614
Reputation: 2,542

Post » Fri May 23, 2014 10:08 pm

I was wondering if there was an on resume event which is tied to pausing on unfocus?
ImageImageImageImageImage
B
19
S
5
G
1
Posts: 614
Reputation: 2,542

Post » Fri May 23, 2014 10:13 pm

From the manual, for the browser Object:

"On suspended
On resumed
Triggered when the page's visibility changes, or when a mobile app is going in to the background or foreground. When invisible or in the background the app is suspended: all events stop running and all audio is muted."

https://www.scirra.com/manual/110/browser
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Fri May 23, 2014 10:21 pm

Cheers, I had just found it, but thanks for the confirmation :)
ImageImageImageImageImage
B
19
S
5
G
1
Posts: 614
Reputation: 2,542


Return to How do I....?

Who is online

Users browsing this forum: Kyatric, Yahoo [Bot] and 45 guests