summaryrefslogtreecommitdiff
path: root/level.js
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2024-07-07 18:29:38 -0500
committersanine <sanine.not@pm.me>2024-07-07 18:29:38 -0500
commit95ee8172ae99c00efbfb1c8c105112f82711ae01 (patch)
tree318befb7568b6624b74f5d975dc8d4ea4b20155a /level.js
parenta4d923659f49ccd44e1d6bd09804ba658ca34ac4 (diff)
add level intro messages
Diffstat (limited to 'level.js')
-rw-r--r--level.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/level.js b/level.js
index 0d62adc..667013b 100644
--- a/level.js
+++ b/level.js
@@ -2,7 +2,7 @@ import { setupLevelSelectUi } from './levelSelect.js';
import { render } from './render.js';
-const X_START = '0';
+const X_START = 't';
const Y_START = 't';
const PATH_LEN = 20;
@@ -12,10 +12,11 @@ const SLOW_RAMP = 1;
const FAST_RAMP = 0.01;
-export function setupLevel(resources, home) {
+export function setupLevel(resources, home, intro) {
const level = {
resources: resources.map(position => ({ position, collected: false })),
home,
+ intro: intro || null,
running: false,
completed: false,
index: 0,
@@ -149,6 +150,10 @@ export function setupLevelUi(level, root, sfx) {
appearSound();
}, 500);
+ if (level.intro) {
+ setTimeout(() => showAlert(ui, level.intro), 600);
+ }
+
return ui;
}