diff options
author | sanine <sanine.not@pm.me> | 2024-07-07 18:29:38 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2024-07-07 18:29:38 -0500 |
commit | 95ee8172ae99c00efbfb1c8c105112f82711ae01 (patch) | |
tree | 318befb7568b6624b74f5d975dc8d4ea4b20155a /level.js | |
parent | a4d923659f49ccd44e1d6bd09804ba658ca34ac4 (diff) |
add level intro messages
Diffstat (limited to 'level.js')
-rw-r--r-- | level.js | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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; } |