pixospritz-specs 1.0.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.
- package/README.md +266 -0
- package/constants/directions.json +67 -0
- package/constants/events.json +137 -0
- package/constants/shader-types.json +208 -0
- package/formats/manifest.schema.json +206 -0
- package/formats/map.schema.json +278 -0
- package/formats/save.schema.json +226 -0
- package/formats/sprite.schema.json +184 -0
- package/generate-c-headers.cjs +353 -0
- package/index.js +121 -0
- package/math/camera.spec.json +157 -0
- package/math/matrix.spec.json +160 -0
- package/math/vector.spec.json +137 -0
- package/package.json +36 -0
- package/shaders/common/lighting.glsl +150 -0
- package/shaders/common/transforms.glsl +164 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://pixospritz.dev/schemas/manifest.schema.json",
|
|
4
|
+
"title": "PixoSpritz Game Manifest",
|
|
5
|
+
"description": "Schema for .pxz game package manifest files",
|
|
6
|
+
"type": "object",
|
|
7
|
+
|
|
8
|
+
"required": ["title", "version", "initialZones"],
|
|
9
|
+
|
|
10
|
+
"properties": {
|
|
11
|
+
"title": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "Game title"
|
|
14
|
+
},
|
|
15
|
+
"description": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Game description"
|
|
18
|
+
},
|
|
19
|
+
"version": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+$",
|
|
22
|
+
"description": "Game version (semver)"
|
|
23
|
+
},
|
|
24
|
+
"author": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "Game author/studio"
|
|
27
|
+
},
|
|
28
|
+
"website": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"format": "uri"
|
|
31
|
+
},
|
|
32
|
+
"license": {
|
|
33
|
+
"type": "string"
|
|
34
|
+
},
|
|
35
|
+
"consoleVersion": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"description": "Target console/runtime version"
|
|
38
|
+
},
|
|
39
|
+
"supportedConsoleVersions": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "Semver range of supported console versions",
|
|
42
|
+
"examples": [">=1.0.0 <2.0.0"]
|
|
43
|
+
},
|
|
44
|
+
"initialZones": {
|
|
45
|
+
"type": "array",
|
|
46
|
+
"items": { "type": "string" },
|
|
47
|
+
"minItems": 1,
|
|
48
|
+
"description": "Starting zone(s) for new game"
|
|
49
|
+
},
|
|
50
|
+
"modes": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"items": { "type": "string" },
|
|
53
|
+
"description": "Available game modes"
|
|
54
|
+
},
|
|
55
|
+
"maps": {
|
|
56
|
+
"type": "array",
|
|
57
|
+
"items": { "type": "string" },
|
|
58
|
+
"description": "Map/zone IDs included in package"
|
|
59
|
+
},
|
|
60
|
+
"tilesets": {
|
|
61
|
+
"type": "array",
|
|
62
|
+
"items": { "type": "string" },
|
|
63
|
+
"description": "Tileset IDs included in package"
|
|
64
|
+
},
|
|
65
|
+
"sprites": {
|
|
66
|
+
"type": "array",
|
|
67
|
+
"items": { "type": "string" },
|
|
68
|
+
"description": "Sprite IDs included in package"
|
|
69
|
+
},
|
|
70
|
+
"models": {
|
|
71
|
+
"type": "array",
|
|
72
|
+
"items": { "type": "string" },
|
|
73
|
+
"description": "3D model IDs included in package"
|
|
74
|
+
},
|
|
75
|
+
"textures": {
|
|
76
|
+
"type": "array",
|
|
77
|
+
"items": { "type": "string" },
|
|
78
|
+
"description": "Texture paths included in package"
|
|
79
|
+
},
|
|
80
|
+
"audio": {
|
|
81
|
+
"type": "array",
|
|
82
|
+
"items": { "type": "string" },
|
|
83
|
+
"description": "Audio file paths included in package"
|
|
84
|
+
},
|
|
85
|
+
"shaders": {
|
|
86
|
+
"type": "array",
|
|
87
|
+
"items": { "type": "string" },
|
|
88
|
+
"description": "Custom shader IDs"
|
|
89
|
+
},
|
|
90
|
+
"scripts": {
|
|
91
|
+
"type": "array",
|
|
92
|
+
"items": { "type": "string" },
|
|
93
|
+
"description": "Script file paths"
|
|
94
|
+
},
|
|
95
|
+
"cutscenes": {
|
|
96
|
+
"type": "array",
|
|
97
|
+
"items": { "type": "string" },
|
|
98
|
+
"description": "Cutscene definition paths"
|
|
99
|
+
},
|
|
100
|
+
"callbacks": {
|
|
101
|
+
"type": "array",
|
|
102
|
+
"items": { "type": "string" },
|
|
103
|
+
"description": "Callback script paths"
|
|
104
|
+
},
|
|
105
|
+
"triggers": {
|
|
106
|
+
"type": "array",
|
|
107
|
+
"items": { "type": "string" },
|
|
108
|
+
"description": "Trigger script paths"
|
|
109
|
+
},
|
|
110
|
+
"thumbnail": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"description": "Path to game thumbnail image"
|
|
113
|
+
},
|
|
114
|
+
"icon": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"description": "Path to game icon"
|
|
117
|
+
},
|
|
118
|
+
"splash": {
|
|
119
|
+
"type": "string",
|
|
120
|
+
"description": "Path to splash screen image"
|
|
121
|
+
},
|
|
122
|
+
"settings": {
|
|
123
|
+
"type": "object",
|
|
124
|
+
"description": "Default game settings",
|
|
125
|
+
"properties": {
|
|
126
|
+
"resolution": {
|
|
127
|
+
"type": "array",
|
|
128
|
+
"items": { "type": "integer" },
|
|
129
|
+
"minItems": 2,
|
|
130
|
+
"maxItems": 2
|
|
131
|
+
},
|
|
132
|
+
"fullscreen": { "type": "boolean" },
|
|
133
|
+
"musicVolume": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
134
|
+
"sfxVolume": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
135
|
+
"language": { "type": "string" }
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"saveConfig": {
|
|
139
|
+
"type": "object",
|
|
140
|
+
"description": "Save system configuration",
|
|
141
|
+
"properties": {
|
|
142
|
+
"slots": {
|
|
143
|
+
"type": "integer",
|
|
144
|
+
"minimum": 1,
|
|
145
|
+
"maximum": 99,
|
|
146
|
+
"default": 3
|
|
147
|
+
},
|
|
148
|
+
"autosave": {
|
|
149
|
+
"type": "boolean",
|
|
150
|
+
"default": true
|
|
151
|
+
},
|
|
152
|
+
"autosaveInterval": {
|
|
153
|
+
"type": "integer",
|
|
154
|
+
"description": "Autosave interval in seconds",
|
|
155
|
+
"default": 300
|
|
156
|
+
},
|
|
157
|
+
"quicksave": {
|
|
158
|
+
"type": "boolean",
|
|
159
|
+
"default": true
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"compatibleSaves": {
|
|
164
|
+
"type": "array",
|
|
165
|
+
"items": { "type": "string" },
|
|
166
|
+
"description": "Game IDs whose saves can be imported"
|
|
167
|
+
},
|
|
168
|
+
"portableItems": {
|
|
169
|
+
"type": "array",
|
|
170
|
+
"items": { "type": "string" },
|
|
171
|
+
"description": "Item IDs that can be transferred between compatible games"
|
|
172
|
+
},
|
|
173
|
+
"multiplayer": {
|
|
174
|
+
"type": "object",
|
|
175
|
+
"properties": {
|
|
176
|
+
"enabled": { "type": "boolean", "default": false },
|
|
177
|
+
"maxPlayers": { "type": "integer", "minimum": 2 },
|
|
178
|
+
"serverUrl": { "type": "string", "format": "uri" }
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
"controls": {
|
|
182
|
+
"type": "object",
|
|
183
|
+
"description": "Default control mappings",
|
|
184
|
+
"properties": {
|
|
185
|
+
"keyboard": { "type": "object" },
|
|
186
|
+
"gamepad": { "type": "object" },
|
|
187
|
+
"touch": { "type": "object" }
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
"requirements": {
|
|
191
|
+
"type": "object",
|
|
192
|
+
"description": "System requirements",
|
|
193
|
+
"properties": {
|
|
194
|
+
"webgl": { "type": "integer", "enum": [1, 2] },
|
|
195
|
+
"audio": { "type": "boolean" },
|
|
196
|
+
"localStorage": { "type": "boolean" },
|
|
197
|
+
"indexedDB": { "type": "boolean" }
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"data": {
|
|
201
|
+
"type": "object",
|
|
202
|
+
"description": "Custom manifest data",
|
|
203
|
+
"additionalProperties": true
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://pixospritz.dev/schemas/map.schema.json",
|
|
4
|
+
"title": "PixoSpritz Map Definition",
|
|
5
|
+
"description": "Schema for map/zone definition files",
|
|
6
|
+
"type": "object",
|
|
7
|
+
|
|
8
|
+
"required": ["tileset", "bounds"],
|
|
9
|
+
|
|
10
|
+
"properties": {
|
|
11
|
+
"id": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "Unique map identifier"
|
|
14
|
+
},
|
|
15
|
+
"name": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Display name for the map"
|
|
18
|
+
},
|
|
19
|
+
"extends": {
|
|
20
|
+
"type": "array",
|
|
21
|
+
"items": { "type": "string" },
|
|
22
|
+
"description": "Parent maps to inherit from"
|
|
23
|
+
},
|
|
24
|
+
"tileset": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "Tileset ID to use for this map"
|
|
27
|
+
},
|
|
28
|
+
"bounds": {
|
|
29
|
+
"type": "array",
|
|
30
|
+
"items": { "type": "integer" },
|
|
31
|
+
"minItems": 4,
|
|
32
|
+
"maxItems": 4,
|
|
33
|
+
"description": "[minX, minY, maxX, maxY] tile coordinates"
|
|
34
|
+
},
|
|
35
|
+
"tileSize": {
|
|
36
|
+
"type": "array",
|
|
37
|
+
"items": { "type": "integer", "minimum": 1 },
|
|
38
|
+
"minItems": 2,
|
|
39
|
+
"maxItems": 2,
|
|
40
|
+
"default": [16, 16],
|
|
41
|
+
"description": "[width, height] of tiles in pixels"
|
|
42
|
+
},
|
|
43
|
+
"layers": {
|
|
44
|
+
"type": "array",
|
|
45
|
+
"description": "Map layers from bottom to top",
|
|
46
|
+
"items": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"required": ["id", "type"],
|
|
49
|
+
"properties": {
|
|
50
|
+
"id": { "type": "string" },
|
|
51
|
+
"name": { "type": "string" },
|
|
52
|
+
"type": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"enum": ["tile", "object", "collision", "trigger"]
|
|
55
|
+
},
|
|
56
|
+
"visible": { "type": "boolean", "default": true },
|
|
57
|
+
"opacity": { "type": "number", "minimum": 0, "maximum": 1, "default": 1 },
|
|
58
|
+
"data": {
|
|
59
|
+
"type": "array",
|
|
60
|
+
"description": "2D array of tile indices or objects"
|
|
61
|
+
},
|
|
62
|
+
"offset": {
|
|
63
|
+
"type": "array",
|
|
64
|
+
"items": { "type": "number" },
|
|
65
|
+
"minItems": 2,
|
|
66
|
+
"maxItems": 3
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"tiles": {
|
|
72
|
+
"type": "object",
|
|
73
|
+
"description": "Tile placement data by position key",
|
|
74
|
+
"additionalProperties": {
|
|
75
|
+
"type": "object",
|
|
76
|
+
"properties": {
|
|
77
|
+
"tileId": { "type": "integer" },
|
|
78
|
+
"rotation": { "type": "integer" },
|
|
79
|
+
"flip": { "type": "string", "enum": ["none", "h", "v", "hv"] },
|
|
80
|
+
"layer": { "type": "integer" }
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"objects": {
|
|
85
|
+
"type": "array",
|
|
86
|
+
"description": "Placed objects/sprites",
|
|
87
|
+
"items": {
|
|
88
|
+
"type": "object",
|
|
89
|
+
"required": ["id", "type", "position"],
|
|
90
|
+
"properties": {
|
|
91
|
+
"id": { "type": "string" },
|
|
92
|
+
"type": { "type": "string" },
|
|
93
|
+
"sprite": { "type": "string" },
|
|
94
|
+
"position": {
|
|
95
|
+
"type": "array",
|
|
96
|
+
"items": { "type": "number" },
|
|
97
|
+
"minItems": 3,
|
|
98
|
+
"maxItems": 3
|
|
99
|
+
},
|
|
100
|
+
"rotation": { "type": "number" },
|
|
101
|
+
"scale": {
|
|
102
|
+
"type": "array",
|
|
103
|
+
"items": { "type": "number" },
|
|
104
|
+
"minItems": 3,
|
|
105
|
+
"maxItems": 3
|
|
106
|
+
},
|
|
107
|
+
"data": { "type": "object" }
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"lights": {
|
|
112
|
+
"type": "array",
|
|
113
|
+
"description": "Light sources in the map",
|
|
114
|
+
"items": {
|
|
115
|
+
"type": "object",
|
|
116
|
+
"required": ["id", "pos"],
|
|
117
|
+
"properties": {
|
|
118
|
+
"id": { "type": "string" },
|
|
119
|
+
"type": {
|
|
120
|
+
"type": "string",
|
|
121
|
+
"enum": ["point", "directional", "spot", "ambient"],
|
|
122
|
+
"default": "point"
|
|
123
|
+
},
|
|
124
|
+
"pos": {
|
|
125
|
+
"type": "array",
|
|
126
|
+
"items": { "type": "number" },
|
|
127
|
+
"minItems": 3,
|
|
128
|
+
"maxItems": 3
|
|
129
|
+
},
|
|
130
|
+
"color": {
|
|
131
|
+
"type": "array",
|
|
132
|
+
"items": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
133
|
+
"minItems": 3,
|
|
134
|
+
"maxItems": 3,
|
|
135
|
+
"default": [1, 1, 1]
|
|
136
|
+
},
|
|
137
|
+
"intensity": { "type": "number", "minimum": 0, "default": 1 },
|
|
138
|
+
"range": { "type": "number", "minimum": 0 },
|
|
139
|
+
"angle": { "type": "number", "description": "Spot light cone angle in radians" },
|
|
140
|
+
"castShadow": { "type": "boolean", "default": false }
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"triggers": {
|
|
145
|
+
"type": "array",
|
|
146
|
+
"description": "Trigger zones",
|
|
147
|
+
"items": {
|
|
148
|
+
"type": "object",
|
|
149
|
+
"required": ["id", "bounds"],
|
|
150
|
+
"properties": {
|
|
151
|
+
"id": { "type": "string" },
|
|
152
|
+
"bounds": {
|
|
153
|
+
"type": "array",
|
|
154
|
+
"items": { "type": "number" },
|
|
155
|
+
"minItems": 4,
|
|
156
|
+
"maxItems": 6,
|
|
157
|
+
"description": "[x, y, w, h] or [x, y, z, w, h, d]"
|
|
158
|
+
},
|
|
159
|
+
"event": { "type": "string" },
|
|
160
|
+
"script": { "type": "string" },
|
|
161
|
+
"once": { "type": "boolean", "default": false },
|
|
162
|
+
"active": { "type": "boolean", "default": true }
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"scripts": {
|
|
167
|
+
"type": "array",
|
|
168
|
+
"description": "Map-level scripts",
|
|
169
|
+
"items": {
|
|
170
|
+
"type": "object",
|
|
171
|
+
"properties": {
|
|
172
|
+
"id": { "type": "string" },
|
|
173
|
+
"trigger": { "type": "string" },
|
|
174
|
+
"script": { "type": "string" },
|
|
175
|
+
"params": { "type": "object" }
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"connections": {
|
|
180
|
+
"type": "array",
|
|
181
|
+
"description": "Zone transitions",
|
|
182
|
+
"items": {
|
|
183
|
+
"type": "object",
|
|
184
|
+
"required": ["target", "position"],
|
|
185
|
+
"properties": {
|
|
186
|
+
"id": { "type": "string" },
|
|
187
|
+
"target": { "type": "string", "description": "Target zone ID" },
|
|
188
|
+
"position": {
|
|
189
|
+
"type": "array",
|
|
190
|
+
"items": { "type": "number" },
|
|
191
|
+
"minItems": 3,
|
|
192
|
+
"maxItems": 3,
|
|
193
|
+
"description": "Spawn position in target zone"
|
|
194
|
+
},
|
|
195
|
+
"triggerBounds": {
|
|
196
|
+
"type": "array",
|
|
197
|
+
"items": { "type": "number" },
|
|
198
|
+
"minItems": 4,
|
|
199
|
+
"maxItems": 4
|
|
200
|
+
},
|
|
201
|
+
"transition": { "type": "string" },
|
|
202
|
+
"facing": { "type": "integer" }
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
"camera": {
|
|
207
|
+
"type": "object",
|
|
208
|
+
"description": "Camera settings for this map",
|
|
209
|
+
"properties": {
|
|
210
|
+
"mode": {
|
|
211
|
+
"type": "string",
|
|
212
|
+
"enum": ["follow", "fixed", "rail"],
|
|
213
|
+
"default": "follow"
|
|
214
|
+
},
|
|
215
|
+
"bounds": {
|
|
216
|
+
"type": "array",
|
|
217
|
+
"items": { "type": "number" },
|
|
218
|
+
"minItems": 4,
|
|
219
|
+
"maxItems": 6
|
|
220
|
+
},
|
|
221
|
+
"defaultPosition": {
|
|
222
|
+
"type": "array",
|
|
223
|
+
"items": { "type": "number" },
|
|
224
|
+
"minItems": 3,
|
|
225
|
+
"maxItems": 3
|
|
226
|
+
},
|
|
227
|
+
"defaultTarget": {
|
|
228
|
+
"type": "array",
|
|
229
|
+
"items": { "type": "number" },
|
|
230
|
+
"minItems": 3,
|
|
231
|
+
"maxItems": 3
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"skybox": {
|
|
236
|
+
"type": "string",
|
|
237
|
+
"description": "Skybox shader or texture ID"
|
|
238
|
+
},
|
|
239
|
+
"ambient": {
|
|
240
|
+
"type": "object",
|
|
241
|
+
"properties": {
|
|
242
|
+
"color": {
|
|
243
|
+
"type": "array",
|
|
244
|
+
"items": { "type": "number" },
|
|
245
|
+
"minItems": 3,
|
|
246
|
+
"maxItems": 3
|
|
247
|
+
},
|
|
248
|
+
"intensity": { "type": "number" }
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
"fog": {
|
|
252
|
+
"type": "object",
|
|
253
|
+
"properties": {
|
|
254
|
+
"color": {
|
|
255
|
+
"type": "array",
|
|
256
|
+
"items": { "type": "number" },
|
|
257
|
+
"minItems": 3,
|
|
258
|
+
"maxItems": 3
|
|
259
|
+
},
|
|
260
|
+
"near": { "type": "number" },
|
|
261
|
+
"far": { "type": "number" }
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
"music": {
|
|
265
|
+
"type": "string",
|
|
266
|
+
"description": "Background music track ID"
|
|
267
|
+
},
|
|
268
|
+
"ambientSound": {
|
|
269
|
+
"type": "string",
|
|
270
|
+
"description": "Ambient sound loop ID"
|
|
271
|
+
},
|
|
272
|
+
"data": {
|
|
273
|
+
"type": "object",
|
|
274
|
+
"description": "Custom map data",
|
|
275
|
+
"additionalProperties": true
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|