Add all of the SFX wheeeeeee
This commit is contained in:
parent
8f73970f16
commit
753f3b7ec5
7 changed files with 43 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
11
main/SFX.js
11
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() {
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue