Help how to have a global timer?

Hello.

I need help with how to have a global timer. What I’m trying to do have player plant seeds in their game and have them wait a certain time for the plant to grow. So while they wait they can play other instead of waiting in the same area they can just do other stuff.

Does anyone know how to apply this method? [import]uid: 17058 topic_id: 30381 reply_id: 330381[/import]

Easiest way would be saving system time and checking again when reloaded. [import]uid: 52491 topic_id: 30381 reply_id: 121774[/import]

Oh so use os.time for counting time for some thing to grow.

So can I use ego to transfer that timer across different scenes? [import]uid: 17058 topic_id: 30381 reply_id: 121776[/import]

Yes you could save the time passed across different screens/scenes, although really I’d probably save it to a file when you exit or suspend the app then recheck it when app is opened again. You could also check to make sure it hadn’t gone *back* in time to avoid any cheating :slight_smile: [import]uid: 52491 topic_id: 30381 reply_id: 121942[/import]

Easiest way would be saving system time and checking again when reloaded. [import]uid: 52491 topic_id: 30381 reply_id: 121774[/import]

Oh so use os.time for counting time for some thing to grow.

So can I use ego to transfer that timer across different scenes? [import]uid: 17058 topic_id: 30381 reply_id: 121776[/import]

Yes you could save the time passed across different screens/scenes, although really I’d probably save it to a file when you exit or suspend the app then recheck it when app is opened again. You could also check to make sure it hadn’t gone *back* in time to avoid any cheating :slight_smile: [import]uid: 52491 topic_id: 30381 reply_id: 121942[/import]