diff --git a/level/Boss.js b/level/Boss.js index b9b4df3..c7ac137 100644 --- a/level/Boss.js +++ b/level/Boss.js @@ -174,6 +174,10 @@ Boss = function(level, x, y, z, mode, dolphin) { flash.alpha = 1-manager/14; + if (!manager) { + SFX.play("explode"); + } + if (flash.timer < 251) { window.setTimeout(doFlash, 30); } diff --git a/level/Dolphin.js b/level/Dolphin.js index 972e597..a95fb7e 100644 --- a/level/Dolphin.js +++ b/level/Dolphin.js @@ -66,6 +66,7 @@ Dolphin = function(level, axis, position, z) { } if (dolphin.colliding("tentacle")) { + SFX.play("bosshit"); dolphin.momentum.x *= -1.3; dolphin.momentum.y *= -1.3; @@ -90,6 +91,12 @@ Dolphin = function(level, axis, position, z) { } else { dolphin.charging = false; } + + if (Input.pressed("dash")) { + SFX.play("dash"); + } else if (Input.released("dash")) { + SFX.stop("dash"); + } } function doFlips() { @@ -245,10 +252,17 @@ Dolphin = function(level, axis, position, z) { if (check != -1) { Memory.global.keys.splice(check, 1); block.position.x = -99999; + block.activeSprite.visible = false; level.saveData.doors[block.index] = true; + SFX.play("key"); + return; } + + SFX.play("door"); + } else if (block) { + SFX.play("wall"); } return block; diff --git a/level/Key.js b/level/Key.js index 8afe4ce..1bd2311 100644 --- a/level/Key.js +++ b/level/Key.js @@ -7,6 +7,7 @@ Key = function(level, x, y, z, index, color) { key.collect = function() { level.saveData.keys[index] = true; Memory.global.keys.push(color); + SFX.play("select"); } if (level.editor) { diff --git a/level/Level.js b/level/Level.js index fccbd7e..2d525ce 100644 --- a/level/Level.js +++ b/level/Level.js @@ -252,6 +252,7 @@ Level = function(levelName) { Memory.storeDolphin(dolphin.axis.current, dolphin.axis.position, dolphin.position.z, dolphin.momentum.x, dolphin.momentum.y); Memory.save(); + SFX.play("save"); var text = Renderer.text("Your adventure has been saved.", 140, 200) level.stage.addChild(text); @@ -305,6 +306,11 @@ Level = function(levelName) { camera.z = dolphin.position.z + camera.fwdY; camera.angle = Math.atan2(dolphin.position.y - camera.y, dolphin.position.x - camera.x) + camera.fwdX; + + if (Input.held("redkey")) { + camera.x += Math.cos(dolphin.angle)*70; + camera.y += Math.sin(dolphin.angle)*70; + } } level.render = function(frames) { diff --git a/level/Rescuee.js b/level/Rescuee.js index c55501c..c4e1a28 100644 --- a/level/Rescuee.js +++ b/level/Rescuee.js @@ -51,6 +51,8 @@ Rescuee = function(level, data, dolphin) { if (rescuee.bubble) { rescuee.bubble.position.x = -99999; rescuee.bubble.activeSprite.visible = false; + + SFX.play("key"); } rescuee.think = cutscene; diff --git a/main/SFX.js b/main/SFX.js index e6dbbbd..7a8e923 100644 --- a/main/SFX.js +++ b/main/SFX.js @@ -2,10 +2,19 @@ SFX = (function() { var S = createjs.Sound; var SFX = {}; - SFX.volume = 1; + SFX.volume = 0.8; var sounds = [ "dash", + "menu", + "select", + "unavailable", + "wall", + "door", + "key", + "save", + "bosshit", + "explode", ]; SFX.init = function() { diff --git a/other/Title.js b/other/Title.js index dac01e6..0ac11b6 100644 --- a/other/Title.js +++ b/other/Title.js @@ -79,29 +79,35 @@ Title = function() { title.menuOption = 0; menu[0].alpha = 1; menu[1].alpha = 0.4; + SFX.play("menu"); } if (Input.pressed("down")) { title.menuOption = 1; menu[1].alpha = 1; menu[0].alpha = 0.4; + SFX.play("menu"); } if (Input.pressed("left")) { Memory.slot = (Memory.slot + 3) % 5 + 1; txt(); + SFX.play("menu"); } if (Input.pressed("right")) { Memory.slot = Memory.slot % 5 + 1; txt(); + SFX.play("menu"); } if (Input.pressed("accept")) { if (title.menuOption == 0 || Memory.file(Memory.slot)) { title.leaving = true; + SFX.play("select"); } else { // Indicate that this isn't possible + SFX.play("unavailable"); } }