From 264a918ff37d85c5495f4ebc4fcc042f6d4fb89f Mon Sep 17 00:00:00 2001 From: Theis Pieter Hollebeek Date: Sat, 11 Oct 2025 19:08:26 +0200 Subject: [PATCH] fix snippet + catch loop errors --- index.html | 2 +- src/gamelib.js | 6 +++++- src/sprite_editor.js | 2 +- style.css | 5 ++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 5015c0f..04cfb39 100644 --- a/index.html +++ b/index.html @@ -129,7 +129,7 @@ lib.startGameLoop(loop);

- test +
diff --git a/src/gamelib.js b/src/gamelib.js index 1d01b3e..3f49570 100644 --- a/src/gamelib.js +++ b/src/gamelib.js @@ -37,7 +37,11 @@ export class Gamelib { const now = Date.now(); const deltaT = (now - before) / 1000; before = now; - loopFunction(deltaT); + try { + loopFunction(deltaT); + } catch (error) { + this.console.log(error); + } }, 16); if (this.codeStopper.isStopped()) { diff --git a/src/sprite_editor.js b/src/sprite_editor.js index 4392f2d..971e332 100644 --- a/src/sprite_editor.js +++ b/src/sprite_editor.js @@ -59,7 +59,7 @@ export class SpriteEditor { this.preview.image.src = `data:${sprite.mime};base64,${sprite.bytes.toBase64()}`; const sanitizedName = sprite.name.replace(/" + " width, height,
" + ` "${sanitizedName}"
` + diff --git a/style.css b/style.css index 71b710b..233fa43 100644 --- a/style.css +++ b/style.css @@ -50,14 +50,13 @@ section canvas { } section { - border-bottom-left-radius: 0.5rem; - border-bottom-right-radius: 0.5rem; box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.1); - overflow-y: hidden; } section > :last-child { flex: 1; + border-bottom-left-radius: 0.5rem; + border-bottom-right-radius: 0.5rem; } div#buttons {