@auraindustry/aurajs 0.1.1 → 0.1.5
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 +7 -0
- package/benchmarks/perf-thresholds.json +27 -0
- package/package.json +6 -1
- package/src/ai-guidance.mjs +302 -0
- package/src/asset-pack.mjs +2 -1
- package/src/authored-project.mjs +498 -2
- package/src/authored-runtime.mjs +14 -0
- package/src/bin-integrity.mjs +33 -26
- package/src/build-contract/capabilities.mjs +87 -1
- package/src/build-contract/constants.mjs +1 -0
- package/src/build-contract.mjs +2 -0
- package/src/bundler.mjs +143 -13
- package/src/cli.mjs +681 -13
- package/src/commands/packs.mjs +741 -0
- package/src/commands/project-authoring.mjs +128 -1
- package/src/conformance/cases/app-and-ui-runtime-cases.mjs +1 -2
- package/src/conformance/cases/core-runtime-cases.mjs +6 -2
- package/src/conformance/cases/scene3d-and-media-cases.mjs +238 -0
- package/src/conformance/cases/systems-and-gameplay-cases.mjs +1126 -10
- package/src/conformance-mobile.mjs +166 -0
- package/src/conformance.mjs +89 -30
- package/src/evidence-bundle.mjs +242 -0
- package/src/external-package-surface.mjs +1 -1
- package/src/headless-test/runtime-coordinator.mjs +186 -33
- package/src/headless-test.mjs +2 -0
- package/src/helpers/2d/index.mjs +183 -0
- package/src/helpers/index.mjs +26 -0
- package/src/helpers/starter-utils/adventure-objectives.js +102 -0
- package/src/helpers/starter-utils/adventure-world-2d.js +221 -0
- package/src/helpers/starter-utils/animation-2d.js +337 -0
- package/src/helpers/starter-utils/animation-packaging-2d.js +203 -0
- package/src/helpers/starter-utils/atlas-assets-2d.js +111 -0
- package/src/helpers/starter-utils/autoplay-debug-2d.js +215 -0
- package/src/helpers/starter-utils/avatar-3d.js +404 -0
- package/src/helpers/starter-utils/combat-feedback-2d.js +320 -0
- package/src/helpers/starter-utils/combat-runtime-2d.js +290 -0
- package/src/helpers/starter-utils/core.js +150 -0
- package/src/helpers/starter-utils/dialogue-2d.js +351 -0
- package/src/helpers/starter-utils/enemy-archetypes-2d.js +68 -0
- package/src/helpers/starter-utils/index.js +26 -0
- package/src/helpers/starter-utils/inventory-2d.js +268 -0
- package/src/helpers/starter-utils/journal-2d.js +267 -0
- package/src/helpers/starter-utils/platformer-3d.js +132 -0
- package/src/helpers/starter-utils/scene-audio-2d.js +236 -0
- package/src/helpers/starter-utils/streamed-world-2d.js +378 -0
- package/src/helpers/starter-utils/tilemap-nav-2d.js +499 -0
- package/src/helpers/starter-utils/tilemap-world-2d.js +205 -0
- package/src/helpers/starter-utils/triggers.js +662 -0
- package/src/helpers/starter-utils/tween-2d.js +615 -0
- package/src/helpers/starter-utils/wave-director.js +101 -0
- package/src/helpers/starter-utils/world-compositor-2d.js +253 -0
- package/src/helpers/starter-utils/world-persistence-2d.js +180 -0
- package/src/mobile/android/build.mjs +606 -0
- package/src/mobile/android/host-artifact.mjs +280 -0
- package/src/mobile/ios/build.mjs +1323 -0
- package/src/mobile/ios/host-artifact.mjs +819 -0
- package/src/mobile/shared/capabilities.mjs +174 -0
- package/src/package-integrity.mjs +18 -4
- package/src/packs/catalog.mjs +259 -0
- package/src/perf-benchmark-runner.mjs +17 -12
- package/src/perf-benchmark.mjs +408 -4
- package/src/publish-command.mjs +434 -17
- package/src/publish-validation.mjs +22 -11
- package/src/replay-runtime.mjs +257 -0
- package/src/scaffold/config.mjs +2 -0
- package/src/scaffold/fs.mjs +8 -1
- package/src/scaffold/project-docs.mjs +101 -41
- package/src/scaffold.mjs +4 -0
- package/src/session-runtime.mjs +4 -3
- package/src/web-conformance.mjs +0 -36
- package/templates/create/2d/src/runtime/app.js +4 -0
- package/templates/create/2d-adventure/config/gameplay/adventure.config.js +9 -6
- package/templates/create/2d-adventure/content/gameplay/dialogue.js +85 -0
- package/templates/create/2d-adventure/content/gameplay/world.js +32 -36
- package/templates/create/2d-adventure/content/gameplay/world.tilemap.json +273 -0
- package/templates/create/2d-adventure/docs/design/loop.md +4 -3
- package/templates/create/2d-adventure/prefabs/relic.prefab.js +10 -10
- package/templates/create/2d-adventure/prefabs/world.prefab.js +127 -74
- package/templates/create/2d-adventure/scenes/gameplay.scene.js +603 -112
- package/templates/create/2d-adventure/src/runtime/capabilities.js +16 -0
- package/templates/create/2d-adventure/ui/hud.screen.js +187 -4
- package/templates/create/2d-adventure/ui/journal.screen.js +183 -0
- package/templates/create/2d-survivor/src/runtime/app.js +4 -0
- package/templates/create/3d/scenes/gameplay.scene.js +30 -3
- package/templates/create/3d/src/runtime/app.js +4 -0
- package/templates/create/3d/src/runtime/capabilities.js +5 -0
- package/templates/create/3d/src/runtime/materials.js +10 -0
- package/templates/create/3d-adventure/scenes/gameplay.scene.js +30 -3
- package/templates/create/3d-adventure/src/runtime/capabilities.js +5 -0
- package/templates/create/3d-adventure/src/runtime/materials.js +11 -0
- package/templates/create/3d-collectathon/scenes/gameplay.scene.js +30 -3
- package/templates/create/3d-collectathon/src/runtime/app.js +4 -0
- package/templates/create/3d-collectathon/src/runtime/capabilities.js +5 -0
- package/templates/create/3d-collectathon/src/runtime/materials.js +10 -0
- package/templates/create/blank/assets/splash/aurajs-gg-wordmark.webp +0 -0
- package/templates/create/blank/assets/splash/bg.webp +0 -0
- package/templates/create/blank/assets/splash/boot-loop.wav +0 -0
- package/templates/create/blank/assets/splash/boot-sting.wav +0 -0
- package/templates/create/blank/assets/splash/logo-mascot-sheet.webp +0 -0
- package/templates/create/blank/assets/splash/logoholo.webp +0 -0
- package/templates/create/blank/src/main.js +5 -1
- package/templates/create/blank/src/runtime/splash.js +305 -0
- package/templates/create/local-multiplayer/scenes/gameplay.scene.js +186 -12
- package/templates/create/local-multiplayer/src/runtime/capabilities.js +8 -1
- package/templates/create/shared/assets/splash/aurajs-gg-wordmark.webp +0 -0
- package/templates/create/shared/assets/splash/bg.webp +0 -0
- package/templates/create/shared/assets/splash/boot-loop.wav +0 -0
- package/templates/create/shared/assets/splash/boot-sting.wav +0 -0
- package/templates/create/shared/assets/splash/logo-mascot-sheet.webp +0 -0
- package/templates/create/shared/assets/splash/logoholo.webp +0 -0
- package/templates/create/shared/src/runtime/splash.js +305 -0
- package/templates/create/shared/src/runtime/ui-forms.js +552 -0
- package/templates/create/shared/src/starter-utils/adventure-world-2d.js +221 -0
- package/templates/create/shared/src/starter-utils/animation-packaging-2d.js +203 -0
- package/templates/create/shared/src/starter-utils/atlas-assets-2d.js +111 -0
- package/templates/create/shared/src/starter-utils/autoplay-debug-2d.js +215 -0
- package/templates/create/shared/src/starter-utils/combat-runtime-2d.js +290 -0
- package/templates/create/shared/src/starter-utils/dialogue-2d.js +351 -0
- package/templates/create/shared/src/starter-utils/index.js +15 -1
- package/templates/create/shared/src/starter-utils/inventory-2d.js +268 -0
- package/templates/create/shared/src/starter-utils/journal-2d.js +267 -0
- package/templates/create/shared/src/starter-utils/scene-audio-2d.js +236 -0
- package/templates/create/shared/src/starter-utils/streamed-world-2d.js +378 -0
- package/templates/create/shared/src/starter-utils/tilemap-nav-2d.js +499 -0
- package/templates/create/shared/src/starter-utils/tilemap-world-2d.js +205 -0
- package/templates/create/shared/src/starter-utils/world-compositor-2d.js +253 -0
- package/templates/create/shared/src/starter-utils/world-persistence-2d.js +180 -0
- package/templates/create/video-cutscene/src/runtime/app.js +4 -0
- package/templates/create-bin/play.js +148 -7
- package/templates/skills/auramaxx/SKILL.md +46 -0
- package/templates/skills/auramaxx/project-requirements.md +68 -0
- package/templates/skills/auramaxx/starter-recipes.md +104 -0
- package/templates/skills/auramaxx/validation-checklist.md +49 -0
- package/templates/starter/assets/splash/aurajs-gg-wordmark.webp +0 -0
- package/templates/starter/assets/splash/bg.webp +0 -0
- package/templates/starter/assets/splash/boot-loop.wav +0 -0
- package/templates/starter/assets/splash/boot-sting.wav +0 -0
- package/templates/starter/assets/splash/logo-mascot-sheet.webp +0 -0
- package/templates/starter/assets/splash/logoholo.webp +0 -0
- package/templates/starter/src/main.js +4 -0
- package/templates/starter/src/runtime/splash.js +305 -0
- package/templates/skills/aurajs/SKILL.md +0 -96
- package/templates/skills/aurajs/api-contract-3d.md +0 -7
- package/templates/skills/aurajs/api-contract.md +0 -7
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
createTilemapWorld2D,
|
|
3
|
+
drawTilemapWorld2D,
|
|
4
|
+
ensureTilemapWorldLoaded2D,
|
|
5
|
+
listTilemapWorldObjects2D,
|
|
6
|
+
moveActorThroughTilemapWorld2D,
|
|
7
|
+
resolveTilemapSpawn2D,
|
|
8
|
+
} from '../src/starter-utils/index.js';
|
|
9
|
+
import { WORLD_OBJECT_LAYERS, WORLD_ORIGIN, WORLD_TILEMAP } from '../content/gameplay/world.js';
|
|
2
10
|
|
|
3
11
|
const worldPrefab = {
|
|
4
12
|
id: 'world',
|
|
@@ -8,118 +16,163 @@ const worldPrefab = {
|
|
|
8
16
|
kind: 'environment2d',
|
|
9
17
|
},
|
|
10
18
|
hooks: {},
|
|
11
|
-
notes: ['Keep authored room layout in content/ and world rendering or collision affordances here.'],
|
|
19
|
+
notes: ['Keep authored room layout in content/ and tilemap-backed world rendering or collision affordances here.'],
|
|
12
20
|
};
|
|
13
21
|
|
|
14
|
-
function
|
|
22
|
+
function worldBounds(world) {
|
|
23
|
+
const info = world?.info || null;
|
|
24
|
+
const width = Number(info?.width || 0) * Number(info?.tilewidth || 0);
|
|
25
|
+
const height = Number(info?.height || 0) * Number(info?.tileheight || 0);
|
|
15
26
|
return {
|
|
16
|
-
x:
|
|
17
|
-
y:
|
|
18
|
-
|
|
19
|
-
|
|
27
|
+
x: Number(world?.offsetX || 0),
|
|
28
|
+
y: Number(world?.offsetY || 0),
|
|
29
|
+
width,
|
|
30
|
+
height,
|
|
20
31
|
};
|
|
21
32
|
}
|
|
22
33
|
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
34
|
+
function objectProperty(object, name, fallback = null) {
|
|
35
|
+
if (!object || typeof object !== 'object') return fallback;
|
|
36
|
+
const properties = object.properties;
|
|
37
|
+
if (Array.isArray(properties)) {
|
|
38
|
+
const entry = properties.find((candidate) => candidate && candidate.name === name) || null;
|
|
39
|
+
return entry && Object.prototype.hasOwnProperty.call(entry, 'value') ? entry.value : fallback;
|
|
40
|
+
}
|
|
41
|
+
if (properties && typeof properties === 'object' && Object.prototype.hasOwnProperty.call(properties, name)) {
|
|
42
|
+
return properties[name];
|
|
43
|
+
}
|
|
44
|
+
return fallback;
|
|
28
45
|
}
|
|
29
46
|
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
47
|
+
function ensureScenery(world) {
|
|
48
|
+
if (!world || world.loaded !== true) return [];
|
|
49
|
+
if (!Array.isArray(world.sceneryObjects)) {
|
|
50
|
+
world.sceneryObjects = listTilemapWorldObjects2D(world, globalThis.aura, {
|
|
51
|
+
layer: WORLD_OBJECT_LAYERS.scenery,
|
|
52
|
+
includeHidden: true,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return world.sceneryObjects;
|
|
34
56
|
}
|
|
35
57
|
|
|
36
|
-
function
|
|
37
|
-
return
|
|
58
|
+
function interactablesByKind(interactables = [], kind) {
|
|
59
|
+
return interactables.filter((entry) => entry && entry.kind === kind);
|
|
38
60
|
}
|
|
39
61
|
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
|
|
62
|
+
export function createAdventureWorldState() {
|
|
63
|
+
return createTilemapWorld2D({
|
|
64
|
+
mapSource: WORLD_TILEMAP,
|
|
65
|
+
offsetX: WORLD_ORIGIN.x,
|
|
66
|
+
offsetY: WORLD_ORIGIN.y,
|
|
67
|
+
cull: false,
|
|
68
|
+
});
|
|
43
69
|
}
|
|
44
70
|
|
|
45
71
|
export function createWorldPrefab() {
|
|
46
72
|
return {
|
|
47
73
|
...worldPrefab,
|
|
48
|
-
|
|
74
|
+
worldKind: 'tilemap-backed-adventure',
|
|
49
75
|
};
|
|
50
76
|
}
|
|
51
77
|
|
|
52
|
-
export function
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
if (
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
w: baseRect.w,
|
|
60
|
-
h: baseRect.h,
|
|
78
|
+
export function ensureAdventureWorldLoaded(world) {
|
|
79
|
+
const loaded = ensureTilemapWorldLoaded2D(world, globalThis.aura);
|
|
80
|
+
if (!loaded) return false;
|
|
81
|
+
if (!Array.isArray(world.sceneryObjects)) {
|
|
82
|
+
world.sceneryObjects = listTilemapWorldObjects2D(world, globalThis.aura, {
|
|
83
|
+
layer: WORLD_OBJECT_LAYERS.scenery,
|
|
84
|
+
includeHidden: true,
|
|
61
85
|
});
|
|
62
|
-
if (!collidesWithObstacle(candidate)) {
|
|
63
|
-
baseRect.x = candidate.x;
|
|
64
|
-
}
|
|
65
86
|
}
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
66
89
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
90
|
+
export function resolveAdventurePlayerSpawn(world, markerName = 'player-start') {
|
|
91
|
+
ensureAdventureWorldLoaded(world);
|
|
92
|
+
return resolveTilemapSpawn2D(world, globalThis.aura, {
|
|
93
|
+
layer: WORLD_OBJECT_LAYERS.markers,
|
|
94
|
+
name: markerName,
|
|
95
|
+
centered: true,
|
|
96
|
+
}) || {
|
|
97
|
+
x: WORLD_ORIGIN.x + 96,
|
|
98
|
+
y: WORLD_ORIGIN.y + 96,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
78
101
|
|
|
79
|
-
|
|
102
|
+
export function listAdventureWorldObjects(world, options = {}) {
|
|
103
|
+
ensureAdventureWorldLoaded(world);
|
|
104
|
+
return listTilemapWorldObjects2D(world, globalThis.aura, options);
|
|
80
105
|
}
|
|
81
106
|
|
|
82
|
-
export function
|
|
107
|
+
export function moveActorThroughAdventureWorld(world, actor, deltaX, deltaY, size) {
|
|
108
|
+
return moveActorThroughTilemapWorld2D(world, globalThis.aura, actor, deltaX, deltaY, size, size);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function drawAdventureWorld({
|
|
112
|
+
world,
|
|
113
|
+
interactables = [],
|
|
114
|
+
elapsed = 0,
|
|
115
|
+
activeCheckpointId = null,
|
|
116
|
+
runComplete = false,
|
|
117
|
+
}) {
|
|
118
|
+
ensureAdventureWorldLoaded(world);
|
|
119
|
+
const bounds = worldBounds(world);
|
|
120
|
+
|
|
83
121
|
aura.draw2d.rect(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
aura.rgb(0.
|
|
122
|
+
bounds.x - 24,
|
|
123
|
+
bounds.y - 24,
|
|
124
|
+
bounds.width + 48,
|
|
125
|
+
bounds.height + 48,
|
|
126
|
+
aura.rgb(0.05, 0.07, 0.1),
|
|
89
127
|
);
|
|
90
128
|
aura.draw2d.rect(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
aura.rgb(0.
|
|
129
|
+
bounds.x,
|
|
130
|
+
bounds.y,
|
|
131
|
+
bounds.width,
|
|
132
|
+
bounds.height,
|
|
133
|
+
aura.rgb(0.1, 0.14, 0.11),
|
|
96
134
|
);
|
|
135
|
+
drawTilemapWorld2D(world, globalThis.aura, { cull: false });
|
|
97
136
|
|
|
98
|
-
for (const
|
|
99
|
-
|
|
137
|
+
for (const object of ensureScenery(world)) {
|
|
138
|
+
const fill = String(objectProperty(object, 'fill', '#24322a'));
|
|
139
|
+
const border = String(objectProperty(object, 'border', '#45534b'));
|
|
140
|
+
aura.draw2d.rect(object.worldX, object.worldY, object.width, object.height, fill);
|
|
141
|
+
aura.draw2d.rect(object.worldX + 4, object.worldY + 4, Math.max(0, object.width - 8), Math.max(0, object.height - 8), border);
|
|
100
142
|
}
|
|
101
143
|
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
const
|
|
105
|
-
const
|
|
106
|
-
const size = site.size * pulse;
|
|
144
|
+
for (const checkpoint of interactablesByKind(interactables, 'checkpoint')) {
|
|
145
|
+
const active = checkpoint.checkpointId === activeCheckpointId || checkpoint.activated === true;
|
|
146
|
+
const pulse = 0.92 + (Math.sin((elapsed * 2.1) + checkpoint.x) * 0.08);
|
|
147
|
+
const size = Math.max(checkpoint.w, checkpoint.h) * pulse;
|
|
107
148
|
aura.draw2d.rect(
|
|
108
|
-
|
|
109
|
-
|
|
149
|
+
checkpoint.x + ((checkpoint.w - size) * 0.5),
|
|
150
|
+
checkpoint.y + ((checkpoint.h - size) * 0.5),
|
|
110
151
|
size,
|
|
111
152
|
size,
|
|
112
|
-
|
|
153
|
+
active ? aura.rgb(0.58, 1.0, 0.74) : aura.rgb(0.46, 0.64, 0.8),
|
|
113
154
|
);
|
|
114
155
|
}
|
|
115
156
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
157
|
+
for (const prop of interactablesByKind(interactables, 'prop')) {
|
|
158
|
+
const active = prop.activated === true;
|
|
159
|
+
aura.draw2d.rect(prop.x, prop.y, prop.w, prop.h, active ? aura.rgb(0.72, 0.82, 0.94) : aura.rgb(0.36, 0.42, 0.5));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
for (const gate of interactablesByKind(interactables, 'lock')) {
|
|
163
|
+
const pulse = gate.opened === true || runComplete === true
|
|
164
|
+
? 1
|
|
165
|
+
: 0.92 + (Math.sin((elapsed * 2.4) + gate.x) * 0.08);
|
|
166
|
+
const width = gate.w * pulse;
|
|
167
|
+
const height = gate.h * pulse;
|
|
168
|
+
aura.draw2d.rect(
|
|
169
|
+
gate.x + ((gate.w - width) * 0.5),
|
|
170
|
+
gate.y + ((gate.h - height) * 0.5),
|
|
171
|
+
width,
|
|
172
|
+
height,
|
|
173
|
+
gate.opened === true || runComplete === true ? aura.rgb(0.64, 1.0, 0.78) : aura.rgb(0.24, 0.3, 0.36),
|
|
174
|
+
);
|
|
175
|
+
}
|
|
123
176
|
}
|
|
124
177
|
|
|
125
178
|
export default worldPrefab;
|