-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for terminating/locking/unlocking/sleep callback #55
Comments
I like this a lot! I'd want to create it so that it's app-specific behavior which mostly governs this, but that it can be overridden or amended with scene-specific behavior. But that's more a design problem than a technical problem. This does seem easy to implement. The trick would be to add enough value so it's not just wrapping the SDK call, without encouraging users to re-implement their code for every scene if they only want to do one thing. Also, what's the limit to what can be done during those callbacks, and how can Noble Engine guide users to honor that limit? |
There's a 10 second watchdog timer that will force close/sleep your game if passed. I think that's the main limitation, which isn't too bad considering it was designed for saving game state. The animations are just a nice little side effect! This would also be nice if the transitions were generalized so they could be used. A simple fade out would be awesome! Here's a super simple example. The screen doesn't seem to update on non-mac simulator so I can't get a gif: function pd.GameWillTerminate()
local timer = gfx.animator.new(350, 0, 1)
while not timer:ended() do
gfx.getWorkingImage():vcrPauseFilterImage():draw(0, 0)
pd.display.flush()
end
end Note that regular timers don't actually update, since the game is paused. Only animators will work |
Maybe the option to have the callbacks in your |
Describe the feature
Someone on the discord discovered a catalog game that had an exit animation and implemented it in their own game:
Playdate_2023-07-24_222512.mp4
They don't use Noble, but they shared their code and it was surprisingly simple. I think it would be nice to easily support it on a per-scene basis. The other use for the function is to save data when the device does the thing.
Describe alternatives you've considered
You could do it manually, which is what I'm doing now.
What problems would this solve or help prevent, if any
It would show off the lesser-known parts of the SDK and easier saving when not using autosave on a per-scene basis
Additional context
Here's my case scene:
The text was updated successfully, but these errors were encountered: