How do I can Calculation time when player is exit the game?

Get help using Construct 2

Post » Sun Jun 19, 2016 9:04 pm

i click a button and a flower gonna to build 3 hours later and i exit the game game.
1- i back 2 hours later and i want system Calculation time and show me remaining time?
2- i back 4 hours later and i want system build flower and increase value?
B
11
S
4
G
3
Posts: 50
Reputation: 2,431

Post » Mon Jun 20, 2016 5:28 am

do you use text box to show the 3 hours before?
is that after the button is click? i mean if you use text box as a thing to show your time , do you put it at Event (Button click)
or (every tick)- should use this one
2- after the time is finish like global varible is equal 0 , the set value . is that it?
B
13
S
5
G
4
Posts: 119
Reputation: 3,353

Post » Mon Jun 20, 2016 5:52 am

i use text box for showing time . but i can't Calculation time and minus from origin time?
B
11
S
4
G
3
Posts: 50
Reputation: 2,431

Post » Mon Jun 20, 2016 6:03 am

@sadism so the timer? it is based on a global variable ?
B
13
S
5
G
4
Posts: 119
Reputation: 3,353

Post » Mon Jun 20, 2016 6:12 am

yes it is.
B
11
S
4
G
3
Posts: 50
Reputation: 2,431

Post » Mon Jun 20, 2016 6:19 am

Here is a solution in scirra store, or uses this plugin to get elapsed interval of turned off game directly, or uses this plugin to get current time then do other things by yourself.
B
109
S
27
G
277
Posts: 4,481
Reputation: 154,922

Post » Mon Jun 20, 2016 6:30 am

@rexrainbow thank's for answer. i used your plugins but i couldn't set it

https://drive.google.com/open?id=0BxuM6 ... U11d0I2dW8

this is my exp. i can save global value but i can't save arrays for checking .
B
11
S
4
G
3
Posts: 50
Reputation: 2,431

Post » Mon Jun 20, 2016 6:49 am

Saving the content of an array is another problem.
Get content of an array by Expression:AsJSON , then save it in localstorage. See the document of official array.
B
109
S
27
G
277
Posts: 4,481
Reputation: 154,922


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], TheCrazyPrince and 28 guests