@oidoid/void 0.1.0-4 → 0.1.0-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/dist/meta.json +1 -0
- package/dist/package.json +66 -0
- package/dist/public/favicon/favicon16.png +0 -0
- package/dist/public/favicon/favicon192.png +0 -0
- package/dist/public/favicon/favicon32.png +0 -0
- package/dist/public/favicon/favicon48.png +0 -0
- package/dist/public/favicon/favicon512.png +0 -0
- package/dist/public/favicon/favicon64.png +0 -0
- package/dist/public/index.html +23 -0
- package/dist/public/index.js +3844 -0
- package/dist/public/index.js.map +7 -0
- package/dist/public/manifest.json +1 -0
- package/dist/public/preload-atlas.png +0 -0
- package/dist/public/void-v0.1.0-4.html +111 -0
- package/dist/public/void-v0.1.0-5.html +111 -0
- package/dist/public/void-v0.1.0-6.html +111 -0
- package/dist/schema/config-file.d.ts +32 -0
- package/dist/schema/config-file.js +41 -0
- package/dist/schema/config-file.js.map +1 -0
- package/dist/schema/config-file.v0.json +68 -0
- package/dist/src/audio.d.ts +7 -0
- package/dist/src/audio.js +25 -0
- package/dist/src/audio.js.map +1 -0
- package/dist/src/demo/assets/manifest.json +46 -0
- package/dist/src/demo/assets/preload-atlas.json +193 -0
- package/dist/src/demo/ents/clock-ent.d.ts +10 -0
- package/dist/src/demo/ents/clock-ent.js +26 -0
- package/dist/src/demo/ents/clock-ent.js.map +1 -0
- package/dist/src/demo/ents/render-toggle-ent.d.ts +10 -0
- package/dist/src/demo/ents/render-toggle-ent.js +38 -0
- package/dist/src/demo/ents/render-toggle-ent.js.map +1 -0
- package/dist/src/demo/ents/work-counter-ent.d.ts +10 -0
- package/dist/src/demo/ents/work-counter-ent.js +24 -0
- package/dist/src/demo/ents/work-counter-ent.js.map +1 -0
- package/dist/src/demo/game.d.ts +13 -0
- package/dist/src/demo/game.js +155 -0
- package/dist/src/demo/game.js.map +1 -0
- package/dist/src/demo/index.d.ts +1 -0
- package/dist/src/demo/index.js +8 -0
- package/dist/src/demo/index.js.map +1 -0
- package/dist/src/demo/tsconfig.json +15 -0
- package/dist/src/demo/types/tag.d.ts +2 -0
- package/dist/src/demo/types/tag.js +2 -0
- package/dist/src/demo/types/tag.js.map +1 -0
- package/dist/src/demo/void.json +11 -0
- package/dist/src/ents/button-ent.d.ts +38 -0
- package/dist/src/ents/button-ent.js +124 -0
- package/dist/src/ents/button-ent.js.map +1 -0
- package/dist/src/ents/cursor-ent.d.ts +18 -0
- package/dist/src/ents/cursor-ent.js +58 -0
- package/dist/src/ents/cursor-ent.js.map +1 -0
- package/dist/src/ents/ent.d.ts +7 -0
- package/dist/src/ents/ent.js +2 -0
- package/dist/src/ents/ent.js.map +1 -0
- package/dist/src/ents/follow-cam-ent.d.ts +25 -0
- package/dist/src/ents/follow-cam-ent.js +87 -0
- package/dist/src/ents/follow-cam-ent.js.map +1 -0
- package/dist/src/ents/nine-patch-ent.d.ts +43 -0
- package/dist/src/ents/nine-patch-ent.js +143 -0
- package/dist/src/ents/nine-patch-ent.js.map +1 -0
- package/dist/src/ents/text-ent.d.ts +23 -0
- package/dist/src/ents/text-ent.js +109 -0
- package/dist/src/ents/text-ent.js.map +1 -0
- package/dist/src/ents/zoo.d.ts +16 -0
- package/dist/src/ents/zoo.js +38 -0
- package/dist/src/ents/zoo.js.map +1 -0
- package/dist/src/graphics/atlas-parser.d.ts +4 -0
- package/dist/src/graphics/atlas-parser.js +27 -0
- package/dist/src/graphics/atlas-parser.js.map +1 -0
- package/dist/src/graphics/atlas.d.ts +49 -0
- package/dist/src/graphics/atlas.js +7 -0
- package/dist/src/graphics/atlas.js.map +1 -0
- package/dist/src/graphics/cam.d.ts +89 -0
- package/dist/src/graphics/cam.js +211 -0
- package/dist/src/graphics/cam.js.map +1 -0
- package/dist/src/graphics/gl.d.ts +24 -0
- package/dist/src/graphics/gl.js +70 -0
- package/dist/src/graphics/gl.js.map +1 -0
- package/dist/src/graphics/layer.d.ts +21 -0
- package/dist/src/graphics/layer.js +23 -0
- package/dist/src/graphics/layer.js.map +1 -0
- package/dist/src/graphics/renderer.d.ts +22 -0
- package/dist/src/graphics/renderer.js +168 -0
- package/dist/src/graphics/renderer.js.map +1 -0
- package/dist/src/graphics/sprite-frag.glsl.d.ts +1 -0
- package/dist/src/graphics/sprite-frag.glsl.js +35 -0
- package/dist/src/graphics/sprite-frag.glsl.js.map +1 -0
- package/dist/src/graphics/sprite-vert.glsl.d.ts +1 -0
- package/dist/src/graphics/sprite-vert.glsl.js +68 -0
- package/dist/src/graphics/sprite-vert.glsl.js.map +1 -0
- package/dist/src/graphics/sprite.d.ts +108 -0
- package/dist/src/graphics/sprite.js +301 -0
- package/dist/src/graphics/sprite.js.map +1 -0
- package/dist/src/index.d.ts +30 -0
- package/dist/src/index.js +33 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/input/context-menu.d.ts +8 -0
- package/dist/src/input/context-menu.js +25 -0
- package/dist/src/input/context-menu.js.map +1 -0
- package/dist/src/input/gamepad.d.ts +18 -0
- package/dist/src/input/gamepad.js +49 -0
- package/dist/src/input/gamepad.js.map +1 -0
- package/dist/src/input/input.d.ts +148 -0
- package/dist/src/input/input.js +383 -0
- package/dist/src/input/input.js.map +1 -0
- package/dist/src/input/keyboard.d.ts +17 -0
- package/dist/src/input/keyboard.js +46 -0
- package/dist/src/input/keyboard.js.map +1 -0
- package/dist/src/input/pointer.d.ts +53 -0
- package/dist/src/input/pointer.js +162 -0
- package/dist/src/input/pointer.js.map +1 -0
- package/dist/src/input/wheel.d.ts +12 -0
- package/dist/src/input/wheel.js +30 -0
- package/dist/src/input/wheel.js.map +1 -0
- package/dist/src/looper.d.ts +15 -0
- package/dist/src/looper.js +48 -0
- package/dist/src/looper.js.map +1 -0
- package/dist/src/mem/pool.d.ts +31 -0
- package/dist/src/mem/pool.js +98 -0
- package/dist/src/mem/pool.js.map +1 -0
- package/dist/src/pixel-ratio-observer.d.ts +10 -0
- package/dist/src/pixel-ratio-observer.js +26 -0
- package/dist/src/pixel-ratio-observer.js.map +1 -0
- package/dist/src/random/random.d.ts +8 -0
- package/dist/src/random/random.js +23 -0
- package/dist/src/random/random.js.map +1 -0
- package/dist/src/storage/local-storage.d.ts +3 -0
- package/dist/src/storage/local-storage.js +11 -0
- package/dist/src/storage/local-storage.js.map +1 -0
- package/dist/src/text/font.d.ts +6 -0
- package/dist/src/text/font.js +20 -0
- package/dist/src/text/font.js.map +1 -0
- package/dist/src/text/mem-prop-5x6.json +573 -0
- package/dist/src/text/text-layout.d.ts +19 -0
- package/dist/src/text/text-layout.js +85 -0
- package/dist/src/text/text-layout.js.map +1 -0
- package/dist/src/tsconfig.json +15 -0
- package/dist/src/types/geo.d.ts +38 -0
- package/dist/src/types/geo.js +61 -0
- package/dist/src/types/geo.js.map +1 -0
- package/dist/src/types/json.d.ts +31 -0
- package/dist/src/types/json.js +2 -0
- package/dist/src/types/json.js.map +1 -0
- package/dist/src/types/time.d.ts +19 -0
- package/dist/src/types/time.js +10 -0
- package/dist/src/types/time.js.map +1 -0
- package/dist/src/types/void-version.d.ts +9 -0
- package/dist/src/types/void-version.js +2 -0
- package/dist/src/types/void-version.js.map +1 -0
- package/dist/src/utils/async-util.d.ts +11 -0
- package/dist/src/utils/async-util.js +36 -0
- package/dist/src/utils/async-util.js.map +1 -0
- package/dist/src/utils/canvas-util.d.ts +7 -0
- package/dist/src/utils/canvas-util.js +128 -0
- package/dist/src/utils/canvas-util.js.map +1 -0
- package/dist/src/utils/color-util.d.ts +1 -0
- package/dist/src/utils/color-util.js +4 -0
- package/dist/src/utils/color-util.js.map +1 -0
- package/dist/src/utils/debug.d.ts +17 -0
- package/dist/src/utils/debug.js +34 -0
- package/dist/src/utils/debug.js.map +1 -0
- package/dist/src/utils/dom-util.d.ts +3 -0
- package/dist/src/utils/dom-util.js +29 -0
- package/dist/src/utils/dom-util.js.map +1 -0
- package/dist/src/utils/fetch-util.d.ts +3 -0
- package/dist/src/utils/fetch-util.js +24 -0
- package/dist/src/utils/fetch-util.js.map +1 -0
- package/dist/src/utils/math.d.ts +6 -0
- package/dist/src/utils/math.js +18 -0
- package/dist/src/utils/math.js.map +1 -0
- package/dist/src/utils/vibrate.d.ts +1 -0
- package/dist/src/utils/vibrate.js +4 -0
- package/dist/src/utils/vibrate.js.map +1 -0
- package/dist/src/void.d.ts +43 -0
- package/dist/src/void.js +95 -0
- package/dist/src/void.js.map +1 -0
- package/dist/tools/atlas-pack/aseprite.d.ts +58 -0
- package/dist/tools/atlas-pack/aseprite.js +16 -0
- package/dist/tools/atlas-pack/aseprite.js.map +1 -0
- package/dist/tools/atlas-pack/atlas-json-parser.d.ts +21 -0
- package/dist/tools/atlas-pack/atlas-json-parser.js +116 -0
- package/dist/tools/atlas-pack/atlas-json-parser.js.map +1 -0
- package/dist/tools/atlas-pack/atlas-pack.d.ts +2 -0
- package/dist/tools/atlas-pack/atlas-pack.js +17 -0
- package/dist/tools/atlas-pack/atlas-pack.js.map +1 -0
- package/dist/tools/bundle/bundle.d.ts +3 -0
- package/dist/tools/bundle/bundle.js +48 -0
- package/dist/tools/bundle/bundle.js.map +1 -0
- package/dist/tools/bundle/html-plugin.d.ts +3 -0
- package/dist/tools/bundle/html-plugin.js +88 -0
- package/dist/tools/bundle/html-plugin.js.map +1 -0
- package/dist/tools/tsconfig-base.json +45 -0
- package/dist/tools/tsconfig.json +21 -0
- package/dist/tools/types/config.d.ts +20 -0
- package/dist/tools/types/config.js +22 -0
- package/dist/tools/types/config.js.map +1 -0
- package/dist/tools/utils/argv.d.ts +12 -0
- package/dist/tools/utils/argv.js +19 -0
- package/dist/tools/utils/argv.js.map +1 -0
- package/dist/tools/utils/exec.d.ts +3 -0
- package/dist/tools/utils/exec.js +15 -0
- package/dist/tools/utils/exec.js.map +1 -0
- package/dist/tools/utils/file-util.d.ts +1 -0
- package/dist/tools/utils/file-util.js +13 -0
- package/dist/tools/utils/file-util.js.map +1 -0
- package/dist/tools/utils/html-parser.d.ts +1 -0
- package/dist/tools/utils/html-parser.js +10 -0
- package/dist/tools/utils/html-parser.js.map +1 -0
- package/dist/tools/void.d.ts +17 -0
- package/dist/tools/void.js +30 -0
- package/dist/tools/void.js.map +1 -0
- package/package.json +31 -41
- package/readme.md +1 -1
- package/schema/config-file.test.ts +55 -0
- package/schema/config-file.ts +69 -0
- package/schema/config-file.v0.json +68 -0
- package/tools/atlas-pack/aseprite.ts +60 -0
- package/tools/atlas-pack/atlas-json-parser.test.ts +780 -0
- package/tools/atlas-pack/atlas-json-parser.ts +159 -0
- package/tools/atlas-pack/atlas-pack.ts +38 -0
- package/tools/bundle/bundle.ts +65 -0
- package/tools/bundle/html-plugin.ts +135 -0
- package/tools/types/config.ts +43 -0
- package/tools/utils/argv.test.ts +41 -0
- package/tools/utils/argv.ts +29 -0
- package/tools/utils/exec.ts +22 -0
- package/tools/utils/file-util.ts +11 -0
- package/tools/utils/html-parser.ts +9 -0
- package/tools/void.ts +54 -0
- package/dist/atlas/anim.d.ts +0 -30
- package/dist/atlas/anim.js +0 -16
- package/dist/atlas/anim.js.map +0 -1
- package/dist/atlas/aseprite.d.ts +0 -37
- package/dist/atlas/aseprite.js +0 -2
- package/dist/atlas/aseprite.js.map +0 -1
- package/dist/atlas/atlas-parser.d.ts +0 -52
- package/dist/atlas/atlas-parser.js +0 -109
- package/dist/atlas/atlas-parser.js.map +0 -1
- package/dist/atlas/atlas.d.ts +0 -4
- package/dist/atlas/atlas.js +0 -2
- package/dist/atlas/atlas.js.map +0 -1
- package/dist/audio/synth.d.ts +0 -4
- package/dist/audio/synth.js +0 -21
- package/dist/audio/synth.js.map +0 -1
- package/dist/graphics/bitmap.d.ts +0 -14
- package/dist/graphics/bitmap.js +0 -14
- package/dist/graphics/bitmap.js.map +0 -1
- package/dist/graphics/cam.d.ts +0 -16
- package/dist/graphics/cam.js +0 -42
- package/dist/graphics/cam.js.map +0 -1
- package/dist/graphics/frag.glsl.d.ts +0 -1
- package/dist/graphics/frag.glsl.js +0 -15
- package/dist/graphics/frag.glsl.js.map +0 -1
- package/dist/graphics/frame-listener.d.ts +0 -16
- package/dist/graphics/frame-listener.js +0 -83
- package/dist/graphics/frame-listener.js.map +0 -1
- package/dist/graphics/renderer.d.ts +0 -12
- package/dist/graphics/renderer.js +0 -184
- package/dist/graphics/renderer.js.map +0 -1
- package/dist/graphics/vert.glsl.d.ts +0 -1
- package/dist/graphics/vert.glsl.js +0 -46
- package/dist/graphics/vert.glsl.js.map +0 -1
- package/dist/index.d.ts +0 -31
- package/dist/index.js +0 -79
- package/dist/index.js.map +0 -1
- package/dist/input/gamepad-poller.d.ts +0 -8
- package/dist/input/gamepad-poller.js +0 -38
- package/dist/input/gamepad-poller.js.map +0 -1
- package/dist/input/input.d.ts +0 -44
- package/dist/input/input.js +0 -175
- package/dist/input/input.js.map +0 -1
- package/dist/input/keyboard-poller.d.ts +0 -7
- package/dist/input/keyboard-poller.js +0 -30
- package/dist/input/keyboard-poller.js.map +0 -1
- package/dist/input/pointer-poller.d.ts +0 -12
- package/dist/input/pointer-poller.js +0 -67
- package/dist/input/pointer-poller.js.map +0 -1
- package/dist/sprite/sprite.d.ts +0 -51
- package/dist/sprite/sprite.js +0 -161
- package/dist/sprite/sprite.js.map +0 -1
- package/dist/storage/json-storage.d.ts +0 -4
- package/dist/storage/json-storage.js +0 -13
- package/dist/storage/json-storage.js.map +0 -1
- package/dist/test/tsconfig.json +0 -14
- package/dist/text/font.d.ts +0 -6
- package/dist/text/font.js +0 -18
- package/dist/text/font.js.map +0 -1
- package/dist/text/text-layout.d.ts +0 -11
- package/dist/text/text-layout.js +0 -73
- package/dist/text/text-layout.js.map +0 -1
- package/dist/tsconfig.json +0 -13
- package/dist/types/2d.d.ts +0 -9
- package/dist/types/2d.js +0 -2
- package/dist/types/2d.js.map +0 -1
- package/dist/void.js +0 -60
- package/dist/void.js.map +0 -7
- package/dist/void.meta.json +0 -289
- package/src/atlas/anim.js +0 -17
- package/tools/atlas-parser.js +0 -120
- package/tools/void.js +0 -143
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
{
|
|
2
|
+
"anim": {
|
|
3
|
+
"background--OrangeCheckerboard": { "cels": 1, "h": 2, "id": 0, "w": 2 },
|
|
4
|
+
"background--GreyCheckerboard": { "cels": 1, "h": 2, "id": 1, "w": 2 },
|
|
5
|
+
"background--Kiwi": { "cels": 1, "h": 2, "id": 2, "w": 2 },
|
|
6
|
+
"background--Strawberry": { "cels": 1, "h": 2, "id": 3, "w": 2 },
|
|
7
|
+
"background--Grape": { "cels": 1, "h": 2, "id": 4, "w": 2 },
|
|
8
|
+
"background--Blueberry": { "cels": 1, "h": 2, "id": 5, "w": 2 },
|
|
9
|
+
"background--Bubblegum": { "cels": 1, "h": 2, "id": 6, "w": 2 },
|
|
10
|
+
"background--Transparent": { "cels": 1, "h": 2, "id": 7, "w": 2 },
|
|
11
|
+
"background--Black": { "cels": 1, "h": 2, "id": 8, "w": 2 },
|
|
12
|
+
"backpacker--WalkRight": {
|
|
13
|
+
"cels": 16,
|
|
14
|
+
"h": 13,
|
|
15
|
+
"hitbox": { "x": 2, "y": 0, "w": 4, "h": 4 },
|
|
16
|
+
"id": 9,
|
|
17
|
+
"w": 8
|
|
18
|
+
},
|
|
19
|
+
"backpacker--WalkDown": {
|
|
20
|
+
"cels": 16,
|
|
21
|
+
"h": 13,
|
|
22
|
+
"hitbox": { "x": 2, "y": 0, "w": 4, "h": 4 },
|
|
23
|
+
"id": 10,
|
|
24
|
+
"w": 8
|
|
25
|
+
},
|
|
26
|
+
"backpacker--WalkUp": {
|
|
27
|
+
"cels": 16,
|
|
28
|
+
"h": 13,
|
|
29
|
+
"hitbox": { "x": 2, "y": 0, "w": 4, "h": 4 },
|
|
30
|
+
"id": 11,
|
|
31
|
+
"w": 8
|
|
32
|
+
},
|
|
33
|
+
"cursor--Pointer": {
|
|
34
|
+
"cels": 1,
|
|
35
|
+
"h": 14,
|
|
36
|
+
"hitbox": { "x": 0, "y": 0, "w": 2, "h": 2 },
|
|
37
|
+
"hurtbox": { "x": 0, "y": 0, "w": 2, "h": 2 },
|
|
38
|
+
"id": 12,
|
|
39
|
+
"w": 8
|
|
40
|
+
},
|
|
41
|
+
"mem-prop-5x6--00": { "cels": 1, "h": 6, "id": 13, "w": 5 },
|
|
42
|
+
"mem-prop-5x6--01": { "cels": 1, "h": 6, "id": 14, "w": 5 },
|
|
43
|
+
"mem-prop-5x6--02": { "cels": 1, "h": 6, "id": 15, "w": 5 },
|
|
44
|
+
"mem-prop-5x6--03": { "cels": 1, "h": 6, "id": 16, "w": 5 },
|
|
45
|
+
"mem-prop-5x6--04": { "cels": 1, "h": 6, "id": 17, "w": 5 },
|
|
46
|
+
"mem-prop-5x6--05": { "cels": 1, "h": 6, "id": 18, "w": 5 },
|
|
47
|
+
"mem-prop-5x6--06": { "cels": 1, "h": 6, "id": 19, "w": 5 },
|
|
48
|
+
"mem-prop-5x6--07": { "cels": 1, "h": 6, "id": 20, "w": 5 },
|
|
49
|
+
"mem-prop-5x6--08": { "cels": 1, "h": 6, "id": 21, "w": 5 },
|
|
50
|
+
"mem-prop-5x6--09": { "cels": 1, "h": 6, "id": 22, "w": 5 },
|
|
51
|
+
"mem-prop-5x6--0a": { "cels": 1, "h": 6, "id": 23, "w": 5 },
|
|
52
|
+
"mem-prop-5x6--0b": { "cels": 1, "h": 6, "id": 24, "w": 5 },
|
|
53
|
+
"mem-prop-5x6--0c": { "cels": 1, "h": 6, "id": 25, "w": 5 },
|
|
54
|
+
"mem-prop-5x6--0d": { "cels": 1, "h": 6, "id": 26, "w": 5 },
|
|
55
|
+
"mem-prop-5x6--0e": { "cels": 1, "h": 6, "id": 27, "w": 5 },
|
|
56
|
+
"mem-prop-5x6--0f": { "cels": 1, "h": 6, "id": 28, "w": 5 },
|
|
57
|
+
"mem-prop-5x6--10": { "cels": 1, "h": 6, "id": 29, "w": 5 },
|
|
58
|
+
"mem-prop-5x6--11": { "cels": 1, "h": 6, "id": 30, "w": 5 },
|
|
59
|
+
"mem-prop-5x6--12": { "cels": 1, "h": 6, "id": 31, "w": 5 },
|
|
60
|
+
"mem-prop-5x6--13": { "cels": 1, "h": 6, "id": 32, "w": 5 },
|
|
61
|
+
"mem-prop-5x6--14": { "cels": 1, "h": 6, "id": 33, "w": 5 },
|
|
62
|
+
"mem-prop-5x6--15": { "cels": 1, "h": 6, "id": 34, "w": 5 },
|
|
63
|
+
"mem-prop-5x6--16": { "cels": 1, "h": 6, "id": 35, "w": 5 },
|
|
64
|
+
"mem-prop-5x6--17": { "cels": 1, "h": 6, "id": 36, "w": 5 },
|
|
65
|
+
"mem-prop-5x6--18": { "cels": 1, "h": 6, "id": 37, "w": 5 },
|
|
66
|
+
"mem-prop-5x6--19": { "cels": 1, "h": 6, "id": 38, "w": 5 },
|
|
67
|
+
"mem-prop-5x6--1a": { "cels": 1, "h": 6, "id": 39, "w": 5 },
|
|
68
|
+
"mem-prop-5x6--1b": { "cels": 1, "h": 6, "id": 40, "w": 5 },
|
|
69
|
+
"mem-prop-5x6--1c": { "cels": 1, "h": 6, "id": 41, "w": 5 },
|
|
70
|
+
"mem-prop-5x6--1d": { "cels": 1, "h": 6, "id": 42, "w": 5 },
|
|
71
|
+
"mem-prop-5x6--1e": { "cels": 1, "h": 6, "id": 43, "w": 5 },
|
|
72
|
+
"mem-prop-5x6--1f": { "cels": 1, "h": 6, "id": 44, "w": 5 },
|
|
73
|
+
"mem-prop-5x6--20": { "cels": 1, "h": 6, "id": 45, "w": 5 },
|
|
74
|
+
"mem-prop-5x6--21": { "cels": 1, "h": 6, "id": 46, "w": 5 },
|
|
75
|
+
"mem-prop-5x6--22": { "cels": 1, "h": 6, "id": 47, "w": 5 },
|
|
76
|
+
"mem-prop-5x6--23": { "cels": 1, "h": 6, "id": 48, "w": 5 },
|
|
77
|
+
"mem-prop-5x6--24": { "cels": 1, "h": 6, "id": 49, "w": 5 },
|
|
78
|
+
"mem-prop-5x6--25": { "cels": 1, "h": 6, "id": 50, "w": 5 },
|
|
79
|
+
"mem-prop-5x6--26": { "cels": 1, "h": 6, "id": 51, "w": 5 },
|
|
80
|
+
"mem-prop-5x6--27": { "cels": 1, "h": 6, "id": 52, "w": 5 },
|
|
81
|
+
"mem-prop-5x6--28": { "cels": 1, "h": 6, "id": 53, "w": 5 },
|
|
82
|
+
"mem-prop-5x6--29": { "cels": 1, "h": 6, "id": 54, "w": 5 },
|
|
83
|
+
"mem-prop-5x6--2a": { "cels": 1, "h": 6, "id": 55, "w": 5 },
|
|
84
|
+
"mem-prop-5x6--2b": { "cels": 1, "h": 6, "id": 56, "w": 5 },
|
|
85
|
+
"mem-prop-5x6--2c": { "cels": 1, "h": 6, "id": 57, "w": 5 },
|
|
86
|
+
"mem-prop-5x6--2d": { "cels": 1, "h": 6, "id": 58, "w": 5 },
|
|
87
|
+
"mem-prop-5x6--2e": { "cels": 1, "h": 6, "id": 59, "w": 5 },
|
|
88
|
+
"mem-prop-5x6--2f": { "cels": 1, "h": 6, "id": 60, "w": 5 },
|
|
89
|
+
"mem-prop-5x6--30": { "cels": 1, "h": 6, "id": 61, "w": 5 },
|
|
90
|
+
"mem-prop-5x6--31": { "cels": 1, "h": 6, "id": 62, "w": 5 },
|
|
91
|
+
"mem-prop-5x6--32": { "cels": 1, "h": 6, "id": 63, "w": 5 },
|
|
92
|
+
"mem-prop-5x6--33": { "cels": 1, "h": 6, "id": 64, "w": 5 },
|
|
93
|
+
"mem-prop-5x6--34": { "cels": 1, "h": 6, "id": 65, "w": 5 },
|
|
94
|
+
"mem-prop-5x6--35": { "cels": 1, "h": 6, "id": 66, "w": 5 },
|
|
95
|
+
"mem-prop-5x6--36": { "cels": 1, "h": 6, "id": 67, "w": 5 },
|
|
96
|
+
"mem-prop-5x6--37": { "cels": 1, "h": 6, "id": 68, "w": 5 },
|
|
97
|
+
"mem-prop-5x6--38": { "cels": 1, "h": 6, "id": 69, "w": 5 },
|
|
98
|
+
"mem-prop-5x6--39": { "cels": 1, "h": 6, "id": 70, "w": 5 },
|
|
99
|
+
"mem-prop-5x6--3a": { "cels": 1, "h": 6, "id": 71, "w": 5 },
|
|
100
|
+
"mem-prop-5x6--3b": { "cels": 1, "h": 6, "id": 72, "w": 5 },
|
|
101
|
+
"mem-prop-5x6--3c": { "cels": 1, "h": 6, "id": 73, "w": 5 },
|
|
102
|
+
"mem-prop-5x6--3d": { "cels": 1, "h": 6, "id": 74, "w": 5 },
|
|
103
|
+
"mem-prop-5x6--3e": { "cels": 1, "h": 6, "id": 75, "w": 5 },
|
|
104
|
+
"mem-prop-5x6--3f": { "cels": 1, "h": 6, "id": 76, "w": 5 },
|
|
105
|
+
"mem-prop-5x6--40": { "cels": 1, "h": 6, "id": 77, "w": 5 },
|
|
106
|
+
"mem-prop-5x6--41": { "cels": 1, "h": 6, "id": 78, "w": 5 },
|
|
107
|
+
"mem-prop-5x6--42": { "cels": 1, "h": 6, "id": 79, "w": 5 },
|
|
108
|
+
"mem-prop-5x6--43": { "cels": 1, "h": 6, "id": 80, "w": 5 },
|
|
109
|
+
"mem-prop-5x6--44": { "cels": 1, "h": 6, "id": 81, "w": 5 },
|
|
110
|
+
"mem-prop-5x6--45": { "cels": 1, "h": 6, "id": 82, "w": 5 },
|
|
111
|
+
"mem-prop-5x6--46": { "cels": 1, "h": 6, "id": 83, "w": 5 },
|
|
112
|
+
"mem-prop-5x6--47": { "cels": 1, "h": 6, "id": 84, "w": 5 },
|
|
113
|
+
"mem-prop-5x6--48": { "cels": 1, "h": 6, "id": 85, "w": 5 },
|
|
114
|
+
"mem-prop-5x6--49": { "cels": 1, "h": 6, "id": 86, "w": 5 },
|
|
115
|
+
"mem-prop-5x6--4a": { "cels": 1, "h": 6, "id": 87, "w": 5 },
|
|
116
|
+
"mem-prop-5x6--4b": { "cels": 1, "h": 6, "id": 88, "w": 5 },
|
|
117
|
+
"mem-prop-5x6--4c": { "cels": 1, "h": 6, "id": 89, "w": 5 },
|
|
118
|
+
"mem-prop-5x6--4d": { "cels": 1, "h": 6, "id": 90, "w": 5 },
|
|
119
|
+
"mem-prop-5x6--4e": { "cels": 1, "h": 6, "id": 91, "w": 5 },
|
|
120
|
+
"mem-prop-5x6--4f": { "cels": 1, "h": 6, "id": 92, "w": 5 },
|
|
121
|
+
"mem-prop-5x6--50": { "cels": 1, "h": 6, "id": 93, "w": 5 },
|
|
122
|
+
"mem-prop-5x6--51": { "cels": 1, "h": 6, "id": 94, "w": 5 },
|
|
123
|
+
"mem-prop-5x6--52": { "cels": 1, "h": 6, "id": 95, "w": 5 },
|
|
124
|
+
"mem-prop-5x6--53": { "cels": 1, "h": 6, "id": 96, "w": 5 },
|
|
125
|
+
"mem-prop-5x6--54": { "cels": 1, "h": 6, "id": 97, "w": 5 },
|
|
126
|
+
"mem-prop-5x6--55": { "cels": 1, "h": 6, "id": 98, "w": 5 },
|
|
127
|
+
"mem-prop-5x6--56": { "cels": 1, "h": 6, "id": 99, "w": 5 },
|
|
128
|
+
"mem-prop-5x6--57": { "cels": 1, "h": 6, "id": 100, "w": 5 },
|
|
129
|
+
"mem-prop-5x6--58": { "cels": 1, "h": 6, "id": 101, "w": 5 },
|
|
130
|
+
"mem-prop-5x6--59": { "cels": 1, "h": 6, "id": 102, "w": 5 },
|
|
131
|
+
"mem-prop-5x6--5a": { "cels": 1, "h": 6, "id": 103, "w": 5 },
|
|
132
|
+
"mem-prop-5x6--5b": { "cels": 1, "h": 6, "id": 104, "w": 5 },
|
|
133
|
+
"mem-prop-5x6--5c": { "cels": 1, "h": 6, "id": 105, "w": 5 },
|
|
134
|
+
"mem-prop-5x6--5d": { "cels": 1, "h": 6, "id": 106, "w": 5 },
|
|
135
|
+
"mem-prop-5x6--5e": { "cels": 1, "h": 6, "id": 107, "w": 5 },
|
|
136
|
+
"mem-prop-5x6--5f": { "cels": 1, "h": 6, "id": 108, "w": 5 },
|
|
137
|
+
"mem-prop-5x6--60": { "cels": 1, "h": 6, "id": 109, "w": 5 },
|
|
138
|
+
"mem-prop-5x6--61": { "cels": 1, "h": 6, "id": 110, "w": 5 },
|
|
139
|
+
"mem-prop-5x6--62": { "cels": 1, "h": 6, "id": 111, "w": 5 },
|
|
140
|
+
"mem-prop-5x6--63": { "cels": 1, "h": 6, "id": 112, "w": 5 },
|
|
141
|
+
"mem-prop-5x6--64": { "cels": 1, "h": 6, "id": 113, "w": 5 },
|
|
142
|
+
"mem-prop-5x6--65": { "cels": 1, "h": 6, "id": 114, "w": 5 },
|
|
143
|
+
"mem-prop-5x6--66": { "cels": 1, "h": 6, "id": 115, "w": 5 },
|
|
144
|
+
"mem-prop-5x6--67": { "cels": 1, "h": 6, "id": 116, "w": 5 },
|
|
145
|
+
"mem-prop-5x6--68": { "cels": 1, "h": 6, "id": 117, "w": 5 },
|
|
146
|
+
"mem-prop-5x6--69": { "cels": 1, "h": 6, "id": 118, "w": 5 },
|
|
147
|
+
"mem-prop-5x6--6a": { "cels": 1, "h": 6, "id": 119, "w": 5 },
|
|
148
|
+
"mem-prop-5x6--6b": { "cels": 1, "h": 6, "id": 120, "w": 5 },
|
|
149
|
+
"mem-prop-5x6--6c": { "cels": 1, "h": 6, "id": 121, "w": 5 },
|
|
150
|
+
"mem-prop-5x6--6d": { "cels": 1, "h": 6, "id": 122, "w": 5 },
|
|
151
|
+
"mem-prop-5x6--6e": { "cels": 1, "h": 6, "id": 123, "w": 5 },
|
|
152
|
+
"mem-prop-5x6--6f": { "cels": 1, "h": 6, "id": 124, "w": 5 },
|
|
153
|
+
"mem-prop-5x6--70": { "cels": 1, "h": 6, "id": 125, "w": 5 },
|
|
154
|
+
"mem-prop-5x6--71": { "cels": 1, "h": 6, "id": 126, "w": 5 },
|
|
155
|
+
"mem-prop-5x6--72": { "cels": 1, "h": 6, "id": 127, "w": 5 },
|
|
156
|
+
"mem-prop-5x6--73": { "cels": 1, "h": 6, "id": 128, "w": 5 },
|
|
157
|
+
"mem-prop-5x6--74": { "cels": 1, "h": 6, "id": 129, "w": 5 },
|
|
158
|
+
"mem-prop-5x6--75": { "cels": 1, "h": 6, "id": 130, "w": 5 },
|
|
159
|
+
"mem-prop-5x6--76": { "cels": 1, "h": 6, "id": 131, "w": 5 },
|
|
160
|
+
"mem-prop-5x6--77": { "cels": 1, "h": 6, "id": 132, "w": 5 },
|
|
161
|
+
"mem-prop-5x6--78": { "cels": 1, "h": 6, "id": 133, "w": 5 },
|
|
162
|
+
"mem-prop-5x6--79": { "cels": 1, "h": 6, "id": 134, "w": 5 },
|
|
163
|
+
"mem-prop-5x6--7a": { "cels": 1, "h": 6, "id": 135, "w": 5 },
|
|
164
|
+
"mem-prop-5x6--7b": { "cels": 1, "h": 6, "id": 136, "w": 5 },
|
|
165
|
+
"mem-prop-5x6--7c": { "cels": 1, "h": 6, "id": 137, "w": 5 },
|
|
166
|
+
"mem-prop-5x6--7d": { "cels": 1, "h": 6, "id": 138, "w": 5 },
|
|
167
|
+
"mem-prop-5x6--7e": { "cels": 1, "h": 6, "id": 139, "w": 5 },
|
|
168
|
+
"mem-prop-5x6--7f": { "cels": 1, "h": 6, "id": 140, "w": 5 },
|
|
169
|
+
"oidoid--Default": { "cels": 1, "h": 16, "id": 141, "w": 16 }
|
|
170
|
+
},
|
|
171
|
+
"celXY": [
|
|
172
|
+
22, 37, 21, 27, 21, 29, 21, 31, 20, 33, 22, 33, 20, 35, 22, 35, 20, 37, 24,
|
|
173
|
+
26, 24, 26, 8, 16, 8, 16, 0, 16, 0, 16, 16, 14, 16, 14, 72, 13, 72, 13, 32,
|
|
174
|
+
26, 32, 26, 0, 16, 0, 16, 64, 13, 64, 13, 56, 13, 56, 13, 48, 13, 48, 13,
|
|
175
|
+
40, 13, 40, 13, 32, 13, 32, 13, 56, 13, 56, 13, 24, 13, 24, 13, 72, 0, 72,
|
|
176
|
+
0, 64, 0, 64, 0, 24, 0, 24, 0, 56, 0, 56, 0, 48, 0, 48, 0, 48, 0, 48, 0, 24,
|
|
177
|
+
0, 24, 0, 40, 0, 40, 0, 32, 0, 32, 0, 32, 0, 32, 0, 16, 0, 45, 56, 45, 56,
|
|
178
|
+
45, 56, 45, 56, 45, 56, 45, 56, 45, 56, 45, 56, 45, 56, 45, 56, 45, 56, 45,
|
|
179
|
+
56, 45, 56, 45, 56, 45, 56, 45, 56, 45, 56, 45, 56, 45, 56, 45, 56, 45, 56,
|
|
180
|
+
45, 56, 45, 56, 45, 56, 45, 56, 45, 56, 45, 56, 45, 56, 45, 56, 45, 56, 45,
|
|
181
|
+
56, 45, 56, 45, 56, 40, 56, 10, 53, 5, 53, 0, 53, 35, 51, 30, 51, 25, 51,
|
|
182
|
+
20, 51, 15, 51, 35, 45, 70, 50, 65, 50, 60, 50, 55, 50, 50, 50, 45, 50, 40,
|
|
183
|
+
50, 10, 47, 5, 47, 0, 47, 70, 62, 50, 56, 65, 62, 60, 62, 55, 62, 50, 62,
|
|
184
|
+
45, 62, 40, 62, 10, 59, 5, 59, 0, 59, 35, 57, 70, 32, 30, 57, 25, 57, 20,
|
|
185
|
+
57, 15, 57, 75, 56, 70, 56, 65, 56, 60, 56, 75, 50, 55, 56, 10, 35, 75, 32,
|
|
186
|
+
15, 33, 0, 35, 5, 35, 40, 38, 45, 38, 65, 32, 60, 32, 55, 32, 50, 32, 45,
|
|
187
|
+
32, 40, 26, 50, 26, 55, 26, 60, 26, 65, 26, 70, 26, 75, 26, 16, 27, 0, 29,
|
|
188
|
+
5, 29, 10, 29, 40, 32, 45, 26, 10, 41, 30, 45, 25, 45, 20, 45, 15, 45, 75,
|
|
189
|
+
44, 70, 44, 65, 44, 60, 44, 55, 44, 50, 44, 45, 44, 40, 44, 50, 38, 5, 41,
|
|
190
|
+
0, 41, 35, 39, 30, 39, 25, 39, 20, 39, 15, 39, 75, 38, 70, 38, 65, 38, 60,
|
|
191
|
+
38, 55, 38, 45, 56, 0, 0
|
|
192
|
+
]
|
|
193
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as V from '../../index.ts';
|
|
2
|
+
import type { Game } from '../game.ts';
|
|
3
|
+
export declare class ClockEnt implements V.Ent {
|
|
4
|
+
#private;
|
|
5
|
+
constructor();
|
|
6
|
+
free(v: Game): void;
|
|
7
|
+
update(v: Game): boolean | undefined;
|
|
8
|
+
}
|
|
9
|
+
/** @internal */
|
|
10
|
+
export declare function timeString(time: Readonly<Date>): string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as V from "../../index.js";
|
|
2
|
+
export class ClockEnt {
|
|
3
|
+
#time = new V.TextEnt();
|
|
4
|
+
constructor() {
|
|
5
|
+
this.#time.scale = 3;
|
|
6
|
+
this.#time.z = V.Layer.A;
|
|
7
|
+
}
|
|
8
|
+
free(v) {
|
|
9
|
+
this.#time.free(v);
|
|
10
|
+
}
|
|
11
|
+
update(v) {
|
|
12
|
+
const now = new Date();
|
|
13
|
+
this.#time.text = timeString(now);
|
|
14
|
+
if (this.#time.layout(v) || v.cam.invalid)
|
|
15
|
+
this.#time.xy = v.cam.follow({ w: this.#time.wh.w, h: this.#time.wh.h - this.#time.scaledLeading }, this.#time.z, 'N', { margin: { h: 8 } });
|
|
16
|
+
return this.#time.update(v);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/** @internal */
|
|
20
|
+
export function timeString(time) {
|
|
21
|
+
const hh = `${time.getHours() % 12 || 12}`.padStart(2, ' ');
|
|
22
|
+
const mm = `${time.getMinutes()}`.padStart(2, '0');
|
|
23
|
+
const ss = `${time.getSeconds()}`.padStart(2, '0');
|
|
24
|
+
return `${hh}:${mm}:${ss}`;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=clock-ent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clock-ent.js","sourceRoot":"","sources":["../../../../src/demo/ents/clock-ent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAA;AAGnC,MAAM,OAAO,QAAQ;IACV,KAAK,GAAc,IAAI,CAAC,CAAC,OAAO,EAAE,CAAA;IAE3C;QACE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAA;QACpB,IAAI,CAAC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AAC,EAAE,GAAG,CAAC,CAAA;IAClD,OAAO,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAA;AAC5B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as V from '../../index.ts';
|
|
2
|
+
import type { Game } from '../game.ts';
|
|
3
|
+
export declare class RenderToggleEnt implements V.Ent {
|
|
4
|
+
#private;
|
|
5
|
+
constructor(v: Game);
|
|
6
|
+
get on(): boolean;
|
|
7
|
+
free(v: Game): void;
|
|
8
|
+
/** always updates but never invalidates. */
|
|
9
|
+
update(v: Game): boolean | undefined;
|
|
10
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as V from "../../index.js";
|
|
2
|
+
// to-do: follow cam sw.
|
|
3
|
+
export class RenderToggleEnt {
|
|
4
|
+
#toggle;
|
|
5
|
+
constructor(v) {
|
|
6
|
+
this.#toggle = new V.ButtonEnt(v, {
|
|
7
|
+
button: {
|
|
8
|
+
w: { tag: 'background--Strawberry' },
|
|
9
|
+
nw: { tag: 'background--Transparent' },
|
|
10
|
+
n: { tag: 'background--Bubblegum' },
|
|
11
|
+
e: { tag: 'background--Blueberry' },
|
|
12
|
+
s: { tag: 'background--Kiwi' },
|
|
13
|
+
origin: { tag: 'background--Grape' },
|
|
14
|
+
border: { n: 1 },
|
|
15
|
+
margin: { w: 2, h: 2 }
|
|
16
|
+
},
|
|
17
|
+
selected: { tag: 'background--OrangeCheckerboard' },
|
|
18
|
+
toggle: true,
|
|
19
|
+
text: { text: 'render', scale: 2 },
|
|
20
|
+
w: 64,
|
|
21
|
+
h: 22,
|
|
22
|
+
x: 50,
|
|
23
|
+
y: 25,
|
|
24
|
+
pressed: { tag: 'background--Bubblegum' }
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
get on() {
|
|
28
|
+
return this.#toggle.on;
|
|
29
|
+
}
|
|
30
|
+
free(v) {
|
|
31
|
+
this.#toggle.free(v);
|
|
32
|
+
}
|
|
33
|
+
/** always updates but never invalidates. */
|
|
34
|
+
update(v) {
|
|
35
|
+
return this.#toggle.update(v);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=render-toggle-ent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-toggle-ent.js","sourceRoot":"","sources":["../../../../src/demo/ents/render-toggle-ent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAA;AAInC,wBAAwB;AACxB,MAAM,OAAO,eAAe;IACjB,OAAO,CAAmC;IAEnD,YAAY,CAAO;QACjB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE;YAChC,MAAM,EAAE;gBACN,CAAC,EAAE,EAAC,GAAG,EAAE,wBAAwB,EAAC;gBAClC,EAAE,EAAE,EAAC,GAAG,EAAE,yBAAyB,EAAC;gBACpC,CAAC,EAAE,EAAC,GAAG,EAAE,uBAAuB,EAAC;gBACjC,CAAC,EAAE,EAAC,GAAG,EAAE,uBAAuB,EAAC;gBACjC,CAAC,EAAE,EAAC,GAAG,EAAE,kBAAkB,EAAC;gBAC5B,MAAM,EAAE,EAAC,GAAG,EAAE,mBAAmB,EAAC;gBAClC,MAAM,EAAE,EAAC,CAAC,EAAE,CAAC,EAAC;gBACd,MAAM,EAAE,EAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAC;aACrB;YACD,QAAQ,EAAE,EAAC,GAAG,EAAE,gCAAgC,EAAC;YACjD,MAAM,EAAE,IAAI;YACZ,IAAI,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAC;YAChC,CAAC,EAAE,EAAE;YACL,CAAC,EAAE,EAAE;YACL,CAAC,EAAE,EAAE;YACL,CAAC,EAAE,EAAE;YACL,OAAO,EAAE,EAAC,GAAG,EAAE,uBAAuB,EAAC;SACxC,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,EAAE;QACJ,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAA;IACxB,CAAC;IAED,IAAI,CAAC,CAAO;QACV,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACtB,CAAC;IAED,4CAA4C;IAC5C,MAAM,CAAC,CAAO;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IAC/B,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as V from '../../index.ts';
|
|
2
|
+
import type { Game } from '../game.ts';
|
|
3
|
+
export declare class WorkCounterEnt implements V.Ent {
|
|
4
|
+
#private;
|
|
5
|
+
constructor();
|
|
6
|
+
free(v: Game): void;
|
|
7
|
+
incrementRender(): void;
|
|
8
|
+
/** always updates but never invalidates. */
|
|
9
|
+
update(v: Game): undefined;
|
|
10
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as V from "../../index.js";
|
|
2
|
+
export class WorkCounterEnt {
|
|
3
|
+
#renders = 0;
|
|
4
|
+
#text = new V.TextEnt();
|
|
5
|
+
#updates = 0;
|
|
6
|
+
constructor() {
|
|
7
|
+
this.#text.z = V.Layer.A;
|
|
8
|
+
}
|
|
9
|
+
free(v) {
|
|
10
|
+
this.#text.free(v);
|
|
11
|
+
}
|
|
12
|
+
incrementRender() {
|
|
13
|
+
this.#renders++;
|
|
14
|
+
}
|
|
15
|
+
/** always updates but never invalidates. */
|
|
16
|
+
update(v) {
|
|
17
|
+
this.#updates++;
|
|
18
|
+
this.#text.text = `${this.#updates} updates\n${this.#renders + 1} renders`;
|
|
19
|
+
this.#text.layout(v);
|
|
20
|
+
this.#text.xy = v.cam.follow({ w: this.#text.wh.w, h: this.#text.wh.h - this.#text.scaledLeading }, this.#text.z, 'NE', { margin: { w: 8, h: 8 } });
|
|
21
|
+
this.#text.update(v);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sour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,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IACtB,CAAC;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as V from '../index.ts';
|
|
2
|
+
import type { Tag } from './types/tag.ts';
|
|
3
|
+
export declare class Game extends V.Void<Tag> {
|
|
4
|
+
#private;
|
|
5
|
+
constructor();
|
|
6
|
+
register(op: 'add' | 'remove'): Promise<void>;
|
|
7
|
+
onLoop(_millis: V.Millis): void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* returns [0, 59_999].
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function renderDelayMillis(time: Readonly<Date>, debugSecs: string | undefined): number;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import * as V from "../index.js";
|
|
2
|
+
import preloadAtlasJSON from './assets/preload-atlas.json' with { type: 'json' };
|
|
3
|
+
import { ClockEnt } from "./ents/clock-ent.js";
|
|
4
|
+
import { RenderToggleEnt } from "./ents/render-toggle-ent.js";
|
|
5
|
+
import { WorkCounterEnt } from "./ents/work-counter-ent.js";
|
|
6
|
+
export class Game extends V.Void {
|
|
7
|
+
#filterSprites;
|
|
8
|
+
#interval = 0;
|
|
9
|
+
#renderToggle;
|
|
10
|
+
#timer = 0;
|
|
11
|
+
#workCounter;
|
|
12
|
+
constructor() {
|
|
13
|
+
super({
|
|
14
|
+
preloadAtlas: {
|
|
15
|
+
image: document.querySelector('#preload-atlas'),
|
|
16
|
+
json: preloadAtlasJSON
|
|
17
|
+
},
|
|
18
|
+
backgroundRGBA: 0xffffb1ff,
|
|
19
|
+
minWH: { w: 320, h: 240 }
|
|
20
|
+
});
|
|
21
|
+
this.#filterSprites = new V.Pool({
|
|
22
|
+
alloc: pool => new V.Sprite(pool, 0, this.preload, this.framer),
|
|
23
|
+
allocBytes: V.drawableBytes,
|
|
24
|
+
pageBlocks: 10
|
|
25
|
+
});
|
|
26
|
+
this.#renderToggle = new RenderToggleEnt(this);
|
|
27
|
+
this.#workCounter = new WorkCounterEnt();
|
|
28
|
+
this.#initZoo();
|
|
29
|
+
}
|
|
30
|
+
async register(op) {
|
|
31
|
+
await super.register(op);
|
|
32
|
+
if (op === 'add') {
|
|
33
|
+
this.framer.requestFrame();
|
|
34
|
+
this.#startTimer();
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
this.#stopTimer();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
onLoop(_millis) {
|
|
41
|
+
this.renderer.always = this.#renderToggle.on || !!V.debug?.invalid;
|
|
42
|
+
let render = this.#updateCam();
|
|
43
|
+
const updated = this.zoo.update(this);
|
|
44
|
+
if (V.debug?.input)
|
|
45
|
+
this.#printInput();
|
|
46
|
+
render ||=
|
|
47
|
+
updated ||
|
|
48
|
+
this.cam.invalid ||
|
|
49
|
+
this.renderer.invalid ||
|
|
50
|
+
this.renderer.always;
|
|
51
|
+
if (render) {
|
|
52
|
+
this.#workCounter.incrementRender();
|
|
53
|
+
this.renderer.clear(0xffffb1ff);
|
|
54
|
+
this.renderer.predraw(this.cam, this.framer);
|
|
55
|
+
this.renderer.setDepth(true);
|
|
56
|
+
this.renderer.draw(this.sprites);
|
|
57
|
+
this.renderer.setDepth(false);
|
|
58
|
+
this.renderer.draw(this.#filterSprites);
|
|
59
|
+
}
|
|
60
|
+
this.requestFrame();
|
|
61
|
+
}
|
|
62
|
+
#initZoo() {
|
|
63
|
+
// to-do: why can I use follow cam ent with an ent?
|
|
64
|
+
const border = new V.NinePatchEnt(this, {
|
|
65
|
+
n: { tag: 'background--Black' },
|
|
66
|
+
origin: { tag: 'background--Transparent' },
|
|
67
|
+
border: { n: 1 },
|
|
68
|
+
z: V.Layer.UIA // to-do: default 0 layer is dumb.
|
|
69
|
+
});
|
|
70
|
+
this.zoo.add(border);
|
|
71
|
+
const box = this.cam.follow({ w: 0, h: 0 }, V.Layer.UIA, 'NW', { fill: 'XY' });
|
|
72
|
+
border.xy = box; // to-do: use x, y, w, h everywhere so the interfaces align and I can just assing here.
|
|
73
|
+
border.wh = box;
|
|
74
|
+
const backpacker = this.sprites.alloc();
|
|
75
|
+
backpacker.tag = 'backpacker--WalkRight';
|
|
76
|
+
backpacker.x = 7;
|
|
77
|
+
backpacker.y = 7;
|
|
78
|
+
backpacker.z = V.Layer.C;
|
|
79
|
+
backpacker.stretch = true;
|
|
80
|
+
backpacker.w *= 5;
|
|
81
|
+
backpacker.h *= 5;
|
|
82
|
+
const oidoid = new V.FollowCamEnt(this, 'oidoid--Default', 'SW');
|
|
83
|
+
oidoid.z = V.Layer.UIG;
|
|
84
|
+
oidoid.margin = { w: 4, h: 4 };
|
|
85
|
+
this.zoo.add(new V.CursorEnt(this, 'cursor--Pointer'), this.#renderToggle, new ClockEnt(), this.#workCounter, oidoid);
|
|
86
|
+
const overlay = this.#filterSprites.alloc();
|
|
87
|
+
overlay.tag = 'background--GreyCheckerboard';
|
|
88
|
+
overlay.w = V.drawableMaxWH.w;
|
|
89
|
+
overlay.h = V.drawableMaxWH.h;
|
|
90
|
+
overlay.z = V.Layer.UIA;
|
|
91
|
+
}
|
|
92
|
+
#printInput() {
|
|
93
|
+
if (this.input.started) {
|
|
94
|
+
const on = !!this.input.on.length;
|
|
95
|
+
if (on)
|
|
96
|
+
console.debug(`[input] buttons on: ${this.input.on.join(' ')}.`);
|
|
97
|
+
else
|
|
98
|
+
console.debug(`[input] buttons off.`);
|
|
99
|
+
const combo = this.input.combo;
|
|
100
|
+
if (combo.length > 1 && on)
|
|
101
|
+
console.debug(`[input] combo: ${combo.map(set => set.join('+')).join(' ')}.`);
|
|
102
|
+
}
|
|
103
|
+
if (this.input.point?.invalid &&
|
|
104
|
+
this.input.point?.click &&
|
|
105
|
+
!this.input.point.pinch)
|
|
106
|
+
console.debug(`[input] ${this.input.point.drag.on ? 'drag' : 'click'} xy: ${this.input.point.x} ${this.input.point.y}.`);
|
|
107
|
+
if (this.input.point?.pinch)
|
|
108
|
+
console.debug(`[input] pinch xy: ${this.input.point.pinch.xy.x} ${this.input.point.pinch.xy.y}.`);
|
|
109
|
+
if (this.input.wheel)
|
|
110
|
+
console.debug(`[input] wheel xy: ${this.input.wheel.delta.xy.x} ${this.input.wheel.delta.xy.y}.`);
|
|
111
|
+
}
|
|
112
|
+
#startTimer() {
|
|
113
|
+
this.#timer = setTimeout(() => {
|
|
114
|
+
this.framer.requestFrame();
|
|
115
|
+
this.#interval = setInterval(() => this.framer.requestFrame(), (V.debug?.seconds ? 1 : 60) * 1000);
|
|
116
|
+
}, renderDelayMillis(new Date(), V.debug?.seconds));
|
|
117
|
+
}
|
|
118
|
+
#stopTimer() {
|
|
119
|
+
clearTimeout(this.#timer);
|
|
120
|
+
clearInterval(this.#interval);
|
|
121
|
+
}
|
|
122
|
+
#updateCam() {
|
|
123
|
+
let render = this.input.isAnyOn('L', 'R', 'U', 'D');
|
|
124
|
+
if (this.input.isAnyOnStart('L', 'R', 'U', 'D')) {
|
|
125
|
+
this.cam.x = Math.trunc(this.cam.x);
|
|
126
|
+
this.cam.y = Math.trunc(this.cam.y);
|
|
127
|
+
}
|
|
128
|
+
const d = 1 / 4;
|
|
129
|
+
if (this.input.isOn('L'))
|
|
130
|
+
this.cam.x -= d;
|
|
131
|
+
if (this.input.isOn('R'))
|
|
132
|
+
this.cam.x += d;
|
|
133
|
+
if (this.input.isOn('U'))
|
|
134
|
+
this.cam.y -= d;
|
|
135
|
+
if (this.input.isOn('D'))
|
|
136
|
+
this.cam.y += d;
|
|
137
|
+
if (this.input.wheel?.delta.xy.y) {
|
|
138
|
+
render = true;
|
|
139
|
+
this.cam.zoomOut -= this.input.wheel.delta.client.y * 0.01;
|
|
140
|
+
}
|
|
141
|
+
this.cam.update(this.canvas);
|
|
142
|
+
return render;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* returns [0, 59_999].
|
|
147
|
+
* @internal
|
|
148
|
+
*/
|
|
149
|
+
export function renderDelayMillis(time, debugSecs) {
|
|
150
|
+
return (((debugSecs ? 0 : (59 - (time.getSeconds() % 60)) * 1000) +
|
|
151
|
+
1000 -
|
|
152
|
+
(time.getMilliseconds() % 1000)) %
|
|
153
|
+
(debugSecs ? 1000 : 60_000));
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=game.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"game.js","sourceRoot":"","sources":["../../../src/demo/game.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,aAAa,CAAA;AAChC,OAAO,gBAAgB,MAAM,6BAA6B,CAAC,OAAM,IAAI,EAAE,MAAM,EAAC,CAAA;AAC9E,OAAO,EAAC,QAAQ,EAAC,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAC3D,OAAO,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAA;AAGzD,MAAM,OAAO,IAAK,SAAQ,CAAC,CAAC,IAAS;IACnC,cAAc,CAAuB;IACrC,SAAS,GAAW,CAAC,CAAA;IACrB,aAAa,CAAiB;IAC9B,MAAM,GAAW,CAAC,CAAA;IAClB,YAAY,CAAgB;IAE5B;QACE,KAAK,CAAC;YACJ,YAAY,EAAE;gBACZ,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,gBAAgB,CAAE;gBAChD,IAAI,EAAE,gBAAgB;aACvB;YACD,cAAc,EAAE,UAAU;YAC1B,KAAK,EAAE,EAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAC;SACxB,CAAC,CAAA;QACF,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC,IAAI,CAAgB;YAC9C,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC;YAC/D,UAAU,EAAE,CAAC,CAAC,aAAa;YAC3B,UA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ot":"","sources":["../../../src/demo/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,aAAa,CAAA;AAChC,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAA;AAE9B,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEjD,MAAM,CAAC,GAAG,IAAI,IAAI,EAAE,CAAA;AACpB,MAAM,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AACvB,IAAI,CAAC,CAAC,KAAK;IAAG,UAAmC,CAAC,CAAC,GAAG,CAAC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// TypeScript config for demo.
|
|
2
|
+
{
|
|
3
|
+
"extends": "../../tools/tsconfig-base.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"lib": [
|
|
6
|
+
"ES2024",
|
|
7
|
+
"ESNext.disposable",
|
|
8
|
+
"DOM",
|
|
9
|
+
"DOM.AsyncIterable",
|
|
10
|
+
"DOM.Iterable"
|
|
11
|
+
],
|
|
12
|
+
"customConditions": ["browser"]
|
|
13
|
+
},
|
|
14
|
+
"references": [{ "path": "../" }]
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.js","sourceRoot":"","sources":["../../../../src/demo/types/tag.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../schema/config-file.v0.json",
|
|
3
|
+
"entry": "assets/index.html",
|
|
4
|
+
"meta": "../../dist/meta.json",
|
|
5
|
+
"out": { "dir": "../../dist/public/", "name": "void" },
|
|
6
|
+
"preloadAtlas": {
|
|
7
|
+
"dir": "assets/preload-atlas/",
|
|
8
|
+
"image": "../../dist/public/preload-atlas.png",
|
|
9
|
+
"json": "assets/preload-atlas.json"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { TagFormat } from '../graphics/atlas.ts';
|
|
2
|
+
import { Layer } from '../graphics/layer.ts';
|
|
3
|
+
import { type XY } from '../types/geo.ts';
|
|
4
|
+
import type { Void } from '../void.ts';
|
|
5
|
+
import type { Ent } from './ent.ts';
|
|
6
|
+
import { type NinePatchOpts } from './nine-patch-ent.ts';
|
|
7
|
+
export type ButtonOpts<Tag extends TagFormat> = {
|
|
8
|
+
button: Omit<NinePatchOpts<Tag>, 'x' | 'y' | 'wh'>;
|
|
9
|
+
pressed: {
|
|
10
|
+
tag: Tag;
|
|
11
|
+
z?: Layer | undefined;
|
|
12
|
+
};
|
|
13
|
+
selected: {
|
|
14
|
+
tag: Tag;
|
|
15
|
+
z?: Layer | undefined;
|
|
16
|
+
};
|
|
17
|
+
toggle?: boolean | undefined;
|
|
18
|
+
text?: {
|
|
19
|
+
text?: string | undefined;
|
|
20
|
+
scale?: number | undefined;
|
|
21
|
+
z?: Layer | undefined;
|
|
22
|
+
} | undefined;
|
|
23
|
+
w?: number | undefined;
|
|
24
|
+
h?: number | undefined;
|
|
25
|
+
x?: number | undefined;
|
|
26
|
+
y?: number | undefined;
|
|
27
|
+
};
|
|
28
|
+
export declare class ButtonEnt<Tag extends TagFormat, Button extends string> implements Ent {
|
|
29
|
+
#private;
|
|
30
|
+
constructor(v: Void<Tag, string>, opts: Readonly<ButtonOpts<Tag>>);
|
|
31
|
+
get selected(): boolean;
|
|
32
|
+
free(v: Void<Tag, string>): void;
|
|
33
|
+
get on(): boolean;
|
|
34
|
+
get onStart(): boolean;
|
|
35
|
+
set text(str: string);
|
|
36
|
+
update(v: Void<Tag, 'A' | 'Click' | Button>): boolean | undefined;
|
|
37
|
+
setXY(v: Void<Tag, string>, xy: Readonly<XY>): void;
|
|
38
|
+
}
|