浏览代码

Sounds stop, log clears, and state resets when quitting

tags/v0.1.0
Fen Dweller 6 年前
父节点
当前提交
d96dc56004
共有 1 个文件被更改,包括 17 次插入12 次删除
  1. +17
    -12
      satiate.js

+ 17
- 12
satiate.js 查看文件

@@ -4,18 +4,7 @@ let activeModal = null;

const version = "pre-alpha";

let state = {
player: {
items: {
keys: [

]
},
rooms: {

}
}
}
let state;

function print(lines) {
(lines.concat([String.fromCharCode(160)])).forEach(line => {
@@ -56,6 +45,9 @@ function openModal(modal) {
}

function returnToStart() {
stopAllSound();
log.innerHTML = "";

document.querySelector("#game").classList.remove("scene");
document.querySelector("#game").classList.add("hidden-scene");
document.querySelector("#pick").classList.remove("hidden-scene");
@@ -65,6 +57,19 @@ function returnToStart() {
// set up the game

function init(story) {
state = {
player: {
items: {
keys: [

]
},
rooms: {

}
}
};
initWorld(story, state);
initAudio(story, state);
initGame(story, state);


正在加载...
取消
保存