Skip to content

Commit 86ace2d

Browse files
author
DavidQ
committed
Implemented. No shape guessing/default typing now.
What changed: - Skin Editor now fails fast if any object is missing `shape` or has unsupported shape. - [tools/Skin Editor/main.js](C:/Users/davidq/Documents/GitHub/HTML-JavaScript-Gaming/tools/Skin%20Editor/main.js:86) - [tools/Skin Editor/main.js](C:/Users/davidq/Documents/GitHub/HTML-JavaScript-Gaming/tools/Skin%20Editor/main.js:322) - [tools/Skin Editor/main.js](C:/Users/davidq/Documents/GitHub/HTML-JavaScript-Gaming/tools/Skin%20Editor/main.js:705) - [tools/Skin Editor/main.js](C:/Users/davidq/Documents/GitHub/HTML-JavaScript-Gaming/tools/Skin%20Editor/main.js:1397) - Removed fallback/inference behavior in shape-type resolution (no more “guess rectangle/hud-color/etc”). - [tools/Skin Editor/main.js](C:/Users/davidq/Documents/GitHub/HTML-JavaScript-Gaming/tools/Skin%20Editor/main.js:705) - Removed silent fallback normalized document creation in Skin Editor (invalid stays invalid, shows error). - [tools/Skin Editor/main.js](C:/Users/davidq/Documents/GitHub/HTML-JavaScript-Gaming/tools/Skin%20Editor/main.js:287) - Shared loader now enforces expected `shape` per game object contract. - [games/shared/gameSkinLoader.js](C:/Users/davidq/Documents/GitHub/HTML-JavaScript-Gaming/games/shared/gameSkinLoader.js:40) - [games/shared/gameSkinLoader.js](C:/Users/davidq/Documents/GitHub/HTML-JavaScript-Gaming/games/shared/gameSkinLoader.js:135) - [games/shared/gameSkinLoader.js](C:/Users/davidq/Documents/GitHub/HTML-JavaScript-Gaming/games/shared/gameSkinLoader.js:301) You asked where it is in Breakout preset and to add it there: - Breakout preset now has `shape` on every object under `payload.skin.objects`. - [game-breakout-skin-editor.json](C:/Users/davidq/Documents/GitHub/HTML-JavaScript-Gaming/games/breakout/assets/presets/game-breakout-skin-editor.json:17) Also updated all shipped game skin defaults + skin-editor presets so strict mode loads cleanly: - [games/breakout/assets/skins/default.json](C:/Users/davidq/Documents/GitHub/HTML-JavaScript-Gaming/games/breakout/assets/skins/default.json) - [games/breakout/assets/presets/game-breakout-skin-editor.json](C:/Users/davidq/Documents/GitHub/HTML-JavaScript-Gaming/games/breakout/assets/presets/game-breakout-skin-editor.json) - [games/pong/assets/skins/default.json](C:/Users/davidq/Documents/GitHub/HTML-JavaScript-Gaming/games/pong/assets/skins/default.json) - [games/pong/assets/presets/game-pong-skin-editor.json](C:/Users/davidq/Documents/GitHub/HTML-JavaScript-Gaming/games/pong/assets/presets/game-pong-skin-editor.json) - [games/bouncing-ball/assets/skins/default.json](C:/Users/davidq/Documents/GitHub/HTML-JavaScript-Gaming/games/bouncing-ball/assets/skins/default.json) - [games/bouncing-ball/assets/presets/game-bouncing-ball-skin-editor.json](C:/Users/davidq/Documents/GitHub/HTML-JavaScript-Gaming/games/bouncing-ball/assets/presets/game-bouncing-ball-skin-editor.json) - [games/SolarSystem/assets/skins/default.json](C:/Users/davidq/Documents/GitHub/HTML-JavaScript-Gaming/games/SolarSystem/assets/skins/default.json) - [games/SolarSystem/assets/presets/game-solarsystem-skin-editor.json](C:/Users/davidq/Documents/GitHub/HTML-JavaScript-Gaming/games/SolarSystem/assets/presets/game-solarsystem-skin-editor.json) Validation run: - `node --check tools/Skin Editor/main.js` passed - `node --check games/shared/gameSkinLoader.js` passed - object-shape audit script reports all game skin objects now include `shape` Commit comment: `feat(skin-contract): require explicit shape on every skin object, remove shape inference defaults, and add shape fields to all game skin defaults/presets`
1 parent 06f44c4 commit 86ace2d

11 files changed

Lines changed: 558 additions & 184 deletions

File tree

games/SolarSystem/assets/presets/game-solarsystem-skin-editor.json

Lines changed: 48 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,98 +16,122 @@
1616
"name": "Solar System Classic Skin",
1717
"objects": {
1818
"background": {
19-
"color": "#030712"
19+
"color": "#030712",
20+
"shape": "hud-color"
2021
},
2122
"frame": {
22-
"color": "#dbeafe"
23+
"color": "#dbeafe",
24+
"shape": "hud-color"
2325
},
2426
"orbit": {
25-
"color": "#334155"
27+
"color": "#334155",
28+
"shape": "hud-color"
2629
},
2730
"sun": {
2831
"color": "#fbbf24",
29-
"radius": 30
32+
"radius": 30,
33+
"shape": "circle"
3034
},
3135
"hudText": {
32-
"color": "#dbeafe"
36+
"color": "#dbeafe",
37+
"shape": "hud-color"
3338
},
3439
"hudMuted": {
35-
"color": "#94a3b8"
40+
"color": "#94a3b8",
41+
"shape": "hud-color"
3642
},
3743
"hudPanel": {
38-
"color": "#07101d"
44+
"color": "#07101d",
45+
"shape": "hud-color"
3946
},
4047
"mercury": {
4148
"color": "#9ca3af",
42-
"radius": 4
49+
"radius": 4,
50+
"shape": "circle"
4351
},
4452
"venus": {
4553
"color": "#fde68a",
46-
"radius": 6
54+
"radius": 6,
55+
"shape": "circle"
4756
},
4857
"earth": {
4958
"color": "#38bdf8",
50-
"radius": 6
59+
"radius": 6,
60+
"shape": "circle"
5161
},
5262
"mars": {
5363
"color": "#fb7185",
54-
"radius": 5
64+
"radius": 5,
65+
"shape": "circle"
5566
},
5667
"jupiter": {
5768
"color": "#f59e0b",
58-
"radius": 14
69+
"radius": 14,
70+
"shape": "circle"
5971
},
6072
"saturn": {
6173
"color": "#eab308",
62-
"radius": 12
74+
"radius": 12,
75+
"shape": "circle"
6376
},
6477
"uranus": {
6578
"color": "#67e8f9",
66-
"radius": 10
79+
"radius": 10,
80+
"shape": "circle"
6781
},
6882
"neptune": {
6983
"color": "#60a5fa",
70-
"radius": 10
84+
"radius": 10,
85+
"shape": "circle"
7186
},
7287
"moon": {
7388
"color": "#e5e7eb",
74-
"radius": 2
89+
"radius": 2,
90+
"shape": "circle"
7591
},
7692
"io": {
7793
"color": "#fde68a",
78-
"radius": 2
94+
"radius": 2,
95+
"shape": "circle"
7996
},
8097
"europa": {
8198
"color": "#dbeafe",
82-
"radius": 2
99+
"radius": 2,
100+
"shape": "circle"
83101
},
84102
"ganymede": {
85103
"color": "#cbd5e1",
86-
"radius": 3
104+
"radius": 3,
105+
"shape": "circle"
87106
},
88107
"titan": {
89108
"color": "#fef3c7",
90-
"radius": 3
109+
"radius": 3,
110+
"shape": "circle"
91111
},
92112
"ringJupiter": {
93113
"color": "#f59e0b",
94114
"innerRadius": 18,
95-
"outerRadius": 22
115+
"outerRadius": 22,
116+
"shape": "ring"
96117
},
97118
"ringSaturn": {
98119
"color": "#fde68a",
99120
"innerRadius": 18,
100-
"outerRadius": 30
121+
"outerRadius": 30,
122+
"shape": "ring"
101123
},
102124
"ringUranus": {
103125
"color": "#67e8f9",
104126
"innerRadius": 15,
105-
"outerRadius": 20
127+
"outerRadius": 20,
128+
"shape": "ring"
106129
},
107130
"ringNeptune": {
108131
"color": "#60a5fa",
109132
"innerRadius": 15,
110-
"outerRadius": 19
133+
"outerRadius": 19,
134+
"shape": "ring"
111135
}
112136
},
113137
"entities": {}

games/SolarSystem/assets/skins/default.json

Lines changed: 48 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,98 +6,122 @@
66
"name": "Solar System Classic Skin",
77
"objects": {
88
"background": {
9-
"color": "#030712"
9+
"color": "#030712",
10+
"shape": "hud-color"
1011
},
1112
"frame": {
12-
"color": "#dbeafe"
13+
"color": "#dbeafe",
14+
"shape": "hud-color"
1315
},
1416
"orbit": {
15-
"color": "#334155"
17+
"color": "#334155",
18+
"shape": "hud-color"
1619
},
1720
"sun": {
1821
"color": "#fbbf24",
19-
"radius": 30
22+
"radius": 30,
23+
"shape": "circle"
2024
},
2125
"hudText": {
22-
"color": "#dbeafe"
26+
"color": "#dbeafe",
27+
"shape": "hud-color"
2328
},
2429
"hudMuted": {
25-
"color": "#94a3b8"
30+
"color": "#94a3b8",
31+
"shape": "hud-color"
2632
},
2733
"hudPanel": {
28-
"color": "#07101d"
34+
"color": "#07101d",
35+
"shape": "hud-color"
2936
},
3037
"mercury": {
3138
"color": "#9ca3af",
32-
"radius": 4
39+
"radius": 4,
40+
"shape": "circle"
3341
},
3442
"venus": {
3543
"color": "#fde68a",
36-
"radius": 6
44+
"radius": 6,
45+
"shape": "circle"
3746
},
3847
"earth": {
3948
"color": "#38bdf8",
40-
"radius": 6
49+
"radius": 6,
50+
"shape": "circle"
4151
},
4252
"mars": {
4353
"color": "#fb7185",
44-
"radius": 5
54+
"radius": 5,
55+
"shape": "circle"
4556
},
4657
"jupiter": {
4758
"color": "#f59e0b",
48-
"radius": 14
59+
"radius": 14,
60+
"shape": "circle"
4961
},
5062
"saturn": {
5163
"color": "#eab308",
52-
"radius": 12
64+
"radius": 12,
65+
"shape": "circle"
5366
},
5467
"uranus": {
5568
"color": "#67e8f9",
56-
"radius": 10
69+
"radius": 10,
70+
"shape": "circle"
5771
},
5872
"neptune": {
5973
"color": "#60a5fa",
60-
"radius": 10
74+
"radius": 10,
75+
"shape": "circle"
6176
},
6277
"moon": {
6378
"color": "#e5e7eb",
64-
"radius": 2
79+
"radius": 2,
80+
"shape": "circle"
6581
},
6682
"io": {
6783
"color": "#fde68a",
68-
"radius": 2
84+
"radius": 2,
85+
"shape": "circle"
6986
},
7087
"europa": {
7188
"color": "#dbeafe",
72-
"radius": 2
89+
"radius": 2,
90+
"shape": "circle"
7391
},
7492
"ganymede": {
7593
"color": "#cbd5e1",
76-
"radius": 3
94+
"radius": 3,
95+
"shape": "circle"
7796
},
7897
"titan": {
7998
"color": "#fef3c7",
80-
"radius": 3
99+
"radius": 3,
100+
"shape": "circle"
81101
},
82102
"ringJupiter": {
83103
"color": "#f59e0b",
84104
"innerRadius": 18,
85-
"outerRadius": 22
105+
"outerRadius": 22,
106+
"shape": "ring"
86107
},
87108
"ringSaturn": {
88109
"color": "#fde68a",
89110
"innerRadius": 18,
90-
"outerRadius": 30
111+
"outerRadius": 30,
112+
"shape": "ring"
91113
},
92114
"ringUranus": {
93115
"color": "#67e8f9",
94116
"innerRadius": 15,
95-
"outerRadius": 20
117+
"outerRadius": 20,
118+
"shape": "ring"
96119
},
97120
"ringNeptune": {
98121
"color": "#60a5fa",
99122
"innerRadius": 15,
100-
"outerRadius": 19
123+
"outerRadius": 19,
124+
"shape": "ring"
101125
}
102126
},
103127
"entities": {}

games/bouncing-ball/assets/presets/game-bouncing-ball-skin-editor.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,30 @@
1616
"name": "Bouncing Ball Classic Skin",
1717
"objects": {
1818
"background": {
19-
"color": "#05070a"
19+
"color": "#05070a",
20+
"shape": "hud-color"
2021
},
2122
"wall": {
2223
"color": "#f4f4ef",
23-
"thickness": 18
24+
"thickness": 18,
25+
"shape": "wall"
2426
},
2527
"ball": {
2628
"color": "#f4f4ef",
27-
"size": 22
29+
"size": 22,
30+
"shape": "square"
2831
},
2932
"hudText": {
30-
"color": "#f4f4ef"
33+
"color": "#f4f4ef",
34+
"shape": "hud-color"
3135
},
3236
"hudMuted": {
33-
"color": "#9ba3b3"
37+
"color": "#9ba3b3",
38+
"shape": "hud-color"
3439
},
3540
"hudPanel": {
36-
"color": "#05070a"
41+
"color": "#05070a",
42+
"shape": "hud-color"
3743
}
3844
},
3945
"entities": {}

games/bouncing-ball/assets/skins/default.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,30 @@
66
"name": "Bouncing Ball Classic Skin",
77
"objects": {
88
"background": {
9-
"color": "#05070a"
9+
"color": "#05070a",
10+
"shape": "hud-color"
1011
},
1112
"wall": {
1213
"color": "#f4f4ef",
13-
"thickness": 18
14+
"thickness": 18,
15+
"shape": "wall"
1416
},
1517
"ball": {
1618
"color": "#f4f4ef",
17-
"size": 22
19+
"size": 22,
20+
"shape": "square"
1821
},
1922
"hudText": {
20-
"color": "#f4f4ef"
23+
"color": "#f4f4ef",
24+
"shape": "hud-color"
2125
},
2226
"hudMuted": {
23-
"color": "#9ba3b3"
27+
"color": "#9ba3b3",
28+
"shape": "hud-color"
2429
},
2530
"hudPanel": {
26-
"color": "#05070a"
31+
"color": "#05070a",
32+
"shape": "hud-color"
2733
}
2834
},
2935
"entities": {}

0 commit comments

Comments
 (0)