create-threenative 0.2.18 → 0.2.20
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/agent-docs/references/capability-reference.md +212 -4
- package/agent-docs/references/kit-racing.md +4 -2
- package/agent-docs/references/performance-basics.md +2 -1
- package/agent-docs/references/terrain-authoring.md +21 -7
- package/agent-files/.agents/skills/prd-creator/SKILL.md +24 -0
- package/dist/index.js +255 -236
- package/dist/quality.d.ts +5 -1
- package/dist/quality.js +75 -6
- package/dist/terrain-kit.js +1 -1
- package/dist/threenative.js +6 -4
- package/dist/web-engine-post-effects.js +6 -0
- package/dist/web-engine-runtime.js +211 -36
- package/package.json +6 -6
- package/template-assets/assets/floor-fern-0.glb +0 -0
- package/template-assets/assets/floor-litter-0.glb +0 -0
- package/template-assets/assets/floor-log-0.glb +0 -0
- package/template-assets/assets/floor-log-1.glb +0 -0
- package/template-assets/assets/floor-stump-0.glb +0 -0
- package/template-assets/assets/floor-twig-0.glb +0 -0
- package/template-assets/quality/eslint.config.js +1 -1
- package/templates/action-rpg/package.json +7 -7
- package/templates/action-rpg/src/loot/drops.ts +3 -7
- package/templates/action-rpg/src/render/camera.ts +2 -2
- package/templates/action-rpg/src/render/clouds.ts +3 -1
- package/templates/action-rpg/src/render/materials.ts +3 -2
- package/templates/action-rpg/src/render/touch-controls.ts +7 -6
- package/templates/action-rpg/src/scenes/Play.ts +1 -15
- package/templates/adventure/AGENTS.md +3 -3
- package/templates/adventure/CLAUDE.md +3 -3
- package/templates/adventure/native-playtests/survives.playtest.json +12 -0
- package/templates/adventure/native-playtests/woodland-floor.playtest.json +61 -0
- package/templates/adventure/package.json +7 -7
- package/templates/adventure/playtests/grass.playtest.json +61 -0
- package/templates/adventure/playtests/performance.playtest.json +1 -1
- package/templates/adventure/playtests/survives.playtest.json +2 -2
- package/templates/adventure/playtests/woodland-floor.playtest.json +61 -0
- package/templates/adventure/src/entities/LockOn.ts +42 -4
- package/templates/adventure/src/entities/Warden.ts +4 -1
- package/templates/adventure/src/level/Vale.ts +241 -16
- package/templates/adventure/src/render/camera.ts +2 -2
- package/templates/adventure/src/render/foliage.ts +64 -20
- package/templates/adventure/src/render/grass.ts +325 -0
- package/templates/adventure/src/render/materials.ts +3 -2
- package/templates/adventure/src/render/palette.ts +3 -0
- package/templates/adventure/src/render/touch-controls.ts +4 -1
- package/templates/adventure/src/scenes/Play.ts +96 -1
- package/templates/collectathon/package.json +7 -7
- package/templates/collectathon/src/level/Course.ts +2 -7
- package/templates/collectathon/src/level/terrain.ts +2 -1
- package/templates/collectathon/src/render/camera.ts +2 -2
- package/templates/collectathon/src/render/ground.ts +4 -4
- package/templates/collectathon/src/render/hero.ts +1 -1
- package/templates/collectathon/src/render/materials.ts +0 -1
- package/templates/collectathon/src/render/sky.ts +4 -3
- package/templates/kart/package.json +6 -6
- package/templates/kart/src/entities/Kart.ts +2 -1
- package/templates/kart/src/render/course.ts +2 -1
- package/templates/kart/src/track/Course.ts +3 -1
- package/templates/minimal/package.json +6 -6
- package/templates/minimal/src/render/camera.ts +2 -2
- package/templates/minimal/src/render/clouds.ts +3 -1
- package/templates/minimal/src/render/materials.ts +3 -2
- package/templates/minimal/src/render/touch-controls.ts +7 -6
- package/templates/platformer/package.json +7 -7
- package/templates/platformer/playtests/collect.playtest.json +4 -1
- package/templates/platformer/src/level/Stage.ts +2 -6
- package/templates/platformer/src/scenes/Play.ts +2 -1
- package/templates/puzzle/package.json +7 -7
- package/templates/puzzle/src/entities/Warden.ts +3 -3
- package/templates/puzzle/src/render/camera.ts +2 -2
- package/templates/puzzle/src/render/touch-controls.ts +7 -6
- package/templates/racing/AGENTS.md +2 -2
- package/templates/racing/CLAUDE.md +2 -2
- package/templates/racing/CREDITS.md +29 -0
- package/templates/racing/assets/engine-loop.wav +0 -0
- package/templates/racing/assets/grass/Grass004_color.jpg +0 -0
- package/templates/racing/assets/grass/Grass004_normal.jpg +0 -0
- package/templates/racing/assets/grass/Grass004_roughness.jpg +0 -0
- package/templates/racing/assets/nitro-burst.wav +0 -0
- package/templates/racing/assets/tyre-squeal.wav +0 -0
- package/templates/racing/package.json +7 -7
- package/templates/racing/playtests/drift-natural.playtest.json +68 -0
- package/templates/racing/playtests/drift.playtest.json +100 -0
- package/templates/racing/playtests/hud.playtest.json +117 -0
- package/templates/racing/playtests/launch-pose.playtest.json +34 -0
- package/templates/racing/playtests/nitro.playtest.json +158 -0
- package/templates/racing/playtests/outcome.playtest.json +4 -4
- package/templates/racing/playtests/performance.playtest.json +1 -1
- package/templates/racing/playtests/steady-camera.playtest.json +88 -0
- package/templates/racing/src/audio/engine.ts +138 -0
- package/templates/racing/src/entities/CarBody.ts +83 -10
- package/templates/racing/src/entities/Drift.ts +243 -0
- package/templates/racing/src/entities/LineDriver.ts +2 -2
- package/templates/racing/src/entities/Nitro.ts +72 -0
- package/templates/racing/src/entities/RacingCar.ts +86 -21
- package/templates/racing/src/entities/Rival.ts +35 -21
- package/templates/racing/src/game.ts +6 -0
- package/templates/racing/src/gauges.ts +74 -0
- package/templates/racing/src/render/camera.ts +29 -4
- package/templates/racing/src/render/clouds.ts +3 -1
- package/templates/racing/src/render/effects.ts +244 -0
- package/templates/racing/src/render/materials.ts +43 -8
- package/templates/racing/src/render/shapes.ts +37 -0
- package/templates/racing/src/render/skids.ts +84 -0
- package/templates/racing/src/render/touch-controls.ts +10 -10
- package/templates/racing/src/scenes/Race.ts +277 -25
- package/templates/racing/src/state.ts +35 -0
- package/templates/racing/src/style.css +3 -0
- package/templates/racing/src/track/Track.ts +132 -58
- package/templates/racing/src/track/TrackSector.ts +19 -1
- package/templates/racing/src/track/circuit.ts +21 -15
- package/templates/racing/src/ui/GameUi.tsx +0 -2
- package/templates/racing/src/ui/Hud.tsx +417 -50
- package/templates/racing/threenative.config.ts +15 -0
- package/templates/racing/tools/make-racing-audio.mjs +388 -0
- package/templates/rain/package.json +6 -6
- package/templates/rain/src/render/noise-volume.ts +2 -1
- package/templates/rain/src/state.ts +3 -1
- package/templates/rain/src/ui/GameUi.tsx +1 -1
- package/templates/rain/src/ui/automation.ts +10 -8
- package/templates/rain/src/ui/tempest.ts +3 -4
- package/templates/rts/package.json +6 -6
- package/templates/rts/src/sim/terrain.ts +1 -0
- package/templates/rts/src/sim/types.ts +1 -0
- package/templates/runner/package.json +7 -7
- package/templates/runner/src/render/clouds.ts +3 -1
- package/templates/runner/src/render/materials.ts +3 -2
- package/templates/runner/src/render/touch-controls.ts +7 -6
- package/templates/runner/src/scenes/Run.ts +4 -9
- package/templates/sailing/package.json +7 -7
- package/templates/sailing/src/render/touch-controls.ts +7 -6
- package/templates/shooter/package.json +7 -7
- package/templates/shooter/src/render/clouds.ts +3 -1
- package/templates/snow/package.json +7 -7
- package/templates/snow/src/entities/Explorer.ts +6 -12
- package/templates/snow/src/render/bootPrint.ts +3 -1
- package/templates/snow/src/render/camera.ts +3 -2
- package/templates/snow/src/render/scenery.ts +3 -3
- package/templates/snow/src/render/touch-controls.ts +7 -6
- package/templates/snow/src/render/weather.ts +3 -5
- package/templates/snow/src/terrain.ts +2 -1
- package/templates/starter/native-playtests/render-chain.playtest.json +9 -9
- package/templates/starter/package.json +7 -7
- package/templates/starter/src/entities/Player.ts +10 -2
- package/templates/starter/src/render/camera.ts +2 -2
- package/templates/starter/src/render/clouds.ts +3 -1
- package/templates/starter/src/render/materials.ts +3 -2
- package/templates/starter/src/render/touch-controls.ts +7 -6
- package/templates/starter/src/scenes/Play.ts +1 -14
- package/templates/tower-defense/package.json +7 -7
- package/templates/tower-defense/src/render/shapes.ts +1 -2
- package/templates/tower-defense/src/scenes/Battle.ts +3 -8
- package/template-assets/terrain/alpine/assets.json +0 -12
- package/template-assets/terrain/alpine/bake.mjs +0 -6
- package/template-assets/terrain/alpine/credits.json +0 -164
- package/template-assets/terrain/alpine/heightmap.r16 +0 -0
- package/template-assets/terrain/alpine/recipe.json +0 -119
- package/template-assets/terrain/alpine/surface.json +0 -53
- package/template-assets/terrain/coastal/assets.json +0 -11
- package/template-assets/terrain/coastal/bake.mjs +0 -6
- package/template-assets/terrain/coastal/credits.json +0 -117
- package/template-assets/terrain/coastal/heightmap.r16 +0 -0
- package/template-assets/terrain/coastal/recipe.json +0 -113
- package/template-assets/terrain/coastal/surface.json +0 -41
- package/template-assets/terrain/desert/assets.json +0 -12
- package/template-assets/terrain/desert/bake.mjs +0 -6
- package/template-assets/terrain/desert/credits.json +0 -164
- package/template-assets/terrain/desert/heightmap.r16 +0 -0
- package/template-assets/terrain/desert/recipe.json +0 -108
- package/template-assets/terrain/desert/surface.json +0 -54
- package/template-assets/terrain/forest/assets.json +0 -65
- package/template-assets/terrain/forest/bake.mjs +0 -8
- package/template-assets/terrain/forest/credits.json +0 -225
- package/template-assets/terrain/forest/heightmap.r16 +0 -0
- package/template-assets/terrain/forest/recipe.json +0 -350
- package/template-assets/terrain/forest/surface.json +0 -79
- package/template-assets/terrain/tundra/assets.json +0 -12
- package/template-assets/terrain/tundra/bake.mjs +0 -6
- package/template-assets/terrain/tundra/credits.json +0 -164
- package/template-assets/terrain/tundra/heightmap.r16 +0 -0
- package/template-assets/terrain/tundra/recipe.json +0 -277
- package/template-assets/terrain/tundra/surface.json +0 -54
- package/templates/racing/src/ui/Menu.tsx +0 -7
|
@@ -15,6 +15,9 @@ const MOVE_RADIUS = 72;
|
|
|
15
15
|
const BUTTON_RADIUS = 58;
|
|
16
16
|
const EDGE = 36;
|
|
17
17
|
|
|
18
|
+
/** The knob's next point: `update` runs every frame, so it uses one instance. */
|
|
19
|
+
const knobPosition = new Vector2();
|
|
20
|
+
|
|
18
21
|
export interface ITouchPointer {
|
|
19
22
|
readonly position: Vector2;
|
|
20
23
|
}
|
|
@@ -122,13 +125,11 @@ export class TouchControls {
|
|
|
122
125
|
}
|
|
123
126
|
|
|
124
127
|
const center = this.#hasMoveAnchor ? this.#moveAnchor : this.#resting;
|
|
125
|
-
|
|
126
|
-
this.#
|
|
127
|
-
|
|
128
|
-
center.x + this.#input.move.x * MOVE_RADIUS,
|
|
129
|
-
center.y - this.#input.move.y * MOVE_RADIUS,
|
|
130
|
-
),
|
|
128
|
+
knobPosition.set(
|
|
129
|
+
center.x + this.#input.move.x * MOVE_RADIUS,
|
|
130
|
+
center.y - this.#input.move.y * MOVE_RADIUS,
|
|
131
131
|
);
|
|
132
|
+
place(this.#moveKnob, knobPosition);
|
|
132
133
|
this.#left.material = left ? this.#activeMaterial : this.#idleMaterial;
|
|
133
134
|
this.#right.material = right ? this.#activeMaterial : this.#idleMaterial;
|
|
134
135
|
this.#input.leftPressed = left && !this.#wasLeft;
|
|
@@ -205,7 +205,9 @@ export class Run extends Scene<GameState, RunnerPhysics> {
|
|
|
205
205
|
const previous = frameCtx.state.getState();
|
|
206
206
|
const next: GameState = {
|
|
207
207
|
chunks: track.built,
|
|
208
|
-
distance
|
|
208
|
+
// Whole metres: the HUD shows the floor, and a fractional distance would republish every
|
|
209
|
+
// frame. The store skips a key it already holds, so this is the only stillness it needs.
|
|
210
|
+
distance: Math.floor(distance),
|
|
209
211
|
lane: runner.lane,
|
|
210
212
|
nearMisses,
|
|
211
213
|
paused: previous.paused,
|
|
@@ -213,14 +215,7 @@ export class Run extends Scene<GameState, RunnerPhysics> {
|
|
|
213
215
|
status,
|
|
214
216
|
uiReady: previous.uiReady,
|
|
215
217
|
};
|
|
216
|
-
|
|
217
|
-
next.chunks !== previous.chunks ||
|
|
218
|
-
next.lane !== previous.lane ||
|
|
219
|
-
next.nearMisses !== previous.nearMisses ||
|
|
220
|
-
next.status !== previous.status ||
|
|
221
|
-
Math.floor(next.distance) !== Math.floor(previous.distance)
|
|
222
|
-
)
|
|
223
|
-
frameCtx.state.set(next);
|
|
218
|
+
frameCtx.state.set(next);
|
|
224
219
|
};
|
|
225
220
|
}
|
|
226
221
|
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"format:check": "biome format src"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@threenative/core": "0.3.
|
|
23
|
-
"@threenative/physics": "0.3.
|
|
24
|
-
"@threenative/ui": "0.3.
|
|
22
|
+
"@threenative/core": ">=0.3.15",
|
|
23
|
+
"@threenative/physics": ">=0.3.15",
|
|
24
|
+
"@threenative/ui": ">=0.3.15",
|
|
25
25
|
"react": "19.2.0",
|
|
26
26
|
"react-dom": "19.2.0",
|
|
27
27
|
"react-reconciler": "0.33.0",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@tailwindcss/vite": "4.3.3",
|
|
32
|
-
"@threenative/assets": "0.3.
|
|
33
|
-
"@threenative/playtest": "0.3.
|
|
32
|
+
"@threenative/assets": ">=0.3.16",
|
|
33
|
+
"@threenative/playtest": ">=0.3.15",
|
|
34
34
|
"@types/react": "19.2.0",
|
|
35
35
|
"@types/react-dom": "19.2.0",
|
|
36
36
|
"@types/three": "0.187.0",
|
|
37
37
|
"@vitejs/plugin-react": "6.0.5",
|
|
38
|
-
"create-threenative": "0.2.
|
|
38
|
+
"create-threenative": "0.2.20",
|
|
39
39
|
"esbuild": "0.27.0",
|
|
40
40
|
"playwright": "1.62.1",
|
|
41
41
|
"tailwindcss": "4.3.3",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"eslint": "10.13.0"
|
|
47
47
|
},
|
|
48
48
|
"optionalDependencies": {
|
|
49
|
-
"@threenative/runtime-native": "0.3.
|
|
49
|
+
"@threenative/runtime-native": ">=0.3.15"
|
|
50
50
|
},
|
|
51
51
|
"overrides": {
|
|
52
52
|
"sharp": ">=0.35.4",
|
|
@@ -14,6 +14,9 @@ import { palette } from "./palette.js";
|
|
|
14
14
|
const MOVE_RADIUS = 72;
|
|
15
15
|
const EDGE = 36;
|
|
16
16
|
|
|
17
|
+
/** The knob's next point: `update` runs every frame, so it uses one instance. */
|
|
18
|
+
const knobPosition = new Vector2();
|
|
19
|
+
|
|
17
20
|
export interface ITouchPointer {
|
|
18
21
|
readonly position: Vector2;
|
|
19
22
|
}
|
|
@@ -100,13 +103,11 @@ export class TouchControls {
|
|
|
100
103
|
}
|
|
101
104
|
|
|
102
105
|
const center = this.#hasMoveAnchor ? this.#moveAnchor : this.#resting;
|
|
103
|
-
|
|
104
|
-
this.#
|
|
105
|
-
|
|
106
|
-
center.x + this.#input.move.x * MOVE_RADIUS,
|
|
107
|
-
center.y - this.#input.move.y * MOVE_RADIUS,
|
|
108
|
-
),
|
|
106
|
+
knobPosition.set(
|
|
107
|
+
center.x + this.#input.move.x * MOVE_RADIUS,
|
|
108
|
+
center.y - this.#input.move.y * MOVE_RADIUS,
|
|
109
109
|
);
|
|
110
|
+
place(this.#moveKnob, knobPosition);
|
|
110
111
|
this.#moveKnob.material = this.#hasMoveAnchor ? this.#activeMaterial : this.#idleMaterial;
|
|
111
112
|
this.#layout(size);
|
|
112
113
|
return this.#input;
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"format:check": "biome format src"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@threenative/core": "0.3.
|
|
23
|
-
"@threenative/physics": "0.3.
|
|
24
|
-
"@threenative/ui": "0.3.
|
|
22
|
+
"@threenative/core": ">=0.3.15",
|
|
23
|
+
"@threenative/physics": ">=0.3.15",
|
|
24
|
+
"@threenative/ui": ">=0.3.15",
|
|
25
25
|
"react": "19.2.0",
|
|
26
26
|
"react-dom": "19.2.0",
|
|
27
27
|
"three": "0.187.0"
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"@tailwindcss/vite": "4.3.3",
|
|
31
31
|
"@types/three": "0.187.0",
|
|
32
32
|
"@vitejs/plugin-react": "6.0.5",
|
|
33
|
-
"@threenative/assets": "0.3.
|
|
34
|
-
"@threenative/playtest": "0.3.
|
|
33
|
+
"@threenative/assets": ">=0.3.16",
|
|
34
|
+
"@threenative/playtest": ">=0.3.15",
|
|
35
35
|
"@types/react": "19.2.0",
|
|
36
36
|
"@types/react-dom": "19.2.0",
|
|
37
37
|
"playwright": "1.62.1",
|
|
38
|
-
"create-threenative": "0.2.
|
|
38
|
+
"create-threenative": "0.2.20",
|
|
39
39
|
"esbuild": "0.27.0",
|
|
40
40
|
"tailwindcss": "4.3.3",
|
|
41
41
|
"typescript": "7.0.2",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"eslint": "10.13.0"
|
|
46
46
|
},
|
|
47
47
|
"optionalDependencies": {
|
|
48
|
-
"@threenative/runtime-native": "0.3.
|
|
48
|
+
"@threenative/runtime-native": ">=0.3.15"
|
|
49
49
|
},
|
|
50
50
|
"overrides": {
|
|
51
51
|
"sharp": ">=0.35.4",
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
// Independent CPU implementation. The material samples four Unreal textures that this repository
|
|
7
7
|
// must not carry, so each one is regenerated here from a seeded noise whose per-channel value
|
|
8
8
|
// quantiles and correlation lengths match the Unreal texture (measured, see the spec).
|
|
9
|
+
import { MathUtils } from "three";
|
|
10
|
+
|
|
9
11
|
import {
|
|
10
12
|
BOTTOM_KM,
|
|
11
13
|
CAMERA_KM,
|
|
@@ -110,7 +112,7 @@ const PROFILE_COEFFICIENTS = [
|
|
|
110
112
|
const clamp = (v: number): number => Math.max(0, Math.min(1, v));
|
|
111
113
|
const smooth = (v: number): number => {
|
|
112
114
|
const t = clamp(v);
|
|
113
|
-
return t
|
|
115
|
+
return MathUtils.smoothstep(t, 0, 1);
|
|
114
116
|
};
|
|
115
117
|
const mod = (a: number, n: number): number => ((a % n) + n) % n;
|
|
116
118
|
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"format:check": "biome format src"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@threenative/core": "0.3.
|
|
23
|
-
"@threenative/physics": "0.3.
|
|
24
|
-
"@threenative/ui": "0.3.
|
|
22
|
+
"@threenative/core": ">=0.3.15",
|
|
23
|
+
"@threenative/physics": ">=0.3.15",
|
|
24
|
+
"@threenative/ui": ">=0.3.15",
|
|
25
25
|
"react": "19.2.0",
|
|
26
26
|
"react-dom": "19.2.0",
|
|
27
27
|
"react-reconciler": "0.33.0",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@tailwindcss/vite": "4.3.3",
|
|
32
|
-
"@threenative/assets": "0.3.
|
|
33
|
-
"@threenative/playtest": "0.3.
|
|
32
|
+
"@threenative/assets": ">=0.3.16",
|
|
33
|
+
"@threenative/playtest": ">=0.3.15",
|
|
34
34
|
"@types/react": "19.2.0",
|
|
35
35
|
"@types/react-dom": "19.2.0",
|
|
36
36
|
"@types/three": "0.187.0",
|
|
37
37
|
"@vitejs/plugin-react": "6.0.5",
|
|
38
|
-
"create-threenative": "0.2.
|
|
38
|
+
"create-threenative": "0.2.20",
|
|
39
39
|
"esbuild": "0.27.0",
|
|
40
40
|
"playwright": "1.62.1",
|
|
41
41
|
"tailwindcss": "4.3.3",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"eslint": "10.13.0"
|
|
47
47
|
},
|
|
48
48
|
"optionalDependencies": {
|
|
49
|
-
"@threenative/runtime-native": "0.3.
|
|
49
|
+
"@threenative/runtime-native": ">=0.3.15"
|
|
50
50
|
},
|
|
51
51
|
"overrides": {
|
|
52
52
|
"sharp": ">=0.35.4",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SnowField } from "@threenative/core/world";
|
|
2
2
|
import { CharacterBody3D, CollisionShape3D, type IPhysicsContext } from "@threenative/physics";
|
|
3
|
-
import { Object3D } from "three";
|
|
3
|
+
import { MathUtils, Object3D } from "three";
|
|
4
4
|
import { BOOT_AREA, bootPrint } from "../render/bootPrint.js";
|
|
5
5
|
import { ExplorerModel, type IFootPose } from "../render/explorer.js";
|
|
6
6
|
import type { SnowMaterials } from "../render/materials.js";
|
|
@@ -45,12 +45,6 @@ export const STANCE = 0.2;
|
|
|
45
45
|
|
|
46
46
|
const clamp = (value: number, low: number, high: number) => Math.max(low, Math.min(high, value));
|
|
47
47
|
const lerp = (a: number, b: number, t: number) => a + (b - a) * t;
|
|
48
|
-
const damp = (a: number, b: number, rate: number, dt: number) =>
|
|
49
|
-
lerp(a, b, 1 - Math.exp(-rate * Math.max(0, dt)));
|
|
50
|
-
const smoothstep = (edge0: number, edge1: number, value: number) => {
|
|
51
|
-
const t = clamp((value - edge0) / (edge1 - edge0), 0, 1);
|
|
52
|
-
return t * t * (3 - 2 * t);
|
|
53
|
-
};
|
|
54
48
|
|
|
55
49
|
/** Walking pace through powder: deeper, softer snow is slower; packed snow is faster. */
|
|
56
50
|
function paceThrough(depth: number, compaction: number, running: boolean): number {
|
|
@@ -146,8 +140,8 @@ export class Explorer {
|
|
|
146
140
|
const length = Math.hypot(move.x, move.z);
|
|
147
141
|
const scale = length > 1 ? 1 / length : 1;
|
|
148
142
|
const moving = length > 0.01;
|
|
149
|
-
this.#velocity.x = damp(this.#velocity.x, move.x * scale * pace, moving ? 5 : 8, dt);
|
|
150
|
-
this.#velocity.z = damp(this.#velocity.z, move.z * scale * pace, moving ? 5 : 8, dt);
|
|
143
|
+
this.#velocity.x = MathUtils.damp(this.#velocity.x, move.x * scale * pace, moving ? 5 : 8, dt);
|
|
144
|
+
this.#velocity.z = MathUtils.damp(this.#velocity.z, move.z * scale * pace, moving ? 5 : 8, dt);
|
|
151
145
|
if (!moving && Math.hypot(this.#velocity.x, this.#velocity.z) < 0.025) {
|
|
152
146
|
this.#velocity.x = 0;
|
|
153
147
|
this.#velocity.z = 0;
|
|
@@ -159,7 +153,7 @@ export class Explorer {
|
|
|
159
153
|
if (this.speed > 0.05) {
|
|
160
154
|
const desired = Math.atan2(this.#velocity.x, this.#velocity.z);
|
|
161
155
|
const turn = Math.atan2(Math.sin(desired - this.heading), Math.cos(desired - this.heading));
|
|
162
|
-
this.heading
|
|
156
|
+
this.heading = MathUtils.damp(this.heading, this.heading + turn, 7, dt);
|
|
163
157
|
}
|
|
164
158
|
this.#cycle += travelled / (running ? 1.22 : 1.04);
|
|
165
159
|
this.#stepFeet(dt, running, hardness);
|
|
@@ -169,7 +163,7 @@ export class Explorer {
|
|
|
169
163
|
this.speed > 0.02
|
|
170
164
|
? Math.cos(this.#cycle * Math.PI * 4) * 0.016
|
|
171
165
|
: Math.sin(this.#elapsed * 1.8) * 0.003;
|
|
172
|
-
this.position.y = damp(
|
|
166
|
+
this.position.y = MathUtils.damp(
|
|
173
167
|
this.position.y,
|
|
174
168
|
terrainHeight(anchor.x, anchor.z) + snow.depth - sink + bob,
|
|
175
169
|
14,
|
|
@@ -221,7 +215,7 @@ export class Explorer {
|
|
|
221
215
|
progress = Math.max(foot.progress, clamp(foot.progress + foot.stop, 0, 1));
|
|
222
216
|
}
|
|
223
217
|
foot.progress = progress;
|
|
224
|
-
const eased = smoothstep(0, 1
|
|
218
|
+
const eased = MathUtils.smoothstep(progress, 0, 1);
|
|
225
219
|
foot.x = lerp(foot.from.x, foot.to.x, eased);
|
|
226
220
|
foot.z = lerp(foot.from.z, foot.to.z, eased);
|
|
227
221
|
const lift =
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// Change the sole, the tread or the rim here; `SnowField` only presses whatever shape it is given.
|
|
3
3
|
|
|
4
4
|
/** One sample of a contact profile, in the shape `SnowField.stamp` reads. */
|
|
5
|
+
import { MathUtils } from "three";
|
|
6
|
+
|
|
5
7
|
interface IPrintSample {
|
|
6
8
|
readonly bank: number;
|
|
7
9
|
readonly coverage: number;
|
|
@@ -14,7 +16,7 @@ const NOTHING: IPrintSample = { bank: 0, coverage: 0, disturbance: 0, relief: 0,
|
|
|
14
16
|
|
|
15
17
|
function smoothstep(edge0: number, edge1: number, value: number): number {
|
|
16
18
|
const t = Math.max(0, Math.min(1, (value - edge0) / (edge1 - edge0)));
|
|
17
|
-
return t
|
|
19
|
+
return MathUtils.smoothstep(t, 0, 1);
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
/** The sole's area, m². Load over this is the pressure a planted boot puts on the snow. */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Generated for you. Framing is a game-owned decision.
|
|
2
2
|
import type { PerspectiveCamera } from "three";
|
|
3
|
+
import { MathUtils } from "three";
|
|
3
4
|
import type { CameraView } from "../state.js";
|
|
4
5
|
|
|
5
6
|
export function setupCamera(camera: PerspectiveCamera): void {
|
|
@@ -62,8 +63,8 @@ export class OrbitFollow {
|
|
|
62
63
|
ground: (x: number, z: number) => number,
|
|
63
64
|
dt: number,
|
|
64
65
|
): void {
|
|
65
|
-
const ease =
|
|
66
|
-
const settle =
|
|
66
|
+
const ease = MathUtils.damp(0, 1, 4.5, dt);
|
|
67
|
+
const settle = MathUtils.damp(0, 1, 5, dt);
|
|
67
68
|
this.#target.x += (goal.x - this.#target.x) * ease;
|
|
68
69
|
this.#target.y += (goal.y - this.#target.y) * ease;
|
|
69
70
|
this.#target.z += (goal.z - this.#target.z) * ease;
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
Group,
|
|
10
10
|
InstancedMesh,
|
|
11
11
|
LineSegments,
|
|
12
|
+
MathUtils,
|
|
12
13
|
Mesh,
|
|
13
14
|
Object3D,
|
|
14
15
|
PlaneGeometry,
|
|
@@ -27,16 +28,15 @@ export interface IObstacle {
|
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
function seededRandom(seed: number): () => number {
|
|
30
|
-
let state = seed;
|
|
31
|
+
let state = seed >>> 0;
|
|
31
32
|
return () => {
|
|
32
33
|
state = (state * 1664525 + 1013904223) >>> 0;
|
|
33
34
|
return state / 4294967296;
|
|
34
35
|
};
|
|
35
36
|
}
|
|
36
|
-
|
|
37
37
|
const smoothstep = (edge0: number, edge1: number, value: number) => {
|
|
38
38
|
const t = Math.max(0, Math.min(1, (value - edge0) / (edge1 - edge0)));
|
|
39
|
-
return t
|
|
39
|
+
return MathUtils.smoothstep(t, 0, 1);
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
/** Glade-edge pines by hand, then a ring of forest further out. `[x, z, height]`. */
|
|
@@ -14,6 +14,9 @@ import { palette } from "./palette.js";
|
|
|
14
14
|
const MOVE_RADIUS = 72;
|
|
15
15
|
const EDGE = 36;
|
|
16
16
|
|
|
17
|
+
/** The knob's next point: `update` runs every frame, so it uses one instance. */
|
|
18
|
+
const knobPosition = new Vector2();
|
|
19
|
+
|
|
17
20
|
export interface ITouchPointer {
|
|
18
21
|
readonly position: Vector2;
|
|
19
22
|
}
|
|
@@ -101,13 +104,11 @@ export class TouchControls {
|
|
|
101
104
|
}
|
|
102
105
|
|
|
103
106
|
const center = this.#hasMoveAnchor ? this.#moveAnchor : this.#resting;
|
|
104
|
-
|
|
105
|
-
this.#
|
|
106
|
-
|
|
107
|
-
center.x + this.#input.move.x * MOVE_RADIUS,
|
|
108
|
-
center.y - this.#input.move.y * MOVE_RADIUS,
|
|
109
|
-
),
|
|
107
|
+
knobPosition.set(
|
|
108
|
+
center.x + this.#input.move.x * MOVE_RADIUS,
|
|
109
|
+
center.y - this.#input.move.y * MOVE_RADIUS,
|
|
110
110
|
);
|
|
111
|
+
place(this.#moveKnob, knobPosition);
|
|
111
112
|
this.#moveKnob.material = this.#hasMoveAnchor ? this.#activeMaterial : this.#idleMaterial;
|
|
112
113
|
this.#layout(size);
|
|
113
114
|
return this.#input;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Generated for you. Snowfall, the blizzard and the powder a boot kicks up. `GPUParticles3D` (the
|
|
2
2
|
// scene passes it in) owns
|
|
3
3
|
// the buffers, dispatch and lifetime; the flake's shape, colour, size, drift and fall are here.
|
|
4
|
-
import { type Sprite, Vector2 } from "three";
|
|
4
|
+
import { MathUtils, type Sprite, Vector2 } from "three";
|
|
5
5
|
import {
|
|
6
6
|
Fn,
|
|
7
7
|
atan,
|
|
@@ -233,8 +233,6 @@ export function createWeather(options: {
|
|
|
233
233
|
let wind = 0.4;
|
|
234
234
|
let drifted = { x: 0, z: 0 };
|
|
235
235
|
let fallen = 0;
|
|
236
|
-
const damp = (a: number, b: number, rate: number, dt: number) =>
|
|
237
|
-
a + (b - a) * (1 - Math.exp(-rate * Math.max(0, dt)));
|
|
238
236
|
return {
|
|
239
237
|
bursts: bursts.map((burst) => burst.particles),
|
|
240
238
|
burst(at, strength) {
|
|
@@ -253,10 +251,10 @@ export function createWeather(options: {
|
|
|
253
251
|
update(dt, centre, pixelScale, settings) {
|
|
254
252
|
fall.pixelScale.value = pixelScale;
|
|
255
253
|
time += dt;
|
|
256
|
-
storm = damp(storm, settings.blizzard ? 1 : 0, 0.95, dt);
|
|
254
|
+
storm = MathUtils.damp(storm, settings.blizzard ? 1 : 0, 0.95, dt);
|
|
257
255
|
const gust = 1 + 0.22 * Math.sin(time * 1.1) + 0.12 * Math.sin(time * 2.73 + 1.6);
|
|
258
256
|
const target = (settings.wind * (1 - storm) + (9.5 + settings.wind * 0.5) * storm) * gust;
|
|
259
|
-
wind = damp(wind, target, 2.3, dt);
|
|
257
|
+
wind = MathUtils.damp(wind, target, 2.3, dt);
|
|
260
258
|
drifted = { x: drifted.x + wind * dt, z: drifted.z + wind * 0.24 * dt };
|
|
261
259
|
fallen += settings.fallSpeed * (0.95 + storm * 0.7) * dt;
|
|
262
260
|
fall.drift.value.set(drifted.x, drifted.z);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Heightfield, SnowField } from "@threenative/core/world";
|
|
2
|
+
import { MathUtils } from "three";
|
|
2
3
|
|
|
3
4
|
/** The playable snowfield is a square this many metres across, centred on the origin. */
|
|
4
5
|
export const FIELD_SIZE = 24;
|
|
@@ -22,7 +23,7 @@ export const EXPLORER_LAYER = 0b1000;
|
|
|
22
23
|
|
|
23
24
|
function smoothstep(edge0: number, edge1: number, value: number): number {
|
|
24
25
|
const t = Math.max(0, Math.min(1, (value - edge0) / (edge1 - edge0)));
|
|
25
|
-
return t
|
|
26
|
+
return MathUtils.smoothstep(t, 0, 1);
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
/** Rolling ground under the snow: gentle swells in the glade, hills beyond it. */
|
|
@@ -52,34 +52,34 @@
|
|
|
52
52
|
},
|
|
53
53
|
"mobile-low": {
|
|
54
54
|
"contributions": {
|
|
55
|
-
"graphOutputChanged": ["
|
|
55
|
+
"graphOutputChanged": ["bloom", "vignette", "antialias"]
|
|
56
56
|
},
|
|
57
57
|
"stages": {
|
|
58
58
|
"excludes": ["ambientOcclusion", "ssgi", "traa", "motionBlur", "grade", "grain"],
|
|
59
|
-
"includes": ["
|
|
60
|
-
"order": ["
|
|
59
|
+
"includes": ["bloom", "vignette", "antialias"],
|
|
60
|
+
"order": ["bloom", "vignette", "antialias"]
|
|
61
61
|
},
|
|
62
62
|
"tier": "low"
|
|
63
63
|
},
|
|
64
64
|
"mobile-mid": {
|
|
65
65
|
"contributions": {
|
|
66
|
-
"graphOutputChanged": ["
|
|
66
|
+
"graphOutputChanged": ["bloom", "vignette", "antialias"]
|
|
67
67
|
},
|
|
68
68
|
"stages": {
|
|
69
69
|
"excludes": ["ambientOcclusion", "ssgi", "traa", "motionBlur", "grade", "grain"],
|
|
70
|
-
"includes": ["
|
|
71
|
-
"order": ["
|
|
70
|
+
"includes": ["bloom", "vignette", "antialias"],
|
|
71
|
+
"order": ["bloom", "vignette", "antialias"]
|
|
72
72
|
},
|
|
73
73
|
"tier": "low"
|
|
74
74
|
},
|
|
75
75
|
"software": {
|
|
76
76
|
"contributions": {
|
|
77
|
-
"graphOutputChanged": ["
|
|
77
|
+
"graphOutputChanged": ["bloom", "vignette", "antialias"]
|
|
78
78
|
},
|
|
79
79
|
"stages": {
|
|
80
80
|
"excludes": ["ambientOcclusion", "ssgi", "traa", "motionBlur", "grade", "grain"],
|
|
81
|
-
"includes": ["
|
|
82
|
-
"order": ["
|
|
81
|
+
"includes": ["bloom", "vignette", "antialias"],
|
|
82
|
+
"order": ["bloom", "vignette", "antialias"]
|
|
83
83
|
},
|
|
84
84
|
"tier": "low"
|
|
85
85
|
}
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"format:check": "biome format src"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@threenative/core": "0.3.
|
|
24
|
-
"@threenative/physics": "0.3.
|
|
25
|
-
"@threenative/ui": "0.3.
|
|
23
|
+
"@threenative/core": ">=0.3.15",
|
|
24
|
+
"@threenative/physics": ">=0.3.15",
|
|
25
|
+
"@threenative/ui": ">=0.3.15",
|
|
26
26
|
"react": "19.2.0",
|
|
27
27
|
"react-dom": "19.2.0",
|
|
28
28
|
"react-reconciler": "0.33.0",
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@tailwindcss/vite": "4.3.3",
|
|
33
|
-
"@threenative/assets": "0.3.
|
|
34
|
-
"@threenative/playtest": "0.3.
|
|
33
|
+
"@threenative/assets": ">=0.3.16",
|
|
34
|
+
"@threenative/playtest": ">=0.3.15",
|
|
35
35
|
"@types/react": "19.2.0",
|
|
36
36
|
"@types/react-dom": "19.2.0",
|
|
37
37
|
"@types/three": "0.187.0",
|
|
38
38
|
"@vitejs/plugin-react": "6.0.5",
|
|
39
|
-
"create-threenative": "0.2.
|
|
39
|
+
"create-threenative": "0.2.20",
|
|
40
40
|
"esbuild": "0.27.0",
|
|
41
41
|
"playwright": "1.62.1",
|
|
42
42
|
"tailwindcss": "4.3.3",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"eslint": "10.13.0"
|
|
48
48
|
},
|
|
49
49
|
"optionalDependencies": {
|
|
50
|
-
"@threenative/runtime-native": "0.3.
|
|
50
|
+
"@threenative/runtime-native": ">=0.3.15"
|
|
51
51
|
},
|
|
52
52
|
"overrides": {
|
|
53
53
|
"sharp": ">=0.35.4",
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { BlendSpace1D, type ICtx, SkeletalMesh3D } from "@threenative/core";
|
|
2
2
|
import { CharacterBody3D, CollisionShape3D, type IPhysicsContext } from "@threenative/physics";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
type AnimationClip,
|
|
5
|
+
Group,
|
|
6
|
+
MathUtils,
|
|
7
|
+
type Mesh,
|
|
8
|
+
type Object3D,
|
|
9
|
+
Quaternion,
|
|
10
|
+
Vector3,
|
|
11
|
+
} from "three";
|
|
4
12
|
import { type IStarterConventions, preparePlayerConventions } from "../conventions.js";
|
|
5
13
|
import type { ITouchInput } from "../render/touch-controls.js";
|
|
6
14
|
import type { GameState } from "../state.js";
|
|
@@ -143,7 +151,7 @@ export class Player {
|
|
|
143
151
|
// Touch walks until the stick is fully deflected; no separate run button.
|
|
144
152
|
const running = ctx.input.pressed("run") || (touch?.move.length() ?? 0) >= 1;
|
|
145
153
|
const speed = running ? RUN_SPEED : WALK_SPEED;
|
|
146
|
-
const ease = 1
|
|
154
|
+
const ease = MathUtils.damp(0, 1, 1 / 0.15, dt);
|
|
147
155
|
const moveZ = -move.y;
|
|
148
156
|
this.body.velocity.x += (move.x * speed - this.body.velocity.x) * ease;
|
|
149
157
|
this.body.velocity.z += (moveZ * speed - this.body.velocity.z) * ease;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// Camera framing is one of the loudest things in a screenshot, so it lives
|
|
10
10
|
// here in your repo rather than behind a framework option.
|
|
11
11
|
import type { PerspectiveCamera, Vector3 } from "three";
|
|
12
|
-
import { Vector3 as Vec3 } from "three";
|
|
12
|
+
import { MathUtils, Vector3 as Vec3 } from "three";
|
|
13
13
|
|
|
14
14
|
export interface ISpringArmOptions {
|
|
15
15
|
/** Where the camera sits relative to its target, before smoothing. */
|
|
@@ -102,7 +102,7 @@ export function createSpringArm(
|
|
|
102
102
|
desired.copy(target).add(targetOffset());
|
|
103
103
|
// 1 - e^(-dt/damping): the frame-rate-independent form of a lerp. At 30fps
|
|
104
104
|
// and 120fps the camera ends up in the same place after the same second.
|
|
105
|
-
camera.position.lerp(desired, 1
|
|
105
|
+
camera.position.lerp(desired, MathUtils.damp(0, 1, 1 / damping, dt));
|
|
106
106
|
clear(target);
|
|
107
107
|
camera.lookAt(aim.copy(target).add(lookAhead));
|
|
108
108
|
};
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
// Independent CPU implementation. The material samples four Unreal textures that this repository
|
|
7
7
|
// must not carry, so each one is regenerated here from a seeded noise whose per-channel value
|
|
8
8
|
// quantiles and correlation lengths match the Unreal texture (measured, see the spec).
|
|
9
|
+
import { MathUtils } from "three";
|
|
10
|
+
|
|
9
11
|
import {
|
|
10
12
|
BOTTOM_KM,
|
|
11
13
|
CAMERA_KM,
|
|
@@ -110,7 +112,7 @@ const PROFILE_COEFFICIENTS = [
|
|
|
110
112
|
const clamp = (v: number): number => Math.max(0, Math.min(1, v));
|
|
111
113
|
const smooth = (v: number): number => {
|
|
112
114
|
const t = clamp(v);
|
|
113
|
-
return t
|
|
115
|
+
return MathUtils.smoothstep(t, 0, 1);
|
|
114
116
|
};
|
|
115
117
|
const mod = (a: number, n: number): number => ((a % n) + n) % n;
|
|
116
118
|
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
DoubleSide,
|
|
12
12
|
Float32BufferAttribute,
|
|
13
13
|
LinearMipmapLinearFilter,
|
|
14
|
+
MathUtils,
|
|
14
15
|
MeshStandardMaterial,
|
|
15
16
|
RepeatWrapping,
|
|
16
17
|
SRGBColorSpace,
|
|
@@ -86,8 +87,8 @@ function grainNormalTexture(size = 128): DataTexture {
|
|
|
86
87
|
const y0 = Math.floor(v);
|
|
87
88
|
const fx = u - x0;
|
|
88
89
|
const fy = v - y0;
|
|
89
|
-
const sx = fx
|
|
90
|
-
const sy = fy
|
|
90
|
+
const sx = MathUtils.smoothstep(fx, 0, 1);
|
|
91
|
+
const sy = MathUtils.smoothstep(fy, 0, 1);
|
|
91
92
|
const at = (i: number, j: number): number =>
|
|
92
93
|
values[(((j % count) + count) % count) * count + (((i % count) + count) % count)] ?? 0;
|
|
93
94
|
const top = at(x0, y0) + (at(x0 + 1, y0) - at(x0, y0)) * sx;
|
|
@@ -15,6 +15,9 @@ const MOVE_RADIUS = 72;
|
|
|
15
15
|
const BUTTON_RADIUS = 62;
|
|
16
16
|
const EDGE = 36;
|
|
17
17
|
|
|
18
|
+
/** The knob's next point: `update` runs every frame, so it uses one instance. */
|
|
19
|
+
const knobPosition = new Vector2();
|
|
20
|
+
|
|
18
21
|
export interface ITouchPointer {
|
|
19
22
|
readonly position: Vector2;
|
|
20
23
|
}
|
|
@@ -113,13 +116,11 @@ export class TouchControls {
|
|
|
113
116
|
}
|
|
114
117
|
|
|
115
118
|
const center = this.#hasMoveAnchor ? this.#moveAnchor : this.#resting;
|
|
116
|
-
|
|
117
|
-
this.#
|
|
118
|
-
|
|
119
|
-
center.x + this.#input.move.x * MOVE_RADIUS,
|
|
120
|
-
center.y - this.#input.move.y * MOVE_RADIUS,
|
|
121
|
-
),
|
|
119
|
+
knobPosition.set(
|
|
120
|
+
center.x + this.#input.move.x * MOVE_RADIUS,
|
|
121
|
+
center.y - this.#input.move.y * MOVE_RADIUS,
|
|
122
122
|
);
|
|
123
|
+
place(this.#moveKnob, knobPosition);
|
|
123
124
|
this.#jump.material = jump ? this.#activeMaterial : this.#idleMaterial;
|
|
124
125
|
this.#input.jumpPressed = jump && !this.#wasJump;
|
|
125
126
|
this.#wasJump = jump;
|
|
@@ -451,20 +451,7 @@ export class Play extends Scene<GameState, IPhysicsContext> {
|
|
|
451
451
|
),
|
|
452
452
|
);
|
|
453
453
|
frameState.respawns = previous.respawns + (respawned ? 1 : 0);
|
|
454
|
-
|
|
455
|
-
const changed =
|
|
456
|
-
frameState.coyoteJumps !== current.coyoteJumps ||
|
|
457
|
-
frameState.flagDisplacement !== current.flagDisplacement ||
|
|
458
|
-
frameState.flagReadbacks !== current.flagReadbacks ||
|
|
459
|
-
frameState.flagSteps !== current.flagSteps ||
|
|
460
|
-
frameState.jumps !== current.jumps ||
|
|
461
|
-
frameState.lives !== current.lives ||
|
|
462
|
-
frameState.odometer !== current.odometer ||
|
|
463
|
-
frameState.peakRise !== current.peakRise ||
|
|
464
|
-
frameState.playerX !== current.playerX ||
|
|
465
|
-
frameState.progress !== current.progress ||
|
|
466
|
-
frameState.respawns !== current.respawns;
|
|
467
|
-
if (changed) frameCtx.state.set(frameState);
|
|
454
|
+
frameCtx.state.set(frameState);
|
|
468
455
|
if (respawned) frameCtx.state.flush();
|
|
469
456
|
};
|
|
470
457
|
}
|