Implement footstep sounds when walking
This commit is contained in:
parent
0c42644466
commit
0cae24deb8
@ -44,6 +44,9 @@ Player.prototype.update = function() {
|
||||
this.rightLeg.angle += pi;
|
||||
}
|
||||
this.shouldMoveLeg = false;
|
||||
|
||||
// Play the footstep sound
|
||||
soundAssets.footstep.play();
|
||||
}
|
||||
// deselect
|
||||
} else {
|
||||
|
@ -12,12 +12,14 @@
|
||||
// A mapping of asset names to their files
|
||||
// This exists to give nicer names to files
|
||||
let soundAssetMap = {
|
||||
"debug-ding":"./assets/sounds/debug-ding.mp3"
|
||||
"debug-ding": "./assets/sounds/debug-ding.mp3",
|
||||
"footstep":"./assets/sounds/footstep.mp3"
|
||||
}
|
||||
|
||||
// All available sounds
|
||||
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