Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Game on real time
Started by orion.hola Nov 24 2018 12:19 AM

1 reply to this topic
time
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

orion.hola

[GLOBAL: userInfoPane.html]
orion.hola
  • Observer

  • 1 posts
  • Corona SDK

It is necessary to write the dependence of the application from real time. When closing the application, the timer should not stop.
For example: every 10 minutes the background should change or the hunger value should decrease every minute (the timer does not stop when the application is turned off)
I am a beginner and do not know how to create this function.

 

 

Нужно написать зависимость приложения от реального времени. При закрытии приложения таймер не должен останавливаться.
Например: каждые 10 минут должен меняться фон или значение голода должно уменьшаться каждую минуту (таймер не останавливается при выключении приложения)
Я новичок и не знаю, как прописать данную функцию

 



[TOPIC: post.html]
#2

nick_sherman

[GLOBAL: userInfoPane.html]
nick_sherman
  • Corona Geek

  • 1,637 posts
  • Corona SDK

When the user suspends or quits the app, save the time to a file. When the app resumes or is reopened, compare this to the current time to calculate how much time elapsed, and therefore how much to reduce hunger by.


[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: time