diff --git a/docs/assets/js/player/player.js b/docs/assets/js/player/player.js index 1d1e94b..a694ae7 100644 --- a/docs/assets/js/player/player.js +++ b/docs/assets/js/player/player.js @@ -47,7 +47,7 @@ Player.prototype.update = function() { this.shouldMoveLeg = false; // Play the footstep sound - soundAssets.footstep.play(); + playRandomFootstep(); } // deselect } else { diff --git a/docs/assets/js/sounds/sounds.js b/docs/assets/js/sounds/sounds.js index 5465ed1..df85a48 100644 --- a/docs/assets/js/sounds/sounds.js +++ b/docs/assets/js/sounds/sounds.js @@ -13,13 +13,32 @@ // This exists to give nicer names to files let soundAssetMap = { "debug-ding": "./assets/sounds/debug-ding.mp3", - "footstep":"./assets/sounds/footstep.mp3" + "footstep1":"./assets/sounds/footsteps/footstep1.mp3", + "footstep2":"./assets/sounds/footsteps/footstep2.mp3", + "footstep3":"./assets/sounds/footsteps/footstep3.mp3", + "footstep4":"./assets/sounds/footsteps/footstep4.mp3", + "footstep5":"./assets/sounds/footsteps/footstep5.mp3", + "footstep6":"./assets/sounds/footsteps/footstep6.mp3" } // All available sounds let soundAssets = { debug_ding: new SoundSnippet("debug-ding", audioAssetType.sfx), - footstep: new SoundSnippet("footstep", audioAssetType.sfx) + footstep1: new SoundSnippet("footstep1", audioAssetType.sfx), + footstep2: new SoundSnippet("footstep2", audioAssetType.sfx), + footstep3: new SoundSnippet("footstep3", audioAssetType.sfx), + footstep4: new SoundSnippet("footstep4", audioAssetType.sfx), + footstep5: new SoundSnippet("footstep5", audioAssetType.sfx), + footstep6: new SoundSnippet("footstep6", audioAssetType.sfx) +} + +/** + * Play a random footstep sound because ReAlIsM + */ +function playRandomFootstep() { + + // There has to be a one-liner somewhere in the game... + [soundAssets.footstep1, soundAssets.footstep2, soundAssets.footstep3, soundAssets.footstep4, soundAssets.footstep5, soundAssets.footstep6][Math.floor(Math.random() * Object.keys(soundAssets).length - 1)].play(); } /** diff --git a/docs/assets/sounds/footstep.mp3 b/docs/assets/sounds/footstep.mp3 deleted file mode 100644 index c9d5a62..0000000 Binary files a/docs/assets/sounds/footstep.mp3 and /dev/null differ diff --git a/docs/assets/sounds/footsteps/footstep1.mp3 b/docs/assets/sounds/footsteps/footstep1.mp3 new file mode 100644 index 0000000..5f37864 Binary files /dev/null and b/docs/assets/sounds/footsteps/footstep1.mp3 differ diff --git a/docs/assets/sounds/footsteps/footstep2.mp3 b/docs/assets/sounds/footsteps/footstep2.mp3 new file mode 100644 index 0000000..7fe07bc Binary files /dev/null and b/docs/assets/sounds/footsteps/footstep2.mp3 differ diff --git a/docs/assets/sounds/footsteps/footstep3.mp3 b/docs/assets/sounds/footsteps/footstep3.mp3 new file mode 100644 index 0000000..68450b9 Binary files /dev/null and b/docs/assets/sounds/footsteps/footstep3.mp3 differ diff --git a/docs/assets/sounds/footsteps/footstep4.mp3 b/docs/assets/sounds/footsteps/footstep4.mp3 new file mode 100644 index 0000000..9ace013 Binary files /dev/null and b/docs/assets/sounds/footsteps/footstep4.mp3 differ diff --git a/docs/assets/sounds/footsteps/footstep5.mp3 b/docs/assets/sounds/footsteps/footstep5.mp3 new file mode 100644 index 0000000..008fd74 Binary files /dev/null and b/docs/assets/sounds/footsteps/footstep5.mp3 differ diff --git a/docs/assets/sounds/footsteps/footstep6.mp3 b/docs/assets/sounds/footsteps/footstep6.mp3 new file mode 100644 index 0000000..0c6db45 Binary files /dev/null and b/docs/assets/sounds/footsteps/footstep6.mp3 differ