Merge pull request #11 from rsninja722/footsteps
Implement footstep sounds when walking
This commit is contained in:
commit
28f77a57e9
@ -44,6 +44,9 @@ Player.prototype.update = function() {
|
|||||||
this.rightLeg.angle += pi;
|
this.rightLeg.angle += pi;
|
||||||
}
|
}
|
||||||
this.shouldMoveLeg = false;
|
this.shouldMoveLeg = false;
|
||||||
|
|
||||||
|
// Play the footstep sound
|
||||||
|
soundAssets.footstep.play();
|
||||||
}
|
}
|
||||||
// deselect
|
// deselect
|
||||||
} else {
|
} else {
|
||||||
|
@ -12,12 +12,14 @@
|
|||||||
// A mapping of asset names to their files
|
// A mapping of asset names to their files
|
||||||
// This exists to give nicer names to files
|
// This exists to give nicer names to files
|
||||||
let soundAssetMap = {
|
let soundAssetMap = {
|
||||||
"debug-ding":"./assets/sounds/debug-ding.mp3"
|
"debug-ding": "./assets/sounds/debug-ding.mp3",
|
||||||
|
"footstep":"./assets/sounds/footstep.mp3"
|
||||||
}
|
}
|
||||||
|
|
||||||
// All available sounds
|
// All available sounds
|
||||||
let soundAssets = {
|
let soundAssets = {
|
||||||
debug_ding: new SoundSnippet("debug-ding", audioAssetType.sfx)
|
debug_ding: new SoundSnippet("debug-ding", audioAssetType.sfx),
|
||||||
|
footstep: new SoundSnippet("footstep", audioAssetType.sfx)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
BIN
docs/assets/sounds/footstep.mp3
Normal file
BIN
docs/assets/sounds/footstep.mp3
Normal file
Binary file not shown.
Reference in New Issue
Block a user