- QTESystem: trigger detection via timeupdate, multi-key matching, timeout handling - QTEOverlay: SVG countdown ring + key prompts + success/fail animation - Engine: integrate QTE (timeupdate check, conditional branching, effect application) - Subtitles: WebVTT parsing + synchronized subtitle rendering - GamePlayer: overlay QTE and subtitle components - SaveSystem: DB v2 with thumbnail field, canvas snapshot at 320x180 JPEG - SaveLoadMenu: thumbnail preview for save slots - VideoManager: getActiveVideoElement() for canvas capture - App.vue: QTE/subtitle integration, thumbnail capture on save - stores: QTE state management, save list with thumbnails - demo.json: QTE scene (right_door), subtitles, new event types - ROADMAP: mark P2 as completed
135 lines
3.3 KiB
JSON
135 lines
3.3 KiB
JSON
{
|
||
"startScene": "intro",
|
||
"variables": {
|
||
"trust": 50,
|
||
"courage": 0
|
||
},
|
||
"scenes": {
|
||
"intro": {
|
||
"id": "intro",
|
||
"videoUrl": "/videos/intro.mp4",
|
||
"subtitleUrl": "/subtitles/intro.vtt",
|
||
"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",
|
||
"subtitleUrl": "/subtitles/left_door.vtt",
|
||
"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",
|
||
"qte": {
|
||
"triggerTime": 1.0,
|
||
"prompt": "躲避飞来的石块!",
|
||
"keys": ["ArrowLeft", "ArrowRight", "a", "d"],
|
||
"timeLimit": 3.0,
|
||
"successScene": "qte_success",
|
||
"failScene": "qte_fail",
|
||
"effects": {
|
||
"success": [{ "type": "add", "target": "courage", "value": 15 }],
|
||
"fail": [{ "type": "add", "target": "trust", "value": -20 }]
|
||
}
|
||
}
|
||
},
|
||
"qte_success": {
|
||
"id": "qte_success",
|
||
"videoUrl": "/videos/qte_success.mp4",
|
||
"choices": [
|
||
{
|
||
"text": "继续前进",
|
||
"targetScene": "continue_ending"
|
||
},
|
||
{
|
||
"text": "回头",
|
||
"targetScene": "intro"
|
||
}
|
||
]
|
||
},
|
||
"qte_fail": {
|
||
"id": "qte_fail",
|
||
"videoUrl": "/videos/qte_fail.mp4",
|
||
"choices": [
|
||
{
|
||
"text": "继续前进",
|
||
"targetScene": "continue_ending"
|
||
},
|
||
{
|
||
"text": "回头",
|
||
"targetScene": "intro"
|
||
}
|
||
]
|
||
},
|
||
"stay": {
|
||
"id": "stay",
|
||
"videoUrl": "/videos/stay.mp4",
|
||
"subtitleUrl": "/subtitles/stay.vtt",
|
||
"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": []
|
||
}
|
||
}
|
||
}
|