From b648eaffe1f9a33280ef4486474ca0aa52dac9f8 Mon Sep 17 00:00:00 2001 From: sanine Date: Sun, 7 Jul 2024 12:47:00 -0500 Subject: update path speed --- level.js | 4 ++-- main.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/level.js b/level.js index 0d62adc..f5aa29c 100644 --- a/level.js +++ b/level.js @@ -6,7 +6,7 @@ const X_START = '0'; const Y_START = 't'; const PATH_LEN = 20; -const PATH_STEP = PATH_LEN/1000; +const PATH_STEP = PATH_LEN/500; const SLOW_RAMP = 1; const FAST_RAMP = 0.01; @@ -177,7 +177,7 @@ function stepLevel(ui, level, index) { render(ui.ctx, level, 0); } else if (level.running && index < level.path.length-1) { const distNext = distance(pos, level.path[index+1] || pos); - setTimeout(() => stepLevel(ui, level, index+1), 50*distNext); + setTimeout(() => stepLevel(ui, level, index+1), distNext); } else { if (index >= level.path.length-1) { finishLevel(ui, level, true); diff --git a/main.js b/main.js index 94c3f31..6b5edc1 100644 --- a/main.js +++ b/main.js @@ -28,10 +28,10 @@ window.onload = () => setTimeout(() => { start.value = 'connect to AMH'; start.onclick = () => { // set up fullscreen - document.documentElement.requestFullscreen(); + document.documentElement.requestFullscreen({ navigationUI: 'hide' }); document.getElementById('fullscreen-toggle').onclick = () => { if (document.fullscreenElement === null) { - document.documentElement.requestFullscreen(); + document.documentElement.requestFullscreen({ navigationUI: 'hide' }); } else { document.exitFullscreen(); } -- cgit v1.2.1