nova64 0.2.5 → 0.2.7

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.
Files changed (185) hide show
  1. package/README.md +25 -8
  2. package/bin/nova64.js +165 -0
  3. package/dist/assets/console-CY_kygm3.js +14 -0
  4. package/dist/assets/console-CY_kygm3.js.map +1 -0
  5. package/dist/assets/main-l0sNRNKZ.js.map +1 -0
  6. package/dist/assets/sky/studio/nx.png +0 -0
  7. package/dist/assets/sky/studio/ny.png +0 -0
  8. package/dist/assets/sky/studio/nz.png +0 -0
  9. package/dist/assets/sky/studio/px.png +0 -0
  10. package/dist/assets/sky/studio/py.png +0 -0
  11. package/dist/assets/sky/studio/pz.png +0 -0
  12. package/dist/assets/vanilla-Dcuy32gi.js +2 -0
  13. package/dist/assets/vanilla-Dcuy32gi.js.map +1 -0
  14. package/dist/console.html +899 -0
  15. package/dist/docs/BENCHMARK.md +77 -0
  16. package/dist/docs/CHEATSHEET.md +255 -0
  17. package/dist/docs/EFFECTS_API_GUIDE.md +577 -0
  18. package/dist/docs/EFFECTS_QUICK_REFERENCE.md +331 -0
  19. package/dist/docs/FONT_CHARACTER_REFERENCE.md +219 -0
  20. package/dist/docs/FREE_GLB_ASSETS.md +330 -0
  21. package/dist/docs/FULLSCREEN_BUTTON_FEATURE.md +296 -0
  22. package/dist/docs/GAMEPAD_SUPPORT.md +348 -0
  23. package/dist/docs/GAME_IMPROVEMENTS.md +278 -0
  24. package/dist/docs/GAME_QUALITY_STATUS.md +300 -0
  25. package/dist/docs/MIGRATION_GUIDE.md +553 -0
  26. package/dist/docs/NOVA64_3D_API.md +356 -0
  27. package/dist/docs/NOVA64_API_REFERENCE.md +1406 -0
  28. package/dist/docs/NOVA64_UI_API.md +503 -0
  29. package/dist/docs/UI_SYSTEM_SUMMARY.md +445 -0
  30. package/dist/docs/VOXEL_ENGINE_GUIDE.md +662 -0
  31. package/dist/docs/VOXEL_QUICK_REFERENCE.md +386 -0
  32. package/dist/docs/api-3d.html +750 -0
  33. package/dist/docs/api-effects.html +385 -0
  34. package/dist/docs/api-improvements.md +121 -0
  35. package/dist/docs/api-skybox.html +407 -0
  36. package/dist/docs/api-sprites.html +321 -0
  37. package/dist/docs/api-voxel.html +337 -0
  38. package/dist/docs/api.html +543 -0
  39. package/dist/docs/assets.html +306 -0
  40. package/dist/docs/audio.html +340 -0
  41. package/dist/docs/blogs.html +286 -0
  42. package/dist/docs/collision.html +316 -0
  43. package/dist/docs/console.html +247 -0
  44. package/dist/docs/editor.html +297 -0
  45. package/dist/docs/font.html +247 -0
  46. package/dist/docs/framebuffer.html +247 -0
  47. package/dist/docs/fullscreen-button.html +297 -0
  48. package/dist/docs/gpu-systems.html +247 -0
  49. package/dist/docs/index.html +580 -0
  50. package/dist/docs/input.html +491 -0
  51. package/dist/docs/physics.html +311 -0
  52. package/dist/docs/screens.html +311 -0
  53. package/dist/docs/storage.html +311 -0
  54. package/dist/docs/textinput.html +332 -0
  55. package/dist/docs/ui.html +488 -0
  56. package/dist/examples/3d-advanced/code.js +695 -0
  57. package/dist/examples/adventure-comic-3d/code.js +342 -0
  58. package/dist/examples/audio-lab/code.js +150 -0
  59. package/dist/examples/boids-flocking/code.js +270 -0
  60. package/dist/examples/crystal-cathedral-3d/code.js +706 -0
  61. package/dist/examples/cyberpunk-city-3d/code.js +1383 -0
  62. package/dist/examples/demoscene/README.md +192 -0
  63. package/dist/examples/demoscene/code.js +1081 -0
  64. package/dist/examples/demoscene/meta.json +21 -0
  65. package/dist/examples/dungeon-crawler-3d/code.js +1117 -0
  66. package/dist/examples/f-zero-nova-3d/code.js +865 -0
  67. package/dist/examples/f-zero-nova-3d/code_old.js +1555 -0
  68. package/dist/examples/fps-demo-3d/code.js +744 -0
  69. package/dist/examples/game-of-life-3d/code.js +338 -0
  70. package/dist/examples/generative-art/code.js +632 -0
  71. package/dist/examples/hello-3d/code.js +325 -0
  72. package/dist/examples/hello-skybox/code.js +183 -0
  73. package/dist/examples/hello-world/code.js +19 -0
  74. package/dist/examples/input-showcase/code.js +109 -0
  75. package/dist/examples/instancing-demo/code.js +315 -0
  76. package/dist/examples/minecraft-demo/code.js +387 -0
  77. package/dist/examples/model-viewer-3d/code.js +114 -0
  78. package/dist/examples/mystical-realm-3d/code.js +1203 -0
  79. package/dist/examples/nature-explorer-3d/code.js +1318 -0
  80. package/dist/examples/particles-demo/code.js +522 -0
  81. package/dist/examples/pbr-showcase/code.js +140 -0
  82. package/dist/examples/physics-demo-3d/code.js +948 -0
  83. package/dist/examples/screen-demo/code.js +267 -0
  84. package/dist/examples/shooter-demo-3d/code.js +1286 -0
  85. package/dist/examples/space-combat-3d/IMPLEMENTATION_SUMMARY.md +109 -0
  86. package/dist/examples/space-combat-3d/README.md +135 -0
  87. package/dist/examples/space-combat-3d/code.js +1332 -0
  88. package/dist/examples/space-harrier-3d/code.js +923 -0
  89. package/dist/examples/star-fox-nova-3d/code.js +1116 -0
  90. package/dist/examples/star-fox-nova-3d/code_backup.js +410 -0
  91. package/dist/examples/star-fox-nova-3d/code_broken.js +1821 -0
  92. package/dist/examples/storage-quest/code.js +209 -0
  93. package/dist/examples/strider-demo-3d/IMPROVEMENT_OPTIONS.md +285 -0
  94. package/dist/examples/strider-demo-3d/cache-test.html +132 -0
  95. package/dist/examples/strider-demo-3d/code-fixed.js +582 -0
  96. package/dist/examples/strider-demo-3d/code-old.js +1537 -0
  97. package/dist/examples/strider-demo-3d/code.js +1462 -0
  98. package/dist/examples/strider-demo-3d/code.js.bak2 +1169 -0
  99. package/dist/examples/strider-demo-3d/fix-game.sh +53 -0
  100. package/dist/examples/super-plumber-64/README.md +128 -0
  101. package/dist/examples/super-plumber-64/code.js +1185 -0
  102. package/dist/examples/super-plumber-64/index.html +88 -0
  103. package/dist/examples/test-2d-overlay/code.js +32 -0
  104. package/dist/examples/test-font/code.js +51 -0
  105. package/dist/examples/test-minimal/code.js +21 -0
  106. package/dist/examples/ui-demo/code.js +306 -0
  107. package/dist/examples/wing-commander-space/README.md +180 -0
  108. package/dist/examples/wing-commander-space/code.js +1285 -0
  109. package/dist/examples/wizardry-3d/CHANGELOG.md +366 -0
  110. package/dist/examples/wizardry-3d/code.js +3928 -0
  111. package/dist/index.html +666 -0
  112. package/dist/os9-shell/assets/index-DIHfrTaW.css +1 -0
  113. package/dist/os9-shell/assets/index-KchE_ngx.js +483 -0
  114. package/dist/os9-shell/assets/index-KchE_ngx.js.map +1 -0
  115. package/dist/os9-shell/index.html +23 -0
  116. package/dist/os9-shell/nova-icon.svg +12 -0
  117. package/dist/runtime/api-2d.js +1158 -0
  118. package/dist/runtime/api-3d/camera.js +73 -0
  119. package/dist/runtime/api-3d/instancing.js +180 -0
  120. package/dist/runtime/api-3d/lights.js +51 -0
  121. package/dist/runtime/api-3d/materials.js +47 -0
  122. package/dist/runtime/api-3d/models.js +84 -0
  123. package/dist/runtime/api-3d/particles.js +296 -0
  124. package/dist/runtime/api-3d/pbr.js +113 -0
  125. package/dist/runtime/api-3d/primitives.js +304 -0
  126. package/dist/runtime/api-3d/scene.js +169 -0
  127. package/dist/runtime/api-3d/transforms.js +161 -0
  128. package/dist/runtime/api-3d.js +166 -0
  129. package/dist/runtime/api-effects.js +840 -0
  130. package/dist/runtime/api-gameutils.js +476 -0
  131. package/dist/runtime/api-generative.js +610 -0
  132. package/dist/runtime/api-presets.js +85 -0
  133. package/dist/runtime/api-skybox.js +232 -0
  134. package/dist/runtime/api-sprites.js +100 -0
  135. package/dist/runtime/api-voxel.js +712 -0
  136. package/dist/runtime/api.js +201 -0
  137. package/dist/runtime/assets.js +27 -0
  138. package/dist/runtime/audio.js +114 -0
  139. package/dist/runtime/collision.js +47 -0
  140. package/dist/runtime/console.js +101 -0
  141. package/dist/runtime/editor.js +233 -0
  142. package/dist/runtime/font.js +233 -0
  143. package/dist/runtime/framebuffer.js +28 -0
  144. package/dist/runtime/fullscreen-button.js +185 -0
  145. package/dist/runtime/gpu-canvas2d.js +47 -0
  146. package/dist/runtime/gpu-threejs.js +643 -0
  147. package/dist/runtime/gpu-webgl2.js +310 -0
  148. package/dist/runtime/index.d.ts +682 -0
  149. package/dist/runtime/index.js +22 -0
  150. package/dist/runtime/input.js +225 -0
  151. package/dist/runtime/logger.js +60 -0
  152. package/dist/runtime/physics.js +101 -0
  153. package/dist/runtime/screens.js +213 -0
  154. package/dist/runtime/storage.js +38 -0
  155. package/dist/runtime/store.js +151 -0
  156. package/dist/runtime/textinput.js +68 -0
  157. package/dist/runtime/ui/buttons.js +124 -0
  158. package/dist/runtime/ui/panels.js +105 -0
  159. package/dist/runtime/ui/text.js +86 -0
  160. package/dist/runtime/ui/widgets.js +141 -0
  161. package/dist/runtime/ui.js +111 -0
  162. package/index.html +6 -1
  163. package/package.json +9 -2
  164. package/public/assets/sky/studio/nx.png +0 -0
  165. package/public/assets/sky/studio/ny.png +0 -0
  166. package/public/assets/sky/studio/nz.png +0 -0
  167. package/public/assets/sky/studio/px.png +0 -0
  168. package/public/assets/sky/studio/py.png +0 -0
  169. package/public/assets/sky/studio/pz.png +0 -0
  170. package/public/os9-shell/assets/index-KchE_ngx.js +483 -0
  171. package/public/os9-shell/assets/index-KchE_ngx.js.map +1 -0
  172. package/public/os9-shell/index.html +10 -1
  173. package/runtime/api-2d.js +301 -21
  174. package/runtime/api-3d/pbr.js +45 -1
  175. package/runtime/api-3d.js +1 -0
  176. package/runtime/api-effects.js +90 -3
  177. package/runtime/api-gameutils.js +476 -0
  178. package/runtime/api-generative.js +610 -0
  179. package/runtime/api-skybox.js +54 -0
  180. package/runtime/api-voxel.js +139 -28
  181. package/runtime/gpu-threejs.js +13 -9
  182. package/runtime/ui.js +2 -2
  183. package/src/main.js +20 -0
  184. package/public/os9-shell/assets/index-B1Uvacma.js +0 -32825
  185. package/public/os9-shell/assets/index-B1Uvacma.js.map +0 -1
@@ -0,0 +1,111 @@
1
+ // 🎨 Nova64 UI System - First Class 2D Interface
2
+ // Thin orchestrator — delegates to runtime/ui/*.js sub-modules
3
+
4
+ import { uiTextModule } from './ui/text.js';
5
+ import { uiPanelsModule } from './ui/panels.js';
6
+ import { uiButtonsModule } from './ui/buttons.js';
7
+ import { uiWidgetsModule } from './ui/widgets.js';
8
+
9
+ export function uiApi(gpu, g) {
10
+ // Shared state objects passed by reference into sub-modules
11
+ const state = { currentFont: 'normal', textAlign: 'left', textBaseline: 'top' };
12
+ const mouse = { x: 0, y: 0, down: false, pressed: false };
13
+ const panels = [];
14
+ const buttons = [];
15
+
16
+ const fonts = {
17
+ tiny: { size: 1, spacing: 1 },
18
+ small: { size: 1, spacing: 2 },
19
+ normal: { size: 2, spacing: 1 },
20
+ large: { size: 3, spacing: 1 },
21
+ huge: { size: 4, spacing: 2 },
22
+ };
23
+
24
+ const rgba8 = g.rgba8;
25
+ const colors = {
26
+ primary: rgba8(0, 120, 255, 255),
27
+ secondary: rgba8(100, 100, 255, 255),
28
+ success: rgba8(0, 255, 100, 255),
29
+ warning: rgba8(255, 200, 0, 255),
30
+ danger: rgba8(255, 50, 50, 255),
31
+ dark: rgba8(20, 20, 30, 255),
32
+ light: rgba8(240, 240, 250, 255),
33
+ white: rgba8(255, 255, 255, 255),
34
+ black: rgba8(0, 0, 0, 255),
35
+ transparent: rgba8(0, 0, 0, 0),
36
+ };
37
+
38
+ const ctx = { g, fonts, state, mouse, colors, panels, buttons };
39
+
40
+ // Init modules — each appends its exports to ctx for later modules to use
41
+ const textMod = uiTextModule(ctx);
42
+ Object.assign(ctx, textMod);
43
+
44
+ const panelMod = uiPanelsModule(ctx);
45
+ Object.assign(ctx, panelMod);
46
+
47
+ const buttonMod = uiButtonsModule(ctx);
48
+ Object.assign(ctx, buttonMod);
49
+
50
+ const widgetMod = uiWidgetsModule(ctx);
51
+ Object.assign(ctx, widgetMod);
52
+
53
+ return {
54
+ // Expose these directly for main.js to wire input before exposeTo is called
55
+ setMousePosition: ctx.setMousePosition,
56
+ setMouseButton: ctx.setMouseButton,
57
+
58
+ exposeTo(target) {
59
+ Object.assign(target, {
60
+ // Font / text system
61
+ setFont: ctx.setFont,
62
+ getFont: ctx.getFont,
63
+ setTextAlign: ctx.setTextAlign,
64
+ setTextBaseline: ctx.setTextBaseline,
65
+ measureText: ctx.measureText,
66
+ drawText: ctx.drawText,
67
+ drawTextShadow: ctx.drawTextShadow,
68
+ drawTextOutline: ctx.drawTextOutline,
69
+
70
+ // Panel system
71
+ createPanel: ctx.createPanel,
72
+ drawPanel: ctx.drawPanel,
73
+ drawAllPanels: ctx.drawAllPanels,
74
+ removePanel: ctx.removePanel,
75
+ clearPanels: ctx.clearPanels,
76
+
77
+ // Button system
78
+ createButton: ctx.createButton,
79
+ updateButton: ctx.updateButton,
80
+ drawButton: ctx.drawButton,
81
+ updateAllButtons: ctx.updateAllButtons,
82
+ drawAllButtons: ctx.drawAllButtons,
83
+ removeButton: ctx.removeButton,
84
+ clearButtons: ctx.clearButtons,
85
+
86
+ // Progress bars (as uiProgressBar to avoid overwriting the api-2d drawProgressBar)
87
+ uiProgressBar: ctx.drawProgressBar,
88
+
89
+ // Advanced shapes
90
+ drawRoundedRect: ctx.drawRoundedRect,
91
+ drawGradientRect: ctx.drawGradientRect,
92
+
93
+ // Layout helpers
94
+ centerX: ctx.centerX,
95
+ centerY: ctx.centerY,
96
+ grid: ctx.grid,
97
+
98
+ // Mouse input
99
+ setMousePosition: ctx.setMousePosition,
100
+ setMouseButton: ctx.setMouseButton,
101
+ getMousePosition: ctx.getMousePosition,
102
+ isMouseDown: ctx.isMouseDown,
103
+ isMousePressed: ctx.isMousePressed,
104
+
105
+ // Color palette and font defs
106
+ uiColors: colors,
107
+ uiFonts: fonts,
108
+ });
109
+ },
110
+ };
111
+ }
package/index.html CHANGED
@@ -444,7 +444,7 @@
444
444
 
445
445
  <!-- Terminal Animation -->
446
446
  <div class="terminal">
447
- <div class="terminal-line">$ pnpm add nova64</div>
447
+ <div class="terminal-line">$ pnpm add -g nova64</div>
448
448
  <div class="terminal-line success">✓ GPU acceleration initialized</div>
449
449
  <div class="terminal-line success">✓ 3D engine loaded (with actual lighting!)</div>
450
450
  <div class="terminal-line success">✓ Voxel renderer standing by</div>
@@ -630,6 +630,11 @@
630
630
  <h4>Tron Demoscene</h4>
631
631
  <p>Visual effects showcase</p>
632
632
  </div>
633
+ <div class="demo-card" onclick="window.location.href='/console.html?demo=pbr-showcase'">
634
+ <span class="emoji">🔮</span>
635
+ <h4>PBR Showcase</h4>
636
+ <p>Metalness &amp; roughness grid with IBL</p>
637
+ </div>
633
638
  </div>
634
639
  </section>
635
640
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nova64",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "Nova64 — Ultimate 3D Fantasy Console runtime for JavaScript games powered by Three.js",
5
5
  "keywords": [
6
6
  "fantasy-console",
@@ -21,6 +21,9 @@
21
21
  "url": "https://github.com/nova64/nova64/issues"
22
22
  },
23
23
  "type": "module",
24
+ "bin": {
25
+ "nova64": "./bin/nova64.js"
26
+ },
24
27
  "main": "./runtime/index.js",
25
28
  "types": "./runtime/index.d.ts",
26
29
  "exports": {
@@ -33,6 +36,8 @@
33
36
  "./runtime/ui/*": "./runtime/ui/*.js"
34
37
  },
35
38
  "files": [
39
+ "bin/",
40
+ "dist/",
36
41
  "runtime/",
37
42
  "src/",
38
43
  "public/",
@@ -43,9 +48,11 @@
43
48
  ],
44
49
  "scripts": {
45
50
  "dev": "vite",
46
- "build": "vite build",
51
+ "build": "vite build && node scripts/postbuild.js",
47
52
  "preview": "vite preview",
48
53
  "osBuild": "cd os9-shell && pnpm install && pnpm build && rm -rf ../public/os9-shell/* && mkdir -p ../public/os9-shell && cp -r dist/* ../public/os9-shell/",
54
+ "deployToStarcade9": "bash scripts/deploy-starcade9.sh",
55
+ "serveStarcade9": "npx serve ../starcade9/starcade9.github.io",
49
56
  "test": "node tests/test-cli.js",
50
57
  "test:api": "node tests/test-cli.js api",
51
58
  "test:input": "node tests/test-cli.js input",
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file