summaryrefslogtreecommitdiff
path: root/src/systems/menu.js
diff options
context:
space:
mode:
authorLogan Hunt <loganhunt@simponic.xyz>2022-04-19 16:51:15 -0600
committerLogan Hunt <loganhunt@simponic.xyz>2022-04-19 16:51:15 -0600
commit20b7944602626f19a538e976a57d1d344e10f71b (patch)
tree24896f9fcc4d2095a64e0ae58cd513b88f41e282 /src/systems/menu.js
parent58ceff79496f60969eecb28a767b1ea28292becb (diff)
downloadbbiy-20b7944602626f19a538e976a57d1d344e10f71b.tar.gz
bbiy-20b7944602626f19a538e976a57d1d344e10f71b.zip
Add music/sounds; fix a bug where you could attempt to resume a game when it was won
Diffstat (limited to 'src/systems/menu.js')
-rw-r--r--src/systems/menu.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/systems/menu.js b/src/systems/menu.js
index 629a6a3..abd6748 100644
--- a/src/systems/menu.js
+++ b/src/systems/menu.js
@@ -16,6 +16,7 @@ game.system.Menu = () => {
const bringUpMenu = () => {
game.running = false;
+ game.assets.music.pause();
window.addEventListener("keydown", escapeEventListener);
setState("main");
};
@@ -82,6 +83,10 @@ game.system.Menu = () => {
<br>
Background is from <a href="https://i.pinimg.com/originals/b2/2a/a2/b22aa22b2f3f55b6468361158d52e2e7.gif">PinImg</a>.
<br>
+ Music is <a href="https://www.youtube.com/watch?v=yQjAF3frudY">Fluffing A Duck</a> by Kevin MacLeod.
+ <br>
+ Other sound effects generated on <a href="https://www.sfxr.me/">SFXR</a>.
+ <br>
Developed by Logan Hunt, Ethan Payne
</p>
</div>
@@ -97,7 +102,9 @@ game.system.Menu = () => {
}
`;
}
- menuElement.innerHTML += "<div class='menu-button' onclick='game.systems.menu.hide()'>Resume Game</div>";
+ if (!game.win) {
+ menuElement.innerHTML += "<div class='menu-button' onclick='game.systems.menu.hide()'>Resume Game</div>";
+ }
if (state !== "main") {
menuElement.innerHTML += "<div class='menu-button' onclick='game.systems.menu.setState(\"main\")'>Back</div>";
}