文游简墨文游

景

剧情分支树

从左至右阅读。绿线为默认跳转,褐线为分支选项;点击卡片编辑,点击“试玩”可从该场景开始。 最右侧若出现“未接入”,表示这些场景无法从开篇到达。

剧情编辑

场景与画面

剧情去向

存在分支选项时,玩家必须作出选择。
没有分支选项时,点击“继续”进入默认场景;两者都留空即为结局。

简单示例

当前场景 ID:s1
分支一:“前往天台” → s2
分支二:“离开教室” → s3

先新建 s2、s3,再回来填写跳转即可。

${escapeHTML(id)} ${isStart ? '开篇' : ""} ${isEnding ? '结局' : ""} ${isDisconnected ? '未接入' : ""}
${escapeHTML(shorten(n.text || "空白场景",38))}
`; card.onclick = () => openEditor(id); card.querySelector("[data-play]").onclick = event => { event.stopPropagation(); current = id; showGame(); }; canvas.appendChild(card); }); } function getTargets(node){ const targets = (node.choices || []).map(c => c.next); if(node.next) targets.push(node.next); return targets.filter(Boolean); } function shorten(text,length){ text = String(text).replace(/\s+/g," "); return text.length > length ? text.slice(0,length) + "…" : text; } /* ---------- 编辑器 ---------- */ function openEditor(id = current){ if(!game.nodes[id]) id = game.start; editingId = id; setView("editor"); refreshNodeLists(); fillEditor(); } function refreshNodeLists(){ const ids = Object.keys(game.nodes); const options = ids.map(id => `` ).join(""); $("#nodeSelect").innerHTML = options; $("#startSelect").innerHTML = options; $("#nodeSelect").value = editingId; $("#startSelect").value = game.start; $("#titleInput").value = game.title || ""; $("#nodeIds").innerHTML = ids.map(id => `