@indiegems/gem-web-sdk 14.0.0 → 14.0.1
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/CHANGELOG.md +6 -0
- package/dist/gem-web-sdk.esm.js +1 -1
- package/dist/gem-web-sdk.function.js +1 -1
- package/dist/gem-web-sdk.game.js +2 -2
- package/dist/gem-web-sdk.min.js +2 -2
- package/dist/gem-web-sdk.sdk.js +2 -2
- package/dist/gem-web-sdk.server.js +1 -1
- package/docs/api/api-reference-function.md +1 -1
- package/docs/api/api-reference-game.md +52 -19
- package/docs/api/api-reference-server.md +1 -1
- package/docs/api/reference.json +9 -9
- package/docs/changelog.md +6 -0
- package/docs/getting-started.md +3 -3
- package/docs/manifest.json +8 -8
- package/docs/server-bundles.md +2 -2
- package/docs/what-a-game-must-do.md +47 -26
- package/package.json +1 -1
package/docs/manifest.json
CHANGED
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
"file": "changelog.md",
|
|
41
|
-
"sha256": "
|
|
42
|
-
"updated": "2026-10-
|
|
41
|
+
"sha256": "93e10641e13f8e45156a822194ca163a5cbdf700899d3a0b4c89dec124623091",
|
|
42
|
+
"updated": "2026-10-21T18:58:27Z"
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
"file": "daily-challenges.md",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
"file": "getting-started.md",
|
|
71
|
-
"sha256": "
|
|
72
|
-
"updated": "2026-10-
|
|
71
|
+
"sha256": "c00bc1a56741a6f6101d3c911359b942f500d035e6d24f32a61dfb5dce478fdc",
|
|
72
|
+
"updated": "2026-10-21T18:58:27Z"
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
"file": "inventory-and-catalogs.md",
|
|
@@ -128,8 +128,8 @@
|
|
|
128
128
|
},
|
|
129
129
|
{
|
|
130
130
|
"file": "server-bundles.md",
|
|
131
|
-
"sha256": "
|
|
132
|
-
"updated": "2026-10-
|
|
131
|
+
"sha256": "2500446431aeb8dce11499d5de8e03ebf9d00b012bcee30e137a5a82b0abe559",
|
|
132
|
+
"updated": "2026-10-21T18:58:27Z"
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
135
|
"file": "serverless-functions-js.md",
|
|
@@ -153,8 +153,8 @@
|
|
|
153
153
|
},
|
|
154
154
|
{
|
|
155
155
|
"file": "what-a-game-must-do.md",
|
|
156
|
-
"sha256": "
|
|
157
|
-
"updated": "2026-10-
|
|
156
|
+
"sha256": "56e5d7323750cc29c015d99bcce747285a1c592336be5b54ee09fa67b223adc6",
|
|
157
|
+
"updated": "2026-10-21T18:37:13Z"
|
|
158
158
|
}
|
|
159
159
|
]
|
|
160
160
|
}
|
package/docs/server-bundles.md
CHANGED
|
@@ -80,8 +80,8 @@ To check the download yourself: the package npm serves is, byte for byte, the fi
|
|
|
80
80
|
also publishes on its download host, with the hash beside it:
|
|
81
81
|
|
|
82
82
|
```bash
|
|
83
|
-
curl -fsSL -O https://downloads.gemarcade.com/sdk/v14.0.
|
|
84
|
-
curl -fsSL https://downloads.gemarcade.com/sdk/v14.0.
|
|
83
|
+
curl -fsSL -O https://downloads.gemarcade.com/sdk/v14.0.1/gem-web-sdk.tgz
|
|
84
|
+
curl -fsSL https://downloads.gemarcade.com/sdk/v14.0.1/gem-web-sdk.tgz.sri
|
|
85
85
|
openssl dgst -sha384 -binary gem-web-sdk.tgz | openssl base64 -A
|
|
86
86
|
```
|
|
87
87
|
|
|
@@ -1019,10 +1019,11 @@ This is the whole model, and every other page that mentions settings links here:
|
|
|
1019
1019
|
them again on `onPrefs`. The Arcade never asks your game anything about them.
|
|
1020
1020
|
- **Every game draws its own settings button, top-right ([the top of the
|
|
1021
1021
|
screen](#the-top-of-the-screen)), and its own settings screen.** The Arcade's menu never opens it.
|
|
1022
|
-
- **A game
|
|
1023
|
-
`gem.settings.declare
|
|
1024
|
-
|
|
1025
|
-
|
|
1022
|
+
- **A game should also declare its settings — all of them, up to eight — to the Arcade's menu**,
|
|
1023
|
+
with `gem.settings.declare`: the Arcade's Settings screen lists every one, and the first music
|
|
1024
|
+
and colour-help toggles fill the Music and Color slots of its fixed quick row. It is a second way
|
|
1025
|
+
to reach them, never the only one, and never a second mute or vibration switch ([mirror your
|
|
1026
|
+
settings into the Arcade's menu](#mirror-your-settings-into-the-arcades-menu-gemsettings)).
|
|
1026
1027
|
- **A setting starts from `recommended` until the player changes it in your game, and then the
|
|
1027
1028
|
player's choice in your game wins.** Save only what the player chose, never a recommended value.
|
|
1028
1029
|
- **Where a choice is kept.** Device configuration — volume, graphics quality, look sensitivity, a
|
|
@@ -1138,13 +1139,22 @@ owns — starts from `recommended` the same way and is kept in `gem.me.settings`
|
|
|
1138
1139
|
([sound](#sound-your-own-mute-control-and-the-arcades)), and `reducedMotion` is the player's
|
|
1139
1140
|
accessibility setting, which your game honours.
|
|
1140
1141
|
|
|
1141
|
-
### Mirror
|
|
1142
|
+
### Mirror your settings into the Arcade's menu: `gem.settings`
|
|
1142
1143
|
|
|
1143
|
-
Optional. The Arcade's Gem menu
|
|
1144
|
-
Arcade-wide ones
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1144
|
+
Optional, and worth doing. The Arcade's Gem menu shows your game's own settings beside the
|
|
1145
|
+
player's Arcade-wide ones, in two places:
|
|
1146
|
+
|
|
1147
|
+
- **Its Settings screen lists every setting you declare**, up to eight, in a group named for your
|
|
1148
|
+
game above the player's defaults for all games. So declare **all** of your game's settings that
|
|
1149
|
+
fit the three kinds below, not a chosen few: a player who opens the menu mid-game finds every one
|
|
1150
|
+
of them without hunting for your settings screen.
|
|
1151
|
+
- **Its quick row is fixed: Music, Sound, Color and Vibration, in that order**, with the Arcade's
|
|
1152
|
+
own labels; Vibration is there on phones and tablets only. Sound (your game's mute) and Vibration
|
|
1153
|
+
(the player's Arcade setting) are the Arcade's. Your game fills the other two: **Music** with the
|
|
1154
|
+
first `toggle` you declare with `icon: 'music'`, and **Color** with the first `toggle` you
|
|
1155
|
+
declare with `icon: 'eye'` — a colour-help, colour-blind or high-contrast switch. A slot your
|
|
1156
|
+
game does not fill stays in its place, greyed and inert. Nothing else of yours reaches the quick
|
|
1157
|
+
row.
|
|
1148
1158
|
|
|
1149
1159
|
**It is a mirror, never a replacement: keep your own settings button and screen**, with every
|
|
1150
1160
|
setting you declare on it too. An embedder that draws no game settings shows none of this, and the
|
|
@@ -1153,11 +1163,12 @@ that dropped its button because the Arcade's menu had its settings would have se
|
|
|
1153
1163
|
reach.
|
|
1154
1164
|
|
|
1155
1165
|
```js
|
|
1156
|
-
// Built from the same state your own settings screen shows.
|
|
1166
|
+
// Built from the same state your own settings screen shows: every setting on it.
|
|
1157
1167
|
const declared = () => [
|
|
1158
|
-
{ id: 'music', label: t('Music'), kind: 'toggle', value: music.on,
|
|
1159
|
-
{ id: 'sfx', label: t('Sound effects'), kind: 'toggle', value: sfx.on,
|
|
1160
|
-
{ id: 'colors', label: t('Color help'), kind: 'toggle', value: colorHelp, icon: 'eye' },
|
|
1168
|
+
{ id: 'music', label: t('Music'), kind: 'toggle', value: music.on, icon: 'music' }, // the quick row's Music
|
|
1169
|
+
{ id: 'sfx', label: t('Sound effects'), kind: 'toggle', value: sfx.on, icon: 'sfx' },
|
|
1170
|
+
{ id: 'colors', label: t('Color help'), kind: 'toggle', value: colorHelp, icon: 'eye' }, // its Color
|
|
1171
|
+
{ id: 'musicVolume', label: t('Music volume'), kind: 'slider', value: musicVolume, min: 0, max: 100, step: 5 },
|
|
1161
1172
|
{ id: 'speed', label: t('Game speed'), kind: 'slider', value: speed, min: 0.5, max: 2, step: 0.25 },
|
|
1162
1173
|
{
|
|
1163
1174
|
id: 'difficulty',
|
|
@@ -1179,6 +1190,7 @@ gem.settings.onChange(({ id, value }) => {
|
|
|
1179
1190
|
if (id === 'music') setMusic(value === true);
|
|
1180
1191
|
if (id === 'sfx') setSfx(value === true);
|
|
1181
1192
|
if (id === 'colors') setColorHelp(value === true);
|
|
1193
|
+
if (id === 'musicVolume') setMusicVolume(value);
|
|
1182
1194
|
if (id === 'speed') setSpeed(value);
|
|
1183
1195
|
if (id === 'difficulty') setDifficulty(value);
|
|
1184
1196
|
keepChoice(id, value); // where your own screen keeps the same choice
|
|
@@ -1197,17 +1209,26 @@ musicToggle.onchange = () => {
|
|
|
1197
1209
|
`choice` has two to four `options` and its `value` is one of their ids. `id` is your own name
|
|
1198
1210
|
for the setting, 1 to 40 of `A-Z a-z 0-9 _ -`, unique. An entry that breaks a rule is left out
|
|
1199
1211
|
with a warning on the console, and nothing throws.
|
|
1200
|
-
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1212
|
+
- **`icon` is what puts a toggle in the quick row.** Give `icon: 'music'` to your music on/off
|
|
1213
|
+
toggle and `icon: 'eye'` to your colour-help toggle, and to no other setting: only the first
|
|
1214
|
+
toggle with each fills its slot, and a later one is shown only in the Settings list. Elsewhere
|
|
1215
|
+
`icon` is optional and only picks the glyph: `music`, `sfx`, `voice`, `eye`, `text`, `hint`,
|
|
1216
|
+
`speed`, `bright`, `controls` or `star`.
|
|
1217
|
+
- **`quick` is ignored by the Gem Arcade.** The quick row is the fixed one above, so marking a
|
|
1218
|
+
toggle `quick` changes nothing there. The field stays in the type and on the wire for other
|
|
1219
|
+
embedders, which may still honour it on the first two toggles that ask; leaving it out is fine.
|
|
1203
1220
|
- **Labels are already in the player's language** (`gem.prefs.locale`): the Arcade does not
|
|
1204
|
-
translate them, and cuts them at 40 characters. Declare again when the language changes.
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
sound-
|
|
1221
|
+
translate them, and cuts them at 40 characters. Declare again when the language changes. The
|
|
1222
|
+
quick row shows the Arcade's own labels; yours are what its Settings list shows.
|
|
1223
|
+
- **Never declare a second mute or vibration switch.** The quick row already has the Arcade's Sound
|
|
1224
|
+
(your game's mute) and Vibration (the player's Arcade setting); a "Mute", "Sound off" or
|
|
1225
|
+
"Vibration" of yours beside them is a second switch for the same thing, and the player cannot
|
|
1226
|
+
tell which one wins. **Your own levels are yours to declare**: a game volume, music volume or
|
|
1227
|
+
sound-effects volume is your game's level, which starts from the Arcade's `recommended` volume
|
|
1228
|
+
like any [game setting](#game-settings) and is set over it — and so are Music and Sound effects
|
|
1229
|
+
on/off toggles. Graphics quality and the controls defaults (look sensitivity, invert, touch stick,
|
|
1230
|
+
keyboard layout, confirm button) stay the Arcade's: they reach you as `gem.prefs.recommended`,
|
|
1231
|
+
and you do not declare them.
|
|
1211
1232
|
- **It is screen state, not a toggle.** Each call is the whole list and replaces the last;
|
|
1212
1233
|
`gem.settings.declare([])` takes them all back out. **Declare again whenever your own screen
|
|
1213
1234
|
changes a value**, so the menu never shows a stale one. Before the Arcade connects the list is
|
|
@@ -1377,8 +1398,8 @@ gem.setMenu({
|
|
|
1377
1398
|
```
|
|
1378
1399
|
|
|
1379
1400
|
- **Your settings screen is not in it.** It opens from [your own button](#game-settings), and the
|
|
1380
|
-
Arcade's menu never opens it.
|
|
1381
|
-
[`gem.settings`](#mirror-
|
|
1401
|
+
Arcade's menu never opens it. Your settings can also appear in the Arcade's menu, with
|
|
1402
|
+
[`gem.settings`](#mirror-your-settings-into-the-arcades-menu-gemsettings) — a mirror of your
|
|
1382
1403
|
screen, never a replacement for it.
|
|
1383
1404
|
- **`items` are up to four entries of your own**, shown in a group below the Arcade's. `id` is your
|
|
1384
1405
|
name for the entry (1 to 32 characters); `label` is what the player reads, **already in their
|