The music setting is stored "reversed" -- 0 is sound on, -1 is sound off -- because the starting state of a save file is all zeroes so the all zeroes file should show default behavior.
This is not golfed, there is almost certainly room for a lot of token savings. We probably need to start playing golf again pretty soon.
Currently, the maximum level is not enforced -- for development, the max is always level 31 -- but comment out the max_level= 1 line and uncomment the persist.max_level line in title:init and it limits the player to levels they've reached through gameplay, as intended.
Press and hold the down arrow on the title to wipe the save. This uses wrongbleep as an on-theme warning, vibration and all. There is currently no UI hint that this is available, this can be added in another patch.
Saves and loads:
* the most recent level played
* the maximum level reached
* whether music is enabled or not
The music setting is stored "reversed" -- 0 is sound on, -1 is sound off -- because the starting state of a save file is all zeroes so the all zeroes file should show default behavior.
This is not golfed, there is almost certainly room for a lot of token savings. We probably need to start playing golf again pretty soon.
Currently, the maximum level is not enforced -- for development, the max is always level 31 -- but comment out the `max_level= 1` line and uncomment the `persist.max_level` line in `title:init` and it limits the player to levels they've reached through gameplay, as intended.
Press and hold the down arrow on the title to wipe the save. This uses `wrongbleep` as an on-theme warning, vibration and all. There is currently no UI hint that this is available, this can be added in another patch.
Saves the music flag, the last level the player played, and the furthest level reached. Loads music flag on launch. Title screen starts on most recent level played; when in "release configuration" the title screen will only let the player pick levels up to the maximum reached through gameplay, but right now this is replaced with the 31.
Save file can be wiped by holding the down arrow at the title screen.
Disabling writes during "wipe" and "first load" is not quite semantically what we want, it's writes during read we want to block. This happens because turning the music on or off tries to save the state, and it's easier to just ignore that persistence request than to rework the music code so it doesn't. "wipe" and "first load" are when we're actually reading (and enacting) state, but it's the act of reading rather than those two acts that should block writes.
It is also unwilling to write until it's done its first read, which I think is a feature; it makes it harder to accidentally blank out the player's data.
pyrex
merged commit b6d1a21b7e into main2023-01-02 23:08:04 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Saves and loads:
The music setting is stored "reversed" -- 0 is sound on, -1 is sound off -- because the starting state of a save file is all zeroes so the all zeroes file should show default behavior.
This is not golfed, there is almost certainly room for a lot of token savings. We probably need to start playing golf again pretty soon.
Currently, the maximum level is not enforced -- for development, the max is always level 31 -- but comment out the
max_level= 1line and uncomment thepersist.max_levelline intitle:initand it limits the player to levels they've reached through gameplay, as intended.Press and hold the down arrow on the title to wipe the save. This uses
wrongbleepas an on-theme warning, vibration and all. There is currently no UI hint that this is available, this can be added in another patch.39efcdc1d5to7b931d1fbaRebased.