diff options
author | sanine <sanine.not@pm.me> | 2024-07-06 20:16:48 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2024-07-06 20:16:48 -0500 |
commit | 03528a25215330d3b00cabdb1bbe7ce701e1bfeb (patch) | |
tree | caaed47028b8985137afdf5a9416f9e4c4de3db3 /levelSelect.js | |
parent | 0c6831d63cfb6b98107826524183d444eee2e4bd (diff) |
implement level loading animation
Diffstat (limited to 'levelSelect.js')
-rw-r--r-- | levelSelect.js | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/levelSelect.js b/levelSelect.js index 0fbdbf0..2fe3d52 100644 --- a/levelSelect.js +++ b/levelSelect.js @@ -1,11 +1,11 @@ import{ setupLevel, setupLevelUi } from './level.js'; const levels = { - 'Initial Jump': [ [], setupLevel([], [8, 0]) ], - 'Monopole Mining': [ ['Initial Jump'], setupLevel([[3, 3]], [8,8]) ], - 'Parabolic': [ ['Initial Jump', 'Monopole Mining'], setupLevel([[-2, 4], [0,0], [2, 4]], [3,9]) ], - 'Sinusoidal': [ - ['Initial Jump', 'Monopole Mining'], + 'initial jump': [ [], setupLevel([], [8, 0]) ], + 'monopole harvesting': [ ['initial jump'], setupLevel([[3, 3]], [8,8]) ], + 'parabolic': [ ['initial jump', 'monopole harvesting'], setupLevel([[-2, 4], [0,0], [2, 4]], [3,9]) ], + 'sinusoidal': [ + ['initial jump', 'monopole harvesting'], setupLevel([ [-4, 4*Math.sin(0)], [0.5*Math.PI - 4, 4*Math.sin(0.5*Math.PI)], @@ -44,7 +44,15 @@ export function setupLevelSelectUi(root, sfx) { } } - [...Object.keys(levels)].forEach(levelPicker); + let time = 0; + [...Object.keys(levels)].forEach(name => { + setTimeout(() => { + sfx.listAppearAudio.currentTime = 0; + sfx.listAppearAudio.play(); + levelPicker(name); + }, 100 * time + 100) + time += 1; + }); const header = document.createElement('h1'); header.classList.add('center'); header.innerText = 'AVAILABLE CONTRACTS'; |