summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2024-07-07 12:47:00 -0500
committersanine <sanine.not@pm.me>2024-07-07 12:47:00 -0500
commitb648eaffe1f9a33280ef4486474ca0aa52dac9f8 (patch)
tree97293fd5d5931c1d2c98d7f5d2b833f319a6f63c
parent553218a6214b0473f1ac8bad9e832fc5ea84199c (diff)
update path speed
-rw-r--r--level.js4
-rw-r--r--main.js4
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();
}