Skip to content

Add localStorage high-score support #3

Description

@sausi-7

Most games already track a score internally but throw it away when you close the modal. We can persist per-game high scores on the launcher side.

Approach

  • Define a tiny postMessage protocol: games postMessage({type:'score', value:N}).
  • The launcher catches it, stores localStorage["hs:<slug>"] = max(prev, N).
  • Show the high score under the title in the modal bar.
  • Document the protocol in CONTRIBUTING.md so new games can opt in.

Existing games keep working unchanged.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions