diff --git a/index.html b/index.html index c6bf657..e41af11 100644 --- a/index.html +++ b/index.html @@ -206,8 +206,12 @@ + +
+
+ - +
diff --git a/scripts/game/Game.js b/scripts/game/Game.js index 62c0b4f..3b3c522 100644 --- a/scripts/game/Game.js +++ b/scripts/game/Game.js @@ -29,12 +29,22 @@ window.attackBB = function(damage, type){ // Init Game.init = function(){ + // Create the section debug menu + Object.keys(Game.sections).forEach(function(key){ + const link = document.createElement('div'); + link.className = "section_link"; + link.innerText = key; + link.addEventListener('click', function() { + Game.goto(key); + }); + document.getElementById("section_debug_list").appendChild(link); + }) + // HP! window.HP = new HitPoints(); // Animation! console.log("init"); - Game.wordsDOM.style.top = "80px"; var animloop = function(){ Game.update(); requestAnimationFrame(animloop); @@ -43,6 +53,11 @@ Game.init = function(){ }; +// Call to toggle debug rendering +Game.debug = function(){ + document.body.classList.toggle('show_debug'); +} + // Parse scene markdown! Game.parseSceneMarkdown = function(md){ @@ -293,20 +308,51 @@ Game.immediatePromise = function(){ // Move the text DOM to latest Game.FORCE_TEXT_Y = -1; -Game.WORDS_HEIGHT_BOTTOM = 250; -Game.updateText = function(instant){ - if(Game.WORDS_HEIGHT_BOTTOM<0) Game.WORDS_HEIGHT_BOTTOM=250; // back to default - if(Game.FORCE_TEXT_Y<0){ - var wordsHeight = 80 + Game.wordsDOM.getBoundingClientRect().height; - var currentY = Game.wordsDOM.style.top=="" ? 80 : parseFloat(Game.wordsDOM.style.top); - var gotoY = (wordsHeight