-
Notifications
You must be signed in to change notification settings - Fork 3
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 Achievements Viewer, which has a standalone achievement browser and its own toasts. #5
base: dev
Are you sure you want to change the base?
Conversation
BTW, this could actually be used to power a pretty decent cross-game achievement viewer, since you can pass in a different game's gameData using the crossgame library. |
…ct the screen too much.
e661a30
to
f03341f
Compare
Underrated technique tbh |
A couple points of concern which I don't have the time necessary to address myself:
|
This PR adds a standalone viewer for achievements that is easy to launch from your game by calling
achievementsViewer.launch()
. It blocks your game's update from executing (similar to the pause screen), then resumes updating your game after the user exits. (It does this by overriding the game'splaydate.update
function to its own, then restoring the previous value afterwards). The browser lets you sort by default order, recently unlocked, and progress (the achievements with progressMax set that you are closest to reaching at the top of the list).This library also includes a toast that matches the look of the cards, available by running
achievementsViewer.toast(achievementId)
. This overrides yourplaydate.update
function as well, but executes the previous one every frame before it draws the toast. It should be possible to add other update methods to the toasts, such as using a sprite update or timer, as an alternative.The goal of this library is to make it very easy to add to your app so that there can be an achievements browser in each app that looks unified in appearance, maybe even like it's part of the system. Just add the lua script, and all the assets, into your project, then call
achievementsViewer.launch()
to show it.This PR includes several fonts from the Playdate SDK, though it would also be possible to remove them and simply add instructions on which fonts are needed and where to put them so the developer can do that themselves. All code and artwork was made by me and is added to whatever license the achievements library is released under. The audio files included are licensed under CC0 which is essentially a freeware / public domain type license that does not require any attribution.
Some examples of how this looks in my own game, Cranky Cove:
Achievements Viewer
Toasts