nova64 0.2.4 → 0.2.6
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 +25 -8
- package/bin/nova64.js +165 -0
- package/dist/assets/console-CY_kygm3.js +14 -0
- package/dist/assets/console-CY_kygm3.js.map +1 -0
- package/dist/assets/main-l0sNRNKZ.js.map +1 -0
- package/dist/assets/sky/studio/nx.png +0 -0
- package/dist/assets/sky/studio/ny.png +0 -0
- package/dist/assets/sky/studio/nz.png +0 -0
- package/dist/assets/sky/studio/px.png +0 -0
- package/dist/assets/sky/studio/py.png +0 -0
- package/dist/assets/sky/studio/pz.png +0 -0
- package/dist/assets/vanilla-Dcuy32gi.js +2 -0
- package/dist/assets/vanilla-Dcuy32gi.js.map +1 -0
- package/dist/console.html +899 -0
- package/dist/docs/BENCHMARK.md +77 -0
- package/dist/docs/CHEATSHEET.md +255 -0
- package/dist/docs/EFFECTS_API_GUIDE.md +577 -0
- package/dist/docs/EFFECTS_QUICK_REFERENCE.md +331 -0
- package/dist/docs/FONT_CHARACTER_REFERENCE.md +219 -0
- package/dist/docs/FREE_GLB_ASSETS.md +330 -0
- package/dist/docs/FULLSCREEN_BUTTON_FEATURE.md +296 -0
- package/dist/docs/GAMEPAD_SUPPORT.md +348 -0
- package/dist/docs/GAME_IMPROVEMENTS.md +278 -0
- package/dist/docs/GAME_QUALITY_STATUS.md +300 -0
- package/dist/docs/MIGRATION_GUIDE.md +553 -0
- package/dist/docs/NOVA64_3D_API.md +356 -0
- package/dist/docs/NOVA64_API_REFERENCE.md +1406 -0
- package/dist/docs/NOVA64_UI_API.md +503 -0
- package/dist/docs/UI_SYSTEM_SUMMARY.md +445 -0
- package/dist/docs/VOXEL_ENGINE_GUIDE.md +662 -0
- package/dist/docs/VOXEL_QUICK_REFERENCE.md +386 -0
- package/dist/docs/api-3d.html +750 -0
- package/dist/docs/api-effects.html +385 -0
- package/dist/docs/api-improvements.md +121 -0
- package/dist/docs/api-skybox.html +407 -0
- package/dist/docs/api-sprites.html +321 -0
- package/dist/docs/api-voxel.html +337 -0
- package/dist/docs/api.html +543 -0
- package/dist/docs/assets.html +306 -0
- package/dist/docs/audio.html +340 -0
- package/dist/docs/blogs.html +286 -0
- package/dist/docs/collision.html +316 -0
- package/dist/docs/console.html +247 -0
- package/dist/docs/editor.html +297 -0
- package/dist/docs/font.html +247 -0
- package/dist/docs/framebuffer.html +247 -0
- package/dist/docs/fullscreen-button.html +297 -0
- package/dist/docs/gpu-systems.html +247 -0
- package/dist/docs/index.html +580 -0
- package/dist/docs/input.html +491 -0
- package/dist/docs/physics.html +311 -0
- package/dist/docs/screens.html +311 -0
- package/dist/docs/storage.html +311 -0
- package/dist/docs/textinput.html +332 -0
- package/dist/docs/ui.html +488 -0
- package/dist/examples/3d-advanced/code.js +695 -0
- package/dist/examples/adventure-comic-3d/code.js +342 -0
- package/dist/examples/audio-lab/code.js +150 -0
- package/dist/examples/boids-flocking/code.js +270 -0
- package/dist/examples/crystal-cathedral-3d/code.js +706 -0
- package/dist/examples/cyberpunk-city-3d/code.js +1383 -0
- package/dist/examples/demoscene/README.md +192 -0
- package/dist/examples/demoscene/code.js +1081 -0
- package/dist/examples/demoscene/meta.json +21 -0
- package/dist/examples/dungeon-crawler-3d/code.js +1117 -0
- package/dist/examples/f-zero-nova-3d/code.js +865 -0
- package/dist/examples/f-zero-nova-3d/code_old.js +1555 -0
- package/dist/examples/fps-demo-3d/code.js +744 -0
- package/dist/examples/game-of-life-3d/code.js +338 -0
- package/dist/examples/generative-art/code.js +632 -0
- package/dist/examples/hello-3d/code.js +325 -0
- package/dist/examples/hello-skybox/code.js +183 -0
- package/dist/examples/hello-world/code.js +19 -0
- package/dist/examples/input-showcase/code.js +109 -0
- package/dist/examples/instancing-demo/code.js +315 -0
- package/dist/examples/minecraft-demo/code.js +387 -0
- package/dist/examples/model-viewer-3d/code.js +114 -0
- package/dist/examples/mystical-realm-3d/code.js +1203 -0
- package/dist/examples/nature-explorer-3d/code.js +1318 -0
- package/dist/examples/particles-demo/code.js +522 -0
- package/dist/examples/pbr-showcase/code.js +140 -0
- package/dist/examples/physics-demo-3d/code.js +948 -0
- package/dist/examples/screen-demo/code.js +267 -0
- package/dist/examples/shooter-demo-3d/code.js +1286 -0
- package/dist/examples/space-combat-3d/IMPLEMENTATION_SUMMARY.md +109 -0
- package/dist/examples/space-combat-3d/README.md +135 -0
- package/dist/examples/space-combat-3d/code.js +1332 -0
- package/dist/examples/space-harrier-3d/code.js +923 -0
- package/dist/examples/star-fox-nova-3d/code.js +1116 -0
- package/dist/examples/star-fox-nova-3d/code_backup.js +410 -0
- package/dist/examples/star-fox-nova-3d/code_broken.js +1821 -0
- package/dist/examples/storage-quest/code.js +209 -0
- package/dist/examples/strider-demo-3d/IMPROVEMENT_OPTIONS.md +285 -0
- package/dist/examples/strider-demo-3d/cache-test.html +132 -0
- package/dist/examples/strider-demo-3d/code-fixed.js +582 -0
- package/dist/examples/strider-demo-3d/code-old.js +1537 -0
- package/dist/examples/strider-demo-3d/code.js +1462 -0
- package/dist/examples/strider-demo-3d/code.js.bak2 +1169 -0
- package/dist/examples/strider-demo-3d/fix-game.sh +53 -0
- package/dist/examples/super-plumber-64/README.md +128 -0
- package/dist/examples/super-plumber-64/code.js +1185 -0
- package/dist/examples/super-plumber-64/index.html +88 -0
- package/dist/examples/test-2d-overlay/code.js +32 -0
- package/dist/examples/test-font/code.js +51 -0
- package/dist/examples/test-minimal/code.js +21 -0
- package/dist/examples/ui-demo/code.js +306 -0
- package/dist/examples/wing-commander-space/README.md +180 -0
- package/dist/examples/wing-commander-space/code.js +1285 -0
- package/dist/examples/wizardry-3d/CHANGELOG.md +366 -0
- package/dist/examples/wizardry-3d/code.js +3928 -0
- package/dist/index.html +666 -0
- package/dist/os9-shell/assets/index-DIHfrTaW.css +1 -0
- package/dist/os9-shell/assets/index-KchE_ngx.js +483 -0
- package/dist/os9-shell/assets/index-KchE_ngx.js.map +1 -0
- package/dist/os9-shell/index.html +23 -0
- package/dist/os9-shell/nova-icon.svg +12 -0
- package/index.html +6 -1
- package/package.json +37 -32
- package/public/assets/sky/studio/nx.png +0 -0
- package/public/assets/sky/studio/ny.png +0 -0
- package/public/assets/sky/studio/nz.png +0 -0
- package/public/assets/sky/studio/px.png +0 -0
- package/public/assets/sky/studio/py.png +0 -0
- package/public/assets/sky/studio/pz.png +0 -0
- package/public/os9-shell/assets/index-KchE_ngx.js +483 -0
- package/public/os9-shell/assets/index-KchE_ngx.js.map +1 -0
- package/public/os9-shell/index.html +10 -1
- package/runtime/api-2d.js +301 -21
- package/runtime/api-3d/pbr.js +45 -1
- package/runtime/api-3d.js +1 -0
- package/runtime/api-effects.js +90 -3
- package/runtime/api-gameutils.js +476 -0
- package/runtime/api-generative.js +610 -0
- package/runtime/api-skybox.js +54 -0
- package/runtime/api-voxel.js +139 -28
- package/runtime/gpu-threejs.js +13 -9
- package/runtime/ui.js +2 -2
- package/src/main.js +24 -1
- package/public/os9-shell/assets/index-B1Uvacma.js +0 -32825
- package/public/os9-shell/assets/index-B1Uvacma.js.map +0 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// 🎮 GLB Model Showcase for Nova64
|
|
2
|
+
// Demonstrates loading 3D models with animations and N64 PBR materials
|
|
3
|
+
|
|
4
|
+
let rotatingMesh = null;
|
|
5
|
+
let currentModelIndex = 0;
|
|
6
|
+
let models = [
|
|
7
|
+
{
|
|
8
|
+
url: 'https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/Fox/glTF-Binary/Fox.glb',
|
|
9
|
+
scale: 0.05,
|
|
10
|
+
yOffset: -2,
|
|
11
|
+
name: 'Animated Fox',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
url: 'https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/CesiumMan/glTF-Binary/CesiumMan.glb',
|
|
15
|
+
scale: 2.5,
|
|
16
|
+
yOffset: -2,
|
|
17
|
+
name: 'Cesium Man',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
url: 'https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/Duck/glTF-Binary/Duck.glb',
|
|
21
|
+
scale: 2.0,
|
|
22
|
+
yOffset: -1.5,
|
|
23
|
+
name: 'Duck',
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
let angle = 0;
|
|
28
|
+
let loadedModels = {};
|
|
29
|
+
let currentAnimName = 'Run';
|
|
30
|
+
let isLoading = true;
|
|
31
|
+
|
|
32
|
+
export async function init() {
|
|
33
|
+
clearScene();
|
|
34
|
+
|
|
35
|
+
if (globalThis.enableRetroEffects) {
|
|
36
|
+
enableRetroEffects({
|
|
37
|
+
bloomLength: 0.5,
|
|
38
|
+
aberrationIntensity: 0.002,
|
|
39
|
+
vignetteStrength: 0.4,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Setup dynamic skybox
|
|
44
|
+
if (globalThis.createSpaceSkybox) {
|
|
45
|
+
createSpaceSkybox({
|
|
46
|
+
starCount: 2000,
|
|
47
|
+
nebulae: true,
|
|
48
|
+
nebulaColor: 0x1a2f4c,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
setCameraPosition(0, 1.5, 8);
|
|
53
|
+
setCameraTarget(0, 0, 0);
|
|
54
|
+
|
|
55
|
+
// Set dramatic lighting
|
|
56
|
+
setAmbientLight(0xffffff, 0.4);
|
|
57
|
+
setLightDirection(2, 5, 2);
|
|
58
|
+
|
|
59
|
+
await switchModel(currentModelIndex);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function switchModel(index) {
|
|
63
|
+
isLoading = true;
|
|
64
|
+
if (rotatingMesh !== null) {
|
|
65
|
+
destroyMesh(rotatingMesh);
|
|
66
|
+
rotatingMesh = null;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const m = models[index];
|
|
70
|
+
try {
|
|
71
|
+
const meshId = await loadModel(m.url, [0, m.yOffset, 0], m.scale);
|
|
72
|
+
rotatingMesh = meshId;
|
|
73
|
+
|
|
74
|
+
// After loading, it starts the first animation automatically.
|
|
75
|
+
// We can just increase the speed playfully
|
|
76
|
+
if (index === 0) playAnimation(meshId, 2, true, 1.5); // Fox Run
|
|
77
|
+
} catch (e) {
|
|
78
|
+
console.error('Failed to load model', e);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
isLoading = false;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function update(dt) {
|
|
85
|
+
// Rotate smoothly
|
|
86
|
+
if (rotatingMesh && !isLoading) {
|
|
87
|
+
angle += dt * 0.5;
|
|
88
|
+
setRotation(rotatingMesh, 0, angle, 0);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Press Space or Next/Z to cycle models
|
|
92
|
+
if (keyp('Space') || keyp('KeyZ')) {
|
|
93
|
+
currentModelIndex = (currentModelIndex + 1) % models.length;
|
|
94
|
+
switchModel(currentModelIndex);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function draw() {
|
|
99
|
+
if (isLoading) {
|
|
100
|
+
print('LOADING ASSET.GLB...', 120, 150, 0xffff00);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Draw cool text HUD overlays on the 3D container
|
|
105
|
+
print('✨ N64 3D MODEL LOADER ✨', 20, 20, 0xffffff);
|
|
106
|
+
|
|
107
|
+
const mName = models[currentModelIndex].name;
|
|
108
|
+
print(`Model: ${mName}`, 20, 50, 0x00ffff);
|
|
109
|
+
print('Press Space/Z to switch models', 20, 70, 0x88ccff);
|
|
110
|
+
|
|
111
|
+
// Custom bounding UI elements
|
|
112
|
+
rect(15, 15, 280, 80, 0xffffff);
|
|
113
|
+
line(18, 40, 280, 40, 0x444444);
|
|
114
|
+
}
|