I’ve searched the forum and found some topics that discussed the potential for detecting when an application enters and exits background/foreground…
function appEnteredBackground()
end
function appEnteredForeground()
end
This would be very useful for applications involving the physics engine, since it uses a calculation stepper, which essentially simulates it running in the background when your application resumes foreground execution.
Simply being able to put physics pause and resume in these example functions would be incredibly helpful.
@johnpoore physics should be pausing and resuming on those events automatically. If not then that’s a bug in Codea. (Though I’m open to the idea of making those events available in the Codea API too.)
I agree with everyone on this thread. It’s definitely not pausing, so if it should be, it’s a bug. I also agree that exposing these events would be helpful. Probably not a big deal in the Codea App but as people use Codea as a serious development platform, having access to these types of events would be very useful. Hopefully the bug is an easy fix!
Another observation on this topic… Physics also does not pause when you pause Codea in the Codea development environment. @Simeon, do you think any/some of this will make it into the next update? Or it too complicated a change?