Key Ideas
1json module. Maps Python dicts/lists directly onto human-readable text — json.dump() writes, json.load() reads.
2Save pattern. Gather all state into one dict, open the file in "w" mode, then json.dump(data, f, indent=2).
3Load pattern. Check the file exists (or wrap in try/except); fall back to sensible defaults if it's missing or corrupted.
4Settings vs. progress. Keep settings.json separate from savegame.json so starting a New Game never wipes audio/display preferences.
5Merging defaults. DEFAULT_SETTINGS.copy(); merged.update(data) — defaults fill gaps left by an older save file.
6High scores. Append the new entry, sort(key=..., reverse=True), slice to [:MAX_ENTRIES], then save.
7Achievements. Each is {id, desc, check(stats)}; store unlocked ids in the save data so checks stay idempotent.
8Checkpoints. Just another field in the save dict — typically a level id plus an (x, y) spawn position.