From 7a74cc0dc07b34692eea2640e72b87e831892b16 Mon Sep 17 00:00:00 2001 From: rnickles Date: Tue, 8 Oct 2024 18:29:03 -0700 Subject: [PATCH] undo button --- _layouts/level.html | 2 +- game/acceptUserInput.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/_layouts/level.html b/_layouts/level.html index 9eb7bf9..705b7fb 100644 --- a/_layouts/level.html +++ b/_layouts/level.html @@ -56,7 +56,7 @@ } #undo-button { position: fixed; - top: 70px; + top: 100px; right: 10px; padding: 10px 20px; font-size: 32px; diff --git a/game/acceptUserInput.js b/game/acceptUserInput.js index e91a216..fac26a0 100644 --- a/game/acceptUserInput.js +++ b/game/acceptUserInput.js @@ -66,12 +66,20 @@ export function acceptUserInput(engine, render, gameState) { undoButton.onmousedown = function() { repeat(); } + undoButton.ontouchstart = function() { + repeat(); + } undoButton.onmouseup = function () { start = 100; speedup = 1.05; clearTimeout(t); } + undoButton.ontouchend = function () { + start = 100; + speedup = 1.05; + clearTimeout(t); + } } setupUndoButton();