diff options
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; } |