Files
tianshu-engine/public/scenes/demo.json
cocos02 937e45c203 feat: P1 core - seamless video switching, conditional branches, save/load
- VideoManager: A/B dual-buffered video with crossfade transitions and candidate preloading
- Engine: condition-based choice filtering, ChoiceSystem timer, resumeScene for save/load
- SceneManager: getCandidateUrls for preloading next scenes
- SaveSystem: Dexie.js IndexedDB multi-slot save/load
- ChoiceSystem: timed choices with countdown and auto-default on timeout
- GamePlayer: dual video elements with crossfade CSS
- ChoicePanel: timer progress bar and countdown text
- SaveLoadMenu: save/load UI component
- App.vue: menu trigger, dual video refs, save/load integration
- gameStore: timer state, saves list
- demo.json: conditional choice example (secret ending, requires trust >= 80)
- ROADMAP: mark P1 as completed
2026-06-07 16:48:52 +08:00

102 lines
2.4 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"startScene": "intro",
"variables": {
"trust": 50,
"courage": 0
},
"scenes": {
"intro": {
"id": "intro",
"videoUrl": "/videos/intro.mp4",
"choices": [
{
"text": "走向左边那扇发光的门",
"targetScene": "left_door",
"effects": [
{ "type": "add", "target": "courage", "value": 10 }
]
},
{
"text": "走向右边那扇普通的门",
"targetScene": "right_door",
"effects": [
{ "type": "add", "target": "courage", "value": -5 }
]
},
{
"text": "留在原地,什么也不做",
"targetScene": "stay"
}
]
},
"left_door": {
"id": "left_door",
"videoUrl": "/videos/left_door.mp4",
"choices": [
{
"text": "与陌生人握手",
"targetScene": "trust_ending",
"effects": [
{ "type": "add", "target": "trust", "value": 30 }
]
},
{
"text": "拒绝握手,保持警惕",
"targetScene": "alone_ending"
}
]
},
"right_door": {
"id": "right_door",
"videoUrl": "/videos/right_door.mp4",
"choices": [
{
"text": "继续前进",
"targetScene": "continue_ending"
},
{
"text": "回头",
"targetScene": "intro"
}
]
},
"stay": {
"id": "stay",
"videoUrl": "/videos/stay.mp4",
"nextScene": "alone_ending"
},
"trust_ending": {
"id": "trust_ending",
"videoUrl": "/videos/trust_ending.mp4",
"choices": [
{
"text": "开启信任的旅程(需要 trust >= 80",
"targetScene": "secret_ending",
"conditions": [
{ "variable": "trust", "op": ">=", "value": 80 }
]
},
{
"text": "离开这里",
"targetScene": "alone_ending"
}
]
},
"secret_ending": {
"id": "secret_ending",
"videoUrl": "/videos/continue_ending.mp4",
"choices": []
},
"alone_ending": {
"id": "alone_ending",
"videoUrl": "/videos/alone_ending.mp4",
"choices": []
},
"continue_ending": {
"id": "continue_ending",
"videoUrl": "/videos/continue_ending.mp4",
"choices": []
}
}
}