How do I get offline time?

Get help using Construct 2

Post » Wed Jan 11, 2017 1:02 pm

i am making a clicker game, and i need to know how much time (in seconds) the player was offline. With the offline i can give "Offline time money". :)
B
13
S
1
Posts: 58
Reputation: 701

Post » Wed Jan 11, 2017 1:51 pm

In the browser object, you have an event "on went offline" and "on went online". Just start a timer when "on went offline" triggers.
B
33
S
6
G
1
Posts: 355
Reputation: 2,850

Post » Wed Jan 11, 2017 2:09 pm

This is one way:

When the player quits the app just save the date and time and when the player starts the game again then just take the actual date and time and compare it with the old stored date and time to get how much time has passed.
B
58
S
25
G
14
Posts: 793
Reputation: 13,302

Post » Thu Jan 12, 2017 12:01 pm

Anonnymitet wrote:This is one way:

When the player quits the app just save the date and time and when the player starts the game again then just take the actual date and time and compare it with the old stored date and time to get how much time has passed.


yeah, but how i do that?
B
13
S
1
Posts: 58
Reputation: 701

Post » Thu Jan 12, 2017 12:09 pm

You can use Rex plugin here: plugin-system-date-and-time_t63492?&hilit=date+and+time+rex

It even has a built in system for getting the elapsed time which you can use.
B
58
S
25
G
14
Posts: 793
Reputation: 13,302

Post » Thu Jan 12, 2017 12:24 pm

Anonnymitet wrote:You can use Rex plugin here: plugin-system-date-and-time_t63492?&hilit=date+and+time+rex

It even has a built in system for getting the elapsed time which you can use.



thanks man, there is any example capx?
B
13
S
1
Posts: 58
Reputation: 701


Return to How do I....?

Who is online

Users browsing this forum: Elliott, Google [Bot] and 34 guests