Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/apursley2012/the-beach-mystery/llms.txt

Use this file to discover all available pages before exploring further.

The Beach Mystery stores everything — your current node, inventory state, personalization variables, choice history, and discovered endings — directly in your browser using localStorage. There is no account, no server, and no data ever leaves your device. You can close the tab, come back days later, and pick up exactly where you left off.

What Gets Stored

Three separate localStorage keys handle different concerns:

beach-mystery-save

Your current game session. Contains the active node, all variables, inventory state, your full choice history, and whether an ending has been reached.

beach-mystery-achievements

An array of ending IDs collected across all sessions (e.g. ["islandTreasure", "hiddenChamber"]). Persists independently — resetting a session never erases it.

beach-mystery-settings

Your accessibility and display preferences: sound on/off, text size, and high contrast mode. Applied on every visit automatically.

Saving Your Progress

Click 💾 Save Progress in the story sidebar at any point during gameplay. This calls saveGame(), which serializes the entire current gameState object to beach-mystery-save.
{
  "variables": {
    "firstName": "Alex",
    "favoriteColor": "blue",
    "favoriteAnimal": "cat",
    "cartoonChar": "Snoopy",
    "favoriteJewel": "sapphire",
    "formatted_time": "14:32"
  },
  "state": {
    "hasOpenedChest": true,
    "hasJewel": true,
    "hasMap": true
  },
  "currentNode": "caveEnteredWithJewel",
  "history": [
    { "nodeId": "chestChoice", "choice": "Yes" },
    { "nodeId": "mapChoice", "choice": "No" },
    { "nodeId": "caveChoiceWithJewel", "choice": "Yes" }
  ],
  "endingReached": null,
  "started": true
}
Every field is written on save — personalization answers, inventory flags, your position in the story tree, and the full list of choices you have made so far.

Continuing a Saved Game

When you return to the title screen, the game calls hasSave() to check whether beach-mystery-save contains a valid in-progress session (i.e. started: true and currentNode is not null). If the check passes:
  • A “Continue Saved Game” button appears on the title screen.
  • Clicking it calls loadGame(), which parses the stored JSON and restores all state.
  • The story resumes at exactly the node where you saved.
If no valid save exists, only the “New Game” path is shown.

Restarting and Replaying

↻ Restart (during play)

Click ↻ Restart in the gameplay sidebar. This calls resetGame(), which returns all game state to its initial values and routes back to the title screen. Your achievements are kept.

Play Again (after an ending)

On the ending screen, click Play Again. This also calls resetGame() and returns to the title screen, letting you begin a fresh run — useful for chasing a different ending.
resetGame() resets the in-memory gameState to initial values, but it never touches beach-mystery-save, beach-mystery-achievements, or beach-mystery-settings. All the endings you have already discovered remain recorded. To remove a saved game from storage, call clearSave() separately.

Achievement Tracking

Every time you reach an ending, its ID is appended to the beach-mystery-achievements array (duplicates are ignored). The four collectible ending IDs are:
IDEnding NameIcon
islandTreasureThe Island’s Secret🏝️
hiddenChamberThe Hidden Treasure Chamber💎
animalDenThe Guardian’s Den🐾
peacefulWalkThe Peaceful Shore🌅
The Endings page reads this array and shows a progress ring indicating how many of the four endings you have found. Discovered endings unlock their full description and the story path that leads to them. Undiscovered endings remain blurred until you reach them in a playthrough.

Settings That Persist

Settings saved to beach-mystery-settings are applied automatically on every page load:

Sound

Toggle ambient audio and sound effects on or off. Default: on.

Text Size

Choose your preferred reading size. Default: medium.

High Contrast

Enable high-contrast mode for improved legibility. Default: off.
Settings persist across sessions and across different stories — they are never wiped by resetGame() or clearSave().

Save Function Reference

Serializes the current gameState to localStorage under the key beach-mystery-save. Call this at any point during gameplay. Safe to call multiple times — each call overwrites the previous save.
Parses beach-mystery-save from localStorage, restores the full game state in memory, and returns true if successful. Returns false (and leaves state unchanged) if no valid save is found or if the JSON cannot be parsed.
Returns true if beach-mystery-save exists and contains started: true with a non-null currentNode. Used by the title screen to decide whether to show the “Continue Saved Game” button.
Removes the beach-mystery-save key from localStorage. Does not affect achievements or settings.
Resets in-memory game state to initial values (started: false, currentNode: null, empty variables and history). Does not remove beach-mystery-save or touch beach-mystery-achievements or beach-mystery-settings. Call clearSave() separately if you also want to wipe the stored save.

Important Limitations

Saves are stored in your current browser on your current device. Clearing your browser’s site data or switching to a different browser, device, or private/incognito window will result in a missing save. There is no cloud sync or account-based backup.
Achievement data is stored separately from the save file. Even if you clear your save — or your save is lost — your discovered endings remain intact in beach-mystery-achievements as long as the browser’s localStorage for the site is preserved.

Build docs developers (and LLMs) love