diff --git a/docs/assets/js/cutscene/cutscene.js b/docs/assets/js/cutscene/cutscene.js index 59663b7..6cd73a6 100644 --- a/docs/assets/js/cutscene/cutscene.js +++ b/docs/assets/js/cutscene/cutscene.js @@ -29,6 +29,12 @@ function updateCutScene() { vel += 0.1; } } + if(cutTime===52) { + soundAssets.crack.play(); + } + if(cutTime===140) { + soundAssets.crash.play(); + } if (cutTime >= 500) { globalState = globalStates.titleScreen; titleScreenState = "credits"; diff --git a/docs/assets/js/player/lifeFunctions.js b/docs/assets/js/player/lifeFunctions.js index 60a98b2..1d504a8 100644 --- a/docs/assets/js/player/lifeFunctions.js +++ b/docs/assets/js/player/lifeFunctions.js @@ -53,6 +53,11 @@ function updateLife() { } pressure -= 0.1; + if(~~(pressure*10)/10 === 28) { + soundAssets.beep2.play(); + } else if(~~(pressure*10)/10 === 42){ + soundAssets.beep1.play(); + } if (pressure <= 0) { pressure = 0; player.die(); @@ -135,6 +140,11 @@ function heartbeat() { pressure = 100; player.die(); } + if(pressure>75) { + soundAssets.beep2.play(); + } else if(pressure>60){ + soundAssets.beep1.play(); + } heartBeat = true; // Play the heartbeat sound diff --git a/docs/assets/js/player/player.js b/docs/assets/js/player/player.js index 47798b2..a78fe28 100644 --- a/docs/assets/js/player/player.js +++ b/docs/assets/js/player/player.js @@ -81,6 +81,7 @@ Player.prototype.update = function() { this.shouldMoveLeg = true; this.legSelected = "R"; this.hover.active = false; + soundAssets.selectLeg.play(); } //left } else if (distanceToLineSegment(this.leftLeg.x, this.leftLeg.y, this.leftLeg.x2, this.leftLeg.y2, targetPos.x, targetPos.y) < constants.player.select_range) { @@ -93,6 +94,7 @@ Player.prototype.update = function() { this.shouldMoveLeg = true; this.legSelected = "L"; this.hover.active = false; + soundAssets.selectLeg.play(); } } else { this.hover.active = false; @@ -103,6 +105,7 @@ Player.prototype.update = function() { if(this.holdingBox && this.x > -275 && this.y < 100) { this.holdingBox = false; boxOnTable = true; + soundAssets.clonk.play(); } // god mode diff --git a/docs/assets/js/sounds/sounds.js b/docs/assets/js/sounds/sounds.js index 081bcc3..802ceb6 100644 --- a/docs/assets/js/sounds/sounds.js +++ b/docs/assets/js/sounds/sounds.js @@ -27,6 +27,12 @@ let soundAssetMap = { "click": "./assets/sounds/click.mp3", "hover": "./assets/sounds/hover.wav", "pickUp": "./assets/sounds/pickUp.wav", + "selectLeg": "./assets/sounds/selectLeg.mp3", + "crash": "./assets/sounds/crash.mp3", + "crack": "./assets/sounds/crack.mp3", + "clonk": "./assets/sounds/clonk.mp3", + "beep1": "./assets/sounds/beep1.wav", + "beep2": "./assets/sounds/beep2.wav", "backingtrack": "./assets/sounds/backingtrack.wav" } @@ -47,6 +53,12 @@ let soundAssets = { click: new SoundSnippet("click", audioAssetType.sfx), hover: new SoundSnippet("hover", audioAssetType.sfx), pickUp: new SoundSnippet("pickUp", audioAssetType.sfx), + selectLeg: new SoundSnippet("selectLeg", audioAssetType.sfx), + crash: new SoundSnippet("crash", audioAssetType.sfx), + crack: new SoundSnippet("crack", audioAssetType.sfx), + clonk: new SoundSnippet("clonk", audioAssetType.sfx), + beep1: new SoundSnippet("beep1", audioAssetType.sfx), + beep2: new SoundSnippet("beep2", audioAssetType.sfx), backingtrack: new SoundSnippet("backingtrack", audioAssetType.bgm) } diff --git a/docs/assets/js/titleScreen/titleScreen.js b/docs/assets/js/titleScreen/titleScreen.js index 20607a8..89e5012 100644 --- a/docs/assets/js/titleScreen/titleScreen.js +++ b/docs/assets/js/titleScreen/titleScreen.js @@ -68,7 +68,7 @@ function drawTitleScreen() { if (titleScreenState === "main") { img(sprites.backGround, cw / 2, ch / 2); - text("GAME TITLE HERE", 50, 50, "white", 8, 1000); + text("MicroManaged Mike", 100, 70, "white", 6); // rect(415, 200, 300, 50, "green"); img(sprites["buttonBig" + (rectpoint({ x: 400, y: 200, w: 300, h: 50 }, mousePos) ? "Hover" : "")], 400, 200, 0, 2, 2); text("Play!", 340, 185, "#403826", 5, 150); diff --git a/docs/assets/sounds/beep1.wav b/docs/assets/sounds/beep1.wav new file mode 100644 index 0000000..fe7175c Binary files /dev/null and b/docs/assets/sounds/beep1.wav differ diff --git a/docs/assets/sounds/beep2.wav b/docs/assets/sounds/beep2.wav new file mode 100644 index 0000000..f71bc5e Binary files /dev/null and b/docs/assets/sounds/beep2.wav differ diff --git a/docs/assets/sounds/clonk.mp3 b/docs/assets/sounds/clonk.mp3 new file mode 100644 index 0000000..6364820 Binary files /dev/null and b/docs/assets/sounds/clonk.mp3 differ diff --git a/docs/assets/sounds/crack.mp3 b/docs/assets/sounds/crack.mp3 new file mode 100644 index 0000000..bc4e1af Binary files /dev/null and b/docs/assets/sounds/crack.mp3 differ diff --git a/docs/assets/sounds/crash.mp3 b/docs/assets/sounds/crash.mp3 new file mode 100644 index 0000000..57cad64 Binary files /dev/null and b/docs/assets/sounds/crash.mp3 differ diff --git a/docs/assets/sounds/selectLeg.mp3 b/docs/assets/sounds/selectLeg.mp3 new file mode 100644 index 0000000..82e8c35 Binary files /dev/null and b/docs/assets/sounds/selectLeg.mp3 differ