diff options
author | sanine <sanine.not@pm.me> | 2024-07-06 11:58:58 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2024-07-06 11:58:58 -0500 |
commit | 2f300a221b850ae66a785523436511c06b318a22 (patch) | |
tree | fafb251a6fcb63949afe148ddf262ba3d6f7faa4 /level.js | |
parent | 71a61ed1c3929f9d4cb615cf691bb980a8005c9e (diff) |
add level select screen
Diffstat (limited to 'level.js')
-rw-r--r-- | level.js | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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); |