Browse Source

Sounds stop, log clears, and state resets when quitting

tags/v0.1.0
Fen Dweller 6 years ago
parent
commit
d96dc56004
1 changed files with 17 additions and 12 deletions
  1. +17
    -12
      satiate.js

+ 17
- 12
satiate.js View File

@@ -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);


Loading…
Cancel
Save