- Implemented `MissingStickmanPlaceholder` class to visually indicate missing stickman assets in the scene. - Created `StageSceneIO` class for handling JSON serialization and deserialization of stage documents, including encoding and decoding of actions and rules. - Added tests for vector handling, rule encoding/decoding, safe file writing, root validation, and handling of missing assets. - Introduced a new stickman asset file `bad.stk` for testing purposes. - Enhanced test coverage for phase 5 file features, ensuring robust handling of scene data and missing assets.
489 lines
7.1 KiB
Plaintext
489 lines
7.1 KiB
Plaintext
{
|
|
"version": "1.0",
|
|
"scene_name": "Basic Scene",
|
|
"camera": {
|
|
"position": {
|
|
"x": 0.0,
|
|
"y": -400.0
|
|
},
|
|
"zoom": 0.5
|
|
},
|
|
"objects": [
|
|
{
|
|
"file_id": "terrain_1",
|
|
"type": "terrain",
|
|
"position": {
|
|
"x": -1920.0,
|
|
"y": 640.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "ground",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
}
|
|
},
|
|
{
|
|
"file_id": "terrain_2",
|
|
"type": "terrain",
|
|
"position": {
|
|
"x": -1728.0,
|
|
"y": 640.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "ground",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
}
|
|
},
|
|
{
|
|
"file_id": "terrain_3",
|
|
"type": "terrain",
|
|
"position": {
|
|
"x": -1536.0,
|
|
"y": 640.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "ground",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
}
|
|
},
|
|
{
|
|
"file_id": "terrain_4",
|
|
"type": "terrain",
|
|
"position": {
|
|
"x": -1344.0,
|
|
"y": 640.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "ground",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
}
|
|
},
|
|
{
|
|
"file_id": "terrain_5",
|
|
"type": "terrain",
|
|
"position": {
|
|
"x": -1152.0,
|
|
"y": 640.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "ground",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
}
|
|
},
|
|
{
|
|
"file_id": "terrain_6",
|
|
"type": "terrain",
|
|
"position": {
|
|
"x": -960.0,
|
|
"y": 640.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "ground",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
}
|
|
},
|
|
{
|
|
"file_id": "terrain_7",
|
|
"type": "terrain",
|
|
"position": {
|
|
"x": -768.0,
|
|
"y": 640.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "ground",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
}
|
|
},
|
|
{
|
|
"file_id": "terrain_8",
|
|
"type": "terrain",
|
|
"position": {
|
|
"x": -576.0,
|
|
"y": 640.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "ground",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
}
|
|
},
|
|
{
|
|
"file_id": "terrain_9",
|
|
"type": "terrain",
|
|
"position": {
|
|
"x": -384.0,
|
|
"y": 640.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "ground",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
}
|
|
},
|
|
{
|
|
"file_id": "terrain_10",
|
|
"type": "terrain",
|
|
"position": {
|
|
"x": -192.0,
|
|
"y": 640.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "ground",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
}
|
|
},
|
|
{
|
|
"file_id": "terrain_11",
|
|
"type": "terrain",
|
|
"position": {
|
|
"x": 0.0,
|
|
"y": 640.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "ground",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
}
|
|
},
|
|
{
|
|
"file_id": "terrain_12",
|
|
"type": "terrain",
|
|
"position": {
|
|
"x": 192.0,
|
|
"y": 640.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "ground",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
}
|
|
},
|
|
{
|
|
"file_id": "terrain_13",
|
|
"type": "terrain",
|
|
"position": {
|
|
"x": 384.0,
|
|
"y": 640.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "ground",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
}
|
|
},
|
|
{
|
|
"file_id": "terrain_14",
|
|
"type": "terrain",
|
|
"position": {
|
|
"x": 576.0,
|
|
"y": 640.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "ground",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
}
|
|
},
|
|
{
|
|
"file_id": "terrain_15",
|
|
"type": "terrain",
|
|
"position": {
|
|
"x": 768.0,
|
|
"y": 640.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "ground",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
}
|
|
},
|
|
{
|
|
"file_id": "terrain_16",
|
|
"type": "terrain",
|
|
"position": {
|
|
"x": 960.0,
|
|
"y": 640.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "ground",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
}
|
|
},
|
|
{
|
|
"file_id": "terrain_17",
|
|
"type": "terrain",
|
|
"position": {
|
|
"x": 1280.0,
|
|
"y": 512.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "step",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
}
|
|
},
|
|
{
|
|
"file_id": "terrain_18",
|
|
"type": "terrain",
|
|
"position": {
|
|
"x": 1536.0,
|
|
"y": 256.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "step",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
}
|
|
},
|
|
{
|
|
"file_id": "terrain_19",
|
|
"type": "terrain",
|
|
"position": {
|
|
"x": 1792.0,
|
|
"y": 0.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "step",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
}
|
|
},
|
|
{
|
|
"file_id": "terrain_20",
|
|
"type": "terrain",
|
|
"position": {
|
|
"x": 2048.0,
|
|
"y": -256.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "step",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
}
|
|
},
|
|
{
|
|
"file_id": "terrain_21",
|
|
"type": "terrain",
|
|
"position": {
|
|
"x": 2304.0,
|
|
"y": -512.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "step",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
}
|
|
},
|
|
{
|
|
"file_id": "terrain_22",
|
|
"type": "terrain",
|
|
"position": {
|
|
"x": 2560.0,
|
|
"y": -768.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "step",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
}
|
|
},
|
|
{
|
|
"file_id": "stickman_1",
|
|
"type": "stickman",
|
|
"position": {
|
|
"x": -1312.0,
|
|
"y": 255.0
|
|
},
|
|
"rotation": 0.0,
|
|
"stk_path": "res://stickmen/break.stk",
|
|
"facing_profile": "FORWARD",
|
|
"action_queue": [
|
|
{
|
|
"type": "walk_to",
|
|
"target": {
|
|
"x": 1004.0,
|
|
"y": 600.0
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"file_id": "prop_1",
|
|
"type": "prop",
|
|
"position": {
|
|
"x": -1536.0,
|
|
"y": -768.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "ball",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
},
|
|
"material_preset": 2
|
|
},
|
|
{
|
|
"file_id": "prop_2",
|
|
"type": "prop",
|
|
"position": {
|
|
"x": -928.0,
|
|
"y": -1120.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "ball",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
},
|
|
"material_preset": 2
|
|
},
|
|
{
|
|
"file_id": "prop_3",
|
|
"type": "prop",
|
|
"position": {
|
|
"x": -1184.0,
|
|
"y": -512.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "ball",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
},
|
|
"material_preset": 2
|
|
},
|
|
{
|
|
"file_id": "prop_4",
|
|
"type": "prop",
|
|
"position": {
|
|
"x": -128.0,
|
|
"y": -1280.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "ball",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
},
|
|
"material_preset": 2
|
|
},
|
|
{
|
|
"file_id": "prop_5",
|
|
"type": "prop",
|
|
"position": {
|
|
"x": 512.0,
|
|
"y": -1696.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "ball",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
},
|
|
"material_preset": 2
|
|
},
|
|
{
|
|
"file_id": "prop_6",
|
|
"type": "prop",
|
|
"position": {
|
|
"x": 864.0,
|
|
"y": -1440.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "ball",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
},
|
|
"material_preset": 2
|
|
},
|
|
{
|
|
"file_id": "prop_7",
|
|
"type": "prop",
|
|
"position": {
|
|
"x": 1248.0,
|
|
"y": -1728.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "ball",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
},
|
|
"material_preset": 2
|
|
},
|
|
{
|
|
"file_id": "prop_8",
|
|
"type": "prop",
|
|
"position": {
|
|
"x": 1632.0,
|
|
"y": -1408.0
|
|
},
|
|
"rotation": 0.0,
|
|
"asset_id": "ball",
|
|
"scale": {
|
|
"x": 1.0,
|
|
"y": 1.0
|
|
},
|
|
"material_preset": 2
|
|
}
|
|
],
|
|
"event_rules": [
|
|
{
|
|
"id": 0,
|
|
"trigger": {
|
|
"type": "collided",
|
|
"source_id": "stickman_1",
|
|
"target_id": "prop_3",
|
|
"params": {}
|
|
},
|
|
"actions": [
|
|
{
|
|
"type": "speak",
|
|
"target_id": "stickman_1",
|
|
"params": {
|
|
"text": "Ouch Man!",
|
|
"duration": 2.0,
|
|
"stop_current": false
|
|
}
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"created_unix": 1789411529,
|
|
"modified_unix": 1789412438.352,
|
|
"autosave": false,
|
|
"source_path": ""
|
|
}
|
|
} |