Skip to content

Commit

Permalink
undo button
Browse files Browse the repository at this point in the history
  • Loading branch information
rnickles committed Oct 9, 2024
1 parent b37a6b5 commit 7a74cc0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion _layouts/level.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
}
#undo-button {
position: fixed;
top: 70px;
top: 100px;
right: 10px;
padding: 10px 20px;
font-size: 32px;
Expand Down
8 changes: 8 additions & 0 deletions game/acceptUserInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 7a74cc0

Please sign in to comment.