Merge pull request #11 from rsninja722/footsteps

Implement footstep sounds when walking
This commit is contained in:
rsninja722 2020-04-18 16:34:44 -04:00 committed by GitHub
commit 28f77a57e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View File

@ -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 {

View File

@ -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)
} }
/** /**

Binary file not shown.