summaryrefslogtreecommitdiff
path: root/level.js
diff options
context:
space:
mode:
Diffstat (limited to 'level.js')
-rw-r--r--level.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/level.js b/level.js
index 17ccee7..27b7078 100644
--- a/level.js
+++ b/level.js
@@ -1,3 +1,4 @@
+import { setupLevelSelectUi } from './levelSelect.js';
import { render } from './render.js';
@@ -91,6 +92,15 @@ export function setupLevelUi(level, root, audio) {
ui.canvas.height = 600;
root.appendChild(ui.canvas);
+ ui.returnBtn = document.createElement('input');
+ ui.returnBtn.type = 'button';
+ ui.returnBtn.value = 'Return';
+ ui.returnBtn.onclick = () => {
+ root.innerText = '';
+ setupLevelSelectUi(root, audio);
+ }
+ root.appendChild(ui.returnBtn);
+
ui.ctx = ui.canvas.getContext('2d');
ui.ctx.translate(ui.canvas.width/2, ui.canvas.height/2)
ui.ctx.scale(ui.canvas.width/20, -ui.canvas.height/20);