nova64 0.2.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.
Files changed (52) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +786 -0
  3. package/index.html +651 -0
  4. package/package.json +255 -0
  5. package/public/os9-shell/assets/index-B1Uvacma.js +32825 -0
  6. package/public/os9-shell/assets/index-B1Uvacma.js.map +1 -0
  7. package/public/os9-shell/assets/index-DIHfrTaW.css +1 -0
  8. package/public/os9-shell/index.html +14 -0
  9. package/public/os9-shell/nova-icon.svg +12 -0
  10. package/runtime/api-2d.js +878 -0
  11. package/runtime/api-3d/camera.js +73 -0
  12. package/runtime/api-3d/instancing.js +180 -0
  13. package/runtime/api-3d/lights.js +51 -0
  14. package/runtime/api-3d/materials.js +47 -0
  15. package/runtime/api-3d/models.js +84 -0
  16. package/runtime/api-3d/pbr.js +69 -0
  17. package/runtime/api-3d/primitives.js +304 -0
  18. package/runtime/api-3d/scene.js +169 -0
  19. package/runtime/api-3d/transforms.js +161 -0
  20. package/runtime/api-3d.js +154 -0
  21. package/runtime/api-effects.js +753 -0
  22. package/runtime/api-presets.js +85 -0
  23. package/runtime/api-skybox.js +178 -0
  24. package/runtime/api-sprites.js +100 -0
  25. package/runtime/api-voxel.js +601 -0
  26. package/runtime/api.js +201 -0
  27. package/runtime/assets.js +27 -0
  28. package/runtime/audio.js +114 -0
  29. package/runtime/collision.js +47 -0
  30. package/runtime/console.js +101 -0
  31. package/runtime/editor.js +233 -0
  32. package/runtime/font.js +233 -0
  33. package/runtime/framebuffer.js +28 -0
  34. package/runtime/fullscreen-button.js +185 -0
  35. package/runtime/gpu-canvas2d.js +47 -0
  36. package/runtime/gpu-threejs.js +639 -0
  37. package/runtime/gpu-webgl2.js +310 -0
  38. package/runtime/index.js +22 -0
  39. package/runtime/input.js +225 -0
  40. package/runtime/logger.js +60 -0
  41. package/runtime/physics.js +101 -0
  42. package/runtime/screens.js +213 -0
  43. package/runtime/storage.js +38 -0
  44. package/runtime/store.js +151 -0
  45. package/runtime/textinput.js +68 -0
  46. package/runtime/ui/buttons.js +124 -0
  47. package/runtime/ui/panels.js +105 -0
  48. package/runtime/ui/text.js +86 -0
  49. package/runtime/ui/widgets.js +141 -0
  50. package/runtime/ui.js +111 -0
  51. package/src/main.js +474 -0
  52. package/vite.config.js +63 -0
package/package.json ADDED
@@ -0,0 +1,255 @@
1
+ {
2
+ "name": "nova64",
3
+ "version": "0.2.1",
4
+ "description": "Nova64 — Ultimate 3D Fantasy Console runtime for JavaScript games powered by Three.js",
5
+ "keywords": [
6
+ "fantasy-console",
7
+ "3d",
8
+ "game-engine",
9
+ "threejs",
10
+ "retro",
11
+ "games"
12
+ ],
13
+ "license": "MIT",
14
+ "author": "Nova64 Contributors",
15
+ "homepage": "https://github.com/nova64/nova64#readme",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/nova64/nova64.git"
19
+ },
20
+ "bugs": {
21
+ "url": "https://github.com/nova64/nova64/issues"
22
+ },
23
+ "type": "module",
24
+ "main": "./runtime/index.js",
25
+ "exports": {
26
+ ".": "./runtime/index.js",
27
+ "./runtime/*": "./runtime/*.js",
28
+ "./runtime/api-3d/*": "./runtime/api-3d/*.js",
29
+ "./runtime/ui/*": "./runtime/ui/*.js"
30
+ },
31
+ "files": [
32
+ "runtime/",
33
+ "src/",
34
+ "public/",
35
+ "index.html",
36
+ "vite.config.js",
37
+ "README.md",
38
+ "LICENSE"
39
+ ],
40
+ "scripts": {
41
+ "dev": "vite",
42
+ "build": "vite build",
43
+ "preview": "vite preview",
44
+ "osBuild": "cd os9-shell && pnpm install && pnpm build && rm -rf ../public/os9-shell/* && mkdir -p ../public/os9-shell && cp -r dist/* ../public/os9-shell/",
45
+ "test": "node tests/test-cli.js",
46
+ "test:api": "node tests/test-cli.js api",
47
+ "test:input": "node tests/test-cli.js input",
48
+ "test:starfox": "node tests/test-cli.js starfox",
49
+ "test:integration": "node tests/test-cli.js integration",
50
+ "test:web": "open tests/test-runner.html || xdg-open tests/test-runner.html || start tests/test-runner.html",
51
+ "test:all": "pnpm run test && pnpm run test:api && pnpm run test:input && pnpm run test:starfox && pnpm run test:integration",
52
+ "test:watch": "nodemon --watch runtime --watch tests --watch examples --exec 'pnpm run test'",
53
+ "bench": "node tests/bench.js",
54
+ "bench:material": "node tests/bench.js --suite=material",
55
+ "bench:instancing": "node tests/bench.js --suite=instancing",
56
+ "bench:mesh": "node tests/bench.js --suite=mesh",
57
+ "lint": "eslint 'runtime/**/*.js' 'src/**/*.js' --max-warnings=0",
58
+ "lint:fix": "eslint 'runtime/**/*.js' 'src/**/*.js' --fix",
59
+ "format": "prettier --write \"**/*.{js,json,md}\"",
60
+ "format:check": "prettier --check \"**/*.{js,json,md}\"",
61
+ "validate": "pnpm run format:check && pnpm run lint && pnpm run test:all",
62
+ "clean": "rm -rf dist node_modules",
63
+ "reinstall": "pnpm run clean && pnpm install",
64
+ "prepare": "husky",
65
+ "prepublishOnly": "pnpm run validate && pnpm run build",
66
+ "release:patch": "pnpm version patch && git push && git push --tags",
67
+ "release:minor": "pnpm version minor && git push && git push --tags",
68
+ "release:major": "pnpm version major && git push && git push --tags"
69
+ },
70
+ "dependencies": {
71
+ "three": "^0.182.0",
72
+ "zustand": "^5.0.11"
73
+ },
74
+ "devDependencies": {
75
+ "eslint": "^8.57.1",
76
+ "husky": "^9.1.7",
77
+ "lint-staged": "^16.4.0",
78
+ "nodemon": "^3.1.10",
79
+ "prettier": "^3.6.2",
80
+ "terser": "^5.46.0",
81
+ "vite": "^5.4.0"
82
+ },
83
+ "lint-staged": {
84
+ "runtime/**/*.js": [
85
+ "eslint --max-warnings=0",
86
+ "prettier --write"
87
+ ],
88
+ "src/**/*.js": [
89
+ "eslint --max-warnings=0",
90
+ "prettier --write"
91
+ ],
92
+ "examples/**/*.js": [
93
+ "prettier --write"
94
+ ]
95
+ },
96
+ "eslintConfig": {
97
+ "env": {
98
+ "browser": true,
99
+ "es2021": true,
100
+ "node": true
101
+ },
102
+ "extends": "eslint:recommended",
103
+ "parserOptions": {
104
+ "ecmaVersion": "latest",
105
+ "sourceType": "module"
106
+ },
107
+ "rules": {
108
+ "no-unused-vars": [
109
+ "warn",
110
+ {
111
+ "argsIgnorePattern": "^_"
112
+ }
113
+ ],
114
+ "no-console": "off",
115
+ "no-undef": "warn"
116
+ },
117
+ "globals": {
118
+ "THREE": "readonly",
119
+ "vec3": "readonly",
120
+ "rect": "readonly",
121
+ "rgba8": "readonly",
122
+ "print": "readonly",
123
+ "cls": "readonly",
124
+ "line": "readonly",
125
+ "circle": "readonly",
126
+ "btn": "readonly",
127
+ "btnp": "readonly",
128
+ "isKeyDown": "readonly",
129
+ "isKeyPressed": "readonly",
130
+ "isMouseDown": "readonly",
131
+ "getMousePosition": "readonly",
132
+ "setMousePosition": "readonly",
133
+ "setMouseButton": "readonly",
134
+ "createCube": "readonly",
135
+ "createSphere": "readonly",
136
+ "createPlane": "readonly",
137
+ "destroyMesh": "readonly",
138
+ "setPosition": "readonly",
139
+ "getPosition": "readonly",
140
+ "setRotation": "readonly",
141
+ "setScale": "readonly",
142
+ "rotateMesh": "readonly",
143
+ "moveMesh": "readonly",
144
+ "setCameraPosition": "readonly",
145
+ "setCameraTarget": "readonly",
146
+ "setCameraFOV": "readonly",
147
+ "setLightDirection": "readonly",
148
+ "setLightColor": "readonly",
149
+ "setAmbientLight": "readonly",
150
+ "setFog": "readonly",
151
+ "enablePixelation": "readonly",
152
+ "enableDithering": "readonly",
153
+ "get3DStats": "readonly",
154
+ "clearScene": "readonly",
155
+ "createSpaceSkybox": "readonly",
156
+ "animateSkybox": "readonly",
157
+ "clearSkybox": "readonly",
158
+ "createButton": "readonly",
159
+ "createPanel": "readonly",
160
+ "updateAllButtons": "readonly",
161
+ "drawAllButtons": "readonly",
162
+ "clearButtons": "readonly",
163
+ "drawAllPanels": "readonly",
164
+ "drawPanel": "readonly",
165
+ "centerX": "readonly",
166
+ "centerY": "readonly",
167
+ "uiColors": "readonly",
168
+ "drawGradientRect": "readonly",
169
+ "drawProgressBar": "readonly",
170
+ "drawText": "readonly",
171
+ "drawTextShadow": "readonly",
172
+ "drawTextOutline": "readonly",
173
+ "setFont": "readonly",
174
+ "setTextAlign": "readonly",
175
+ "setTextBaseline": "readonly",
176
+ "initScreens": "readonly",
177
+ "addScreen": "readonly",
178
+ "switchToScreen": "readonly",
179
+ "switchScreen": "readonly",
180
+ "color": "readonly",
181
+ "text": "readonly",
182
+ "saveJSON": "readonly",
183
+ "loadJSON": "readonly",
184
+ "openSpriteEditor": "readonly",
185
+ "key": "readonly",
186
+ "keyp": "readonly",
187
+ "createCylinder": "readonly",
188
+ "createTorus": "readonly",
189
+ "createCone": "readonly",
190
+ "createCapsule": "readonly",
191
+ "createAdvancedCube": "readonly",
192
+ "createAdvancedSphere": "readonly",
193
+ "removeMesh": "readonly",
194
+ "setFlatShading": "readonly",
195
+ "setMeshVisible": "readonly",
196
+ "setMeshOpacity": "readonly",
197
+ "setCastShadow": "readonly",
198
+ "setReceiveShadow": "readonly",
199
+ "setCameraLookAt": "readonly",
200
+ "clearFog": "readonly",
201
+ "setDirectionalLight": "readonly",
202
+ "createPointLight": "readonly",
203
+ "setPointLightPosition": "readonly",
204
+ "setPointLightColor": "readonly",
205
+ "removeLight": "readonly",
206
+ "createInstancedMesh": "readonly",
207
+ "setInstanceTransform": "readonly",
208
+ "setInstanceColor": "readonly",
209
+ "finalizeInstances": "readonly",
210
+ "removeInstancedMesh": "readonly",
211
+ "createLODMesh": "readonly",
212
+ "setLODPosition": "readonly",
213
+ "removeLODMesh": "readonly",
214
+ "updateLODs": "readonly",
215
+ "loadNormalMap": "readonly",
216
+ "setNormalMap": "readonly",
217
+ "setPBRMaps": "readonly",
218
+ "loadModel": "readonly",
219
+ "playAnimation": "readonly",
220
+ "updateAnimations": "readonly",
221
+ "loadTexture": "readonly",
222
+ "enableBloom": "readonly",
223
+ "enableVignette": "readonly",
224
+ "enableFXAA": "readonly",
225
+ "enableN64Mode": "readonly",
226
+ "enablePSXMode": "readonly",
227
+ "enableLowPolyMode": "readonly",
228
+ "enableMotionBlur": "readonly",
229
+ "createGradientSkybox": "readonly",
230
+ "createSolidSkybox": "readonly",
231
+ "enableSkyboxAutoAnimate": "readonly",
232
+ "drawRect": "readonly",
233
+ "printCentered": "readonly",
234
+ "sfx": "readonly",
235
+ "saveData": "readonly",
236
+ "loadData": "readonly",
237
+ "deleteData": "readonly",
238
+ "createBody": "readonly",
239
+ "stepPhysics": "readonly",
240
+ "setGravity": "readonly",
241
+ "setCollisionMap": "readonly",
242
+ "drawCrosshair": "readonly",
243
+ "drawGlowText": "readonly",
244
+ "grid": "readonly"
245
+ }
246
+ },
247
+ "prettier": {
248
+ "semi": true,
249
+ "singleQuote": true,
250
+ "tabWidth": 2,
251
+ "trailingComma": "es5",
252
+ "printWidth": 100,
253
+ "arrowParens": "avoid"
254
+ }
255
+ }