@arcadible/sdk 1.4.1 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -35,18 +35,18 @@ The package is for a game with a build step, such as a Vite project. A game with
35
35
  ```js
36
36
  import { arcadible } from "@arcadible/sdk";
37
37
 
38
- await arcadible.initStart(); // first thing in your game's code
38
+ await arcadible.initStart(); // as your code starts, before anything it awaits
39
39
  arcadible.initProgress(0.5);
40
40
  // … load, build the scene, and draw the first frame …
41
41
  await arcadible.initComplete();
42
42
  ```
43
43
 
44
- Call `initStart()` first thing in your game's code, report how far along you are with `initProgress()`, from 0 to 1, if you can measure it, and call `initComplete()` once your first frame is drawn. Arcadible shows your splash and the progress until then, and `initComplete()` resolves once the loading screen has faded into your game.
44
+ Call `initStart()` as your code starts, before anything it awaits, report how far along you are with `initProgress()`, from 0 to 1, if you can measure it, and call `initComplete()` once your first frame is drawn. Arcadible shows your splash and the progress until then, and `initComplete()` resolves once the loading screen has faded into your game.
45
45
 
46
46
  ## Save and load
47
47
 
48
48
  ```js
49
- // once the saves have loaded
49
+ // as your game starts, after initStart()
50
50
  const saved = await arcadible.saves.read("progress");
51
51
  const progress = saved ? JSON.parse(saved) : { level: 1 };
52
52
 
@@ -54,7 +54,7 @@ const progress = saved ? JSON.parse(saved) : { level: 1 };
54
54
  await arcadible.saves.write("progress", JSON.stringify(progress));
55
55
  ```
56
56
 
57
- A save is a name holding one string. Read your saves once as your game starts, keep the state in your game, and write at checkpoints. Every call returns a promise, and one that fails rejects with an `ArcadibleError`, whose `code` says what to do. `arcadible.saves.where` says who can read the saves back: every version of the game, only this build, or only until the page closes.
57
+ Saves are for what your game remembers between sessions, such as progress, settings, and preferences, not a general key/value store: up to 32 saves, 1 MB together, each named as you choose. A save is a name holding one string. Read your saves once as your game starts, keep the state in your game, and write at checkpoints. Every call returns a promise, and one that fails rejects with an `ArcadibleError`, whose `code` says what to do. `arcadible.saves.where` says who can read the saves back: every version of the game, only this build, or only until the page closes.
58
58
 
59
59
  Off Arcadible, such as on your dev server, the package still works, with the same rules and limits: there's no loading screen, so `initComplete()` resolves at once, saves are kept in the game's own browser storage, `arcadible.saves.where` is `"build"`, and `arcadible.build` is `null`.
60
60
 
package/dist/client.d.ts CHANGED
@@ -24,8 +24,8 @@ export interface Arcadible {
24
24
  /** Saves that carry over between the game's versions. */
25
25
  readonly saves: Saves;
26
26
  /**
27
- * Starts the game's initialization: call it first, before anything you
28
- * await, and Arcadible shows the game's loading screen until
27
+ * Starts the game's initialization: call it as your code starts, before
28
+ * anything it awaits, and Arcadible shows the game's loading screen until
29
29
  * `initComplete()`.
30
30
  * It resolves as `ready` does, once the SDK and the saves are ready.
31
31
  */
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.4.1";
1
+ export declare const VERSION = "1.4.2";
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // The client's version, sent in its hello and shown as `arcadible.version`,
2
2
  // for bug reports. It matches package.json (test/unit/protocol.test.ts).
3
- export const VERSION = "1.4.1";
3
+ export const VERSION = "1.4.2";
package/package.json CHANGED
@@ -43,5 +43,5 @@
43
43
  ],
44
44
  "type": "module",
45
45
  "types": "./dist/index.d.ts",
46
- "version": "1.4.1"
46
+ "version": "1.4.2"
47
47
  }