Skip to content

Commit

Permalink
add reset-on-error
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuahhh committed Dec 17, 2024
1 parent 6ecff5b commit db8724a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1284,11 +1284,18 @@ async function main() {

let lastEndTime = performance.now();

requestAnimationFrame(drawLoop);
requestAnimationFrame(drawLoopProtected);

let t = 0;
function drawLoopProtected() {
requestAnimationFrame(drawLoopProtected);
try {
drawLoop();
} catch (e) {
pushState(examples.dominoesBlank);
}
}
function drawLoop() {
requestAnimationFrame(drawLoop);
t++;

// oscillate around violet
Expand Down

0 comments on commit db8724a

Please sign in to comment.