From fdfa8561fbc884418bffa424876eb0e4e6756ecc Mon Sep 17 00:00:00 2001 From: sanine Date: Sat, 6 Jul 2024 22:17:20 -0500 Subject: fix audio loading --- levelSelect.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'levelSelect.js') diff --git a/levelSelect.js b/levelSelect.js index 30285e7..9837a05 100644 --- a/levelSelect.js +++ b/levelSelect.js @@ -44,6 +44,8 @@ export function setupLevelSelectUi(root, sfx) { const [ dependencies, level ] = levels[name]; const allDependenciesSatisfied = dependencies.map(x => levels[x][1].completed).reduce((acc, x) => acc && x, true); if (allDependenciesSatisfied) { + sfx.listAppearAudio.currentTime = 0; + sfx.listAppearAudio.play(); // if (true) { const button = document.createElement('input'); button.type = 'button'; @@ -70,8 +72,6 @@ export function setupLevelSelectUi(root, sfx) { let time = 0; [...Object.keys(levels)].forEach(name => { setTimeout(() => { - sfx.listAppearAudio.currentTime = 0; - sfx.listAppearAudio.play(); levelPicker(name); }, 100 * time + 100) time += 1; -- cgit v1.2.1