hover, die, pickup sounds
This commit is contained in:
parent
db84260f45
commit
db2fd2d3ed
Binary file not shown.
Before Width: | Height: | Size: 14 KiB |
BIN
docs/assets/images/thumb.png
Normal file
BIN
docs/assets/images/thumb.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 101 KiB |
@ -89,7 +89,6 @@ function update() {
|
||||
}
|
||||
|
||||
function draw() {
|
||||
|
||||
// If draw is being called, the user has interacted with the page at least once.
|
||||
// This signal can be used to notify the audio permission handler
|
||||
unlockAudioPermission();
|
||||
|
@ -69,9 +69,12 @@ Player.prototype.update = function() {
|
||||
|
||||
var targetPos = mousePosition();
|
||||
var curLeg = this.getActiveLeg();
|
||||
this.hover.active = false;
|
||||
|
||||
// right
|
||||
if (distanceToLineSegment(this.rightLeg.x, this.rightLeg.y, this.rightLeg.x2, this.rightLeg.y2, targetPos.x, targetPos.y) < constants.player.select_range) {
|
||||
if(this.hover.active === false) {
|
||||
soundAssets.hover.play();
|
||||
}
|
||||
this.hover.active = true;
|
||||
this.hover.leg = "R";
|
||||
if(mousePress[0]) {
|
||||
@ -81,6 +84,9 @@ Player.prototype.update = function() {
|
||||
}
|
||||
//left
|
||||
} else if (distanceToLineSegment(this.leftLeg.x, this.leftLeg.y, this.leftLeg.x2, this.leftLeg.y2, targetPos.x, targetPos.y) < constants.player.select_range) {
|
||||
if(this.hover.active === false) {
|
||||
soundAssets.hover.play();
|
||||
}
|
||||
this.hover.active = true;
|
||||
this.hover.leg = "L";
|
||||
if(mousePress[0]) {
|
||||
@ -88,7 +94,9 @@ Player.prototype.update = function() {
|
||||
this.legSelected = "L";
|
||||
this.hover.active = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.hover.active = false;
|
||||
}
|
||||
}
|
||||
|
||||
// place box
|
||||
|
@ -18,6 +18,7 @@ Objective.prototype.update = function() {
|
||||
for(var j=0;j<50;j++) {
|
||||
Particles.push(new Particle(this.x,this.y));
|
||||
}
|
||||
soundAssets.pickUp.play();
|
||||
this.callback();
|
||||
return true;
|
||||
}
|
||||
|
@ -25,6 +25,8 @@ let soundAssetMap = {
|
||||
"cough": "./assets/sounds/cough.mp3",
|
||||
"dead": "./assets/sounds/dead.mp3",
|
||||
"click": "./assets/sounds/click.mp3",
|
||||
"hover": "./assets/sounds/hover.wav",
|
||||
"pickUp": "./assets/sounds/pickUp.wav",
|
||||
"backingtrack": "./assets/sounds/backingtrack.wav"
|
||||
}
|
||||
|
||||
@ -43,6 +45,8 @@ let soundAssets = {
|
||||
cough: new SoundSnippet("cough", audioAssetType.sfx),
|
||||
dead: new SoundSnippet("dead", audioAssetType.sfx),
|
||||
click: new SoundSnippet("click", audioAssetType.sfx),
|
||||
hover: new SoundSnippet("hover", audioAssetType.sfx),
|
||||
pickUp: new SoundSnippet("pickUp", audioAssetType.sfx),
|
||||
backingtrack: new SoundSnippet("backingtrack", audioAssetType.bgm)
|
||||
}
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
BIN
docs/assets/sounds/pickUp.wav
Normal file
BIN
docs/assets/sounds/pickUp.wav
Normal file
Binary file not shown.
@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<link rel="icon" type="image/gif" href="assets/images/tempIcon.png"/>
|
||||
<title>error: title is undefined</title>
|
||||
<title>Micromanaged Mike</title>
|
||||
<meta charset="utf-8" />
|
||||
<style>
|
||||
html {
|
||||
|
Reference in New Issue
Block a user