From 95ee8172ae99c00efbfb1c8c105112f82711ae01 Mon Sep 17 00:00:00 2001 From: sanine Date: Sun, 7 Jul 2024 18:29:38 -0500 Subject: add level intro messages --- levelSelect.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'levelSelect.js') diff --git a/levelSelect.js b/levelSelect.js index 04c65a6..997bbb2 100644 --- a/levelSelect.js +++ b/levelSelect.js @@ -1,22 +1,28 @@ import{ setupLevel, setupLevelUi } from './level.js'; -function buildLevel(x, y, t) { +function buildLevel(x, y, t, intro) { const ts = t.slice(0, -1); const tf = t[t.length-1]; - return setupLevel(ts.map(T => [ x(T), y(T) ]), [ x(tf), y(tf) ]); + return setupLevel(ts.map(T => [ x(T), y(T) ]), [ x(tf), y(tf) ], intro); } const levels = { - 'initial jump': [ [], setupLevel([], [8, 0]) ], - 'monopole harvesting': [ ['initial jump'], setupLevel([[3, 3]], [8,8]) ], + 'initial jump': [ [], setupLevel([], [8, 8], 'please launch the platform into the AMH processor.') ], + 'monopole harvesting 0': [ ['initial jump'], setupLevel([[3, 3]], [8,8], 'please ensure that all monopoles are collected before proceeding to the processor.') ], + 'monopole harvesting 1': [ ['initial jump'], setupLevel([[4, 2]], [8,4], 'the automated navigation system seems to have overshot on the Y axis. please correct.') ], + 'monopole harvesting 2': [ ['initial jump'], setupLevel([[1, 2]], [5,4], 'the automated navigation system seems to have missed the offset on the X axis. please correct.') ], 'inverted': [ ['initial jump'], setupLevel([[-3, -3]], [-8,-8]) ], 'double inverted': [ ['initial jump'], setupLevel([[-8, -8]], [-3,-3]) ], 'parabolic 0': [ ['monopole harvesting'], - buildLevel(t => t, t => t**2, [...Array(4).keys()].map(x => x)), + buildLevel( + t => t, + t => t**2, + [...Array(4).keys()].map(x => x), + ), ], 'parabolic 1': [ ['monopole harvesting'], @@ -78,6 +84,10 @@ export function setupLevelSelectUi(root, sfx) { sfx.buttonClickAudio.currentTime = 0; sfx.buttonClickAudio.play(); root.innerText = ''; + const header = document.createElement('h1'); + header.classList.add('centered'); + header.innerText = name; + root.appendChild(header); setupLevelUi(level, root, sfx); } const li = document.createElement('li'); -- cgit v1.2.1