anxiety/scripts/game/About.js

75 lines
1.2 KiB
JavaScript
Raw Normal View History

2019-04-30 15:20:45 +00:00
window.About = {};
2019-05-03 16:13:22 +00:00
Loader.addSounds([
{ id:"yelp", src:"sounds/sfx/yelp.mp3" }
]);
2019-04-29 19:19:44 +00:00
(function(){
2019-04-30 15:20:45 +00:00
// The About Button
2019-09-06 20:25:14 +00:00
var aboutDOM = $("#about");
2019-04-30 15:20:45 +00:00
2019-09-07 21:19:53 +00:00
$("#huh").onclick = function(){
2019-04-30 15:20:45 +00:00
aboutDOM.setAttribute("about","yes");
aboutDOM.style.top = "40px";
// Hi
About.showing = true;
Game.pause();
};
$("#close_about").onclick = function(){
2019-05-03 16:13:22 +00:00
sfx("ui_click");
2019-04-30 15:20:45 +00:00
aboutDOM.style.top = "";
//aboutDOM.setAttribute("about","yes");
// Bye
About.showing = false;
};
// SHOW END
2019-09-07 21:19:53 +00:00
subscribe("THE_END", function(){
2019-04-30 15:20:45 +00:00
// Hi
About.showing = true;
Game.pause();
aboutDOM.removeAttribute("about");
2019-09-09 16:37:58 +00:00
aboutDOM.style.top = "0px"; // to TOP.
2019-05-05 19:56:00 +00:00
// Sound
Howler.mute(false);
sfx("rustle");
2019-09-09 16:37:58 +00:00
music('campus', {volume:0.5, fade:1}); // aw yeah
2019-05-05 19:56:00 +00:00
2019-04-30 15:20:45 +00:00
});
// Replay
$("#replay").onclick = function(){
2019-05-03 16:13:22 +00:00
// UI/SCREAM SOUNDS
2019-05-05 19:56:00 +00:00
stopAllSounds();
2019-09-09 16:37:58 +00:00
//sfx("yelp");
sfx("pop");
2019-04-30 15:20:45 +00:00
// Cut out
aboutDOM.style.top = "";
aboutDOM.style.display = "none";
setTimeout(function(){
aboutDOM.style.display = "block";
},100);
// Bye
About.showing = false;
// Back to the beginning! (after a second)
setTimeout(function(){
publish("START_GAME");
}, 1000);
};
2019-04-29 19:19:44 +00:00
})();