Skip to content

Commit

Permalink
Improve input handling
Browse files Browse the repository at this point in the history
  • Loading branch information
hakuzumon committed Jul 3, 2024
1 parent 034fc1c commit 1d04bc2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/Tetris.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,7 @@ export default function(props: TetrisProps) {
});

function registerPlayerAction(action: PlayerAction) {
const current = activeAction();
if (current !== action) {
if (!actionStack.includes(action)) {
actionStack.push(action);
newAction = true;
repeating = false;
Expand Down Expand Up @@ -642,7 +641,8 @@ function TetrisControlButton(props: TetrisButtonProps) {
<button class="border border-amber-800 p-2 sm:p-4 md:p-6 rounded active:bg-amber-200 transition-all select-none"
onContextMenu={(e) => e.preventDefault()}
onPointerDown={(e) => pointerDown(e)}
onPointerUp={(e) => pointerUp(e)}>
onPointerUp={(e) => pointerUp(e)}
onPointerCancel={(e) => pointerUp(e)}>
{props.children}
</button>
)
Expand Down

0 comments on commit 1d04bc2

Please sign in to comment.