summaryrefslogtreecommitdiff
path: root/levelSelect.js
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2024-07-06 20:16:48 -0500
committersanine <sanine.not@pm.me>2024-07-06 20:16:48 -0500
commit03528a25215330d3b00cabdb1bbe7ce701e1bfeb (patch)
treecaaed47028b8985137afdf5a9416f9e4c4de3db3 /levelSelect.js
parent0c6831d63cfb6b98107826524183d444eee2e4bd (diff)
implement level loading animation
Diffstat (limited to 'levelSelect.js')
-rw-r--r--levelSelect.js20
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';