Host typegenerated
Save
Saving progress between play sessions: numbers, text and true/false values stored under names, such as a best score.
11 members · engine 0.1.0
Save.clear() -> unitDeletes everything saved.Save.flag(key: String, fallback: bool) -> boolA saved true/false value, orfallbackif nothing is saved under that name yet.Save.has(key: String) -> boolWhether anything is saved under a name.Save.is_damaged() -> boolWhether saved progress existed but could not be read, so the game can tell the player before overwriting it.Save.is_from_newer() -> boolWhether the save was made by a newer version of the game. Its values are not loaded.Save.is_new() -> boolWhether nothing has been saved yet, as on the first time the game is played.Save.number(key: String, fallback: number) -> numberA saved number, orfallbackif nothing is saved under that name yet:Save.number("best", 0.0).Save.set_flag(key: String, value: bool) -> unitSaves a true/false value under a name.Save.set_number(key: String, value: number) -> unitSaves a number under a name.Save.set_text(key: String, value: String) -> unitSaves text under a name through the shared versioned store.Save.text(key: String, fallback: String) -> StringSaved Unicode text, or the fallback when the key is absent or holds another type.
- Source
- docs/generated/decay-api.json
- Schema
- v1
- Engine version
- 0.1.0
- Source commit
909aca81368b