endscreen

This commit is contained in:
Nicky Case 2019-04-26 13:08:31 -04:00
parent e0eb95a468
commit f0b522bb44
6 changed files with 40 additions and 10 deletions

View File

@ -22,6 +22,10 @@
<div id="loading_progress"></div>
<div id="loading_done">play!</div>
</div>
<div id="end_of_demo">
<div id="loading_progress"></div>
<div id="loading_done">play!</div>
</div>
</div>
</body>

View File

@ -2,11 +2,20 @@
`SceneSetup.act1_end()`
(...2000)
n: TOTAL FEARS USED
n: *BEING HARMED:* 3
n: #harm# *BEING HARMED:* 3
n: *BEING UNLOVED:* 1
n: #alone# *BEING UNLOVED:* 1
n: *BEING A BAD PERSON:* 4
n: #bad# *BEING A BAD PERSON:* 4
(...4000)
`Game.clearText()`
(...2000)
`publish("END_OF_DEMO")`

View File

@ -189,7 +189,7 @@ function BG_Act1_Outro(){
}
// NEXT SCENE?
if(frameTicker>=270/30){
if(frameTicker>=320/30){
Game.goto("act1_end");
}

View File

@ -39,5 +39,11 @@ SceneSetup.act1_end = function(){
Game.resetScene();
music(null);
stopAllSounds();
// HACK
Game.FORCE_TEXT_Y = 52;
$("#game_container").style.background = "#000";
$("#game_choices").style.display = "none";
};

View File

@ -226,13 +226,18 @@ Game.immediatePromise = function(){
};
// Move the text DOM to latest
Game.FORCE_TEXT_Y = -1;
Game.updateText = function(instant){
var wordsHeight = 80 + Game.wordsDOM.getBoundingClientRect().height;
var currentY = parseFloat(Game.wordsDOM.style.top) || 80;
var gotoY = (wordsHeight<250) ? 0 : wordsHeight-250;
gotoY = 80 - gotoY;
var nextY = instant ? gotoY : currentY*0.9 + gotoY*0.1;
Game.wordsDOM.style.top = nextY+"px";
if(Game.FORCE_TEXT_Y<0){
var wordsHeight = 80 + Game.wordsDOM.getBoundingClientRect().height;
var currentY = parseFloat(Game.wordsDOM.style.top) || 80;
var gotoY = (wordsHeight<250) ? 0 : wordsHeight-250;
gotoY = 80 - gotoY;
var nextY = instant ? gotoY : currentY*0.9 + gotoY*0.1;
Game.wordsDOM.style.top = nextY+"px";
}else{
Game.wordsDOM.style.top = Game.FORCE_TEXT_Y+"px";
}
};
// CLEAR TEXT

View File

@ -18,6 +18,12 @@ window.sfx = function(sound, options){
};
window.stopAllSounds = function(){
Object.keys(Library.sounds).forEach(function(name){
Library.sounds[name].stop();
});
};
window.voice = function(name, options){
options = options || {};
sfx("voice_"+name, options);