diff --git a/gehntris/index.htm b/gehntris/index.htm index 8ef1260..17fefc4 100644 --- a/gehntris/index.htm +++ b/gehntris/index.htm @@ -43,9 +43,6 @@
Level
1
-
- -
diff --git a/gehntris/script.js b/gehntris/script.js index cb4ee86..8fe024f 100644 --- a/gehntris/script.js +++ b/gehntris/script.js @@ -249,6 +249,7 @@ function addPieceToWaiting() { } function addPieceToBoard() { pieceInPlay = pieceInWaiting; + pieceInPlay.move(3, 0); pieceInPlay.waiting = false; addPieceToWaiting(); okayToAddPiece = false; @@ -404,15 +405,10 @@ function tick() { } function addEventListeners() { const pauseButton = document.getElementById("pause-button"); - pauseButton.addEventListener("click", event => { + pauseButton.addEventListener("click", (event) => { pauseButton.blur(); event.stopPropagation(); }); - const dropButton = document.getElementById("drop-button"); - dropButton.addEventListener("click", event => { - dropButton.blur(); - event.stopPropagation(); - }); document.addEventListener("keydown", event => { if (!isGameOver && pieceInPlay) { if (event.code == "ArrowLeft" || event.code == "KeyA") { @@ -439,44 +435,39 @@ function addEventListeners() { let touchStartY = 0; let touchEndX = 0; let touchEndY = 0; - let moving = false; - let moveInterval; document.addEventListener("touchstart", event => { touchStartX = event.touches[0].clientX; touchStartY = event.touches[0].clientY; - moving = true; - movePieceContinuously(); - }); - document.addEventListener("touchmove", event => { - touchEndX = event.touches[0].clientX; - touchEndY = event.touches[0].clientY; }); document.addEventListener("touchend", event => { - moving = false; - if (moveInterval !== undefined) { - clearInterval(moveInterval); - moveInterval = undefined; - } + touchEndX = event.changedTouches[0].clientX; + touchEndY = event.changedTouches[0].clientY; + handleTouchGesture(); }); document.addEventListener("click", event => { if (!isGameOver && pieceInPlay) { rotatePiece(); } }); - function movePieceContinuously() { - moveInterval = setInterval(() => { - if (moving && !isGameOver && pieceInPlay) { - const deltaX = touchEndX - touchStartX; - if (deltaX > 50) { - movePieceRight(); - touchStartX = touchEndX; - } - else if (deltaX < -50) { - movePieceLeft(); - touchStartX = touchEndX; - } + function handleTouchGesture() { + const deltaX = touchEndX - touchStartX; + const deltaY = touchEndY - touchStartY; + if (Math.abs(deltaX) > Math.abs(deltaY)) { + if (deltaX > 50) { + movePieceRight(); } - }, 75); + else if (deltaX < -50) { + movePieceLeft(); + } + } + else { + if (deltaY > 50) { + movePieceDown(); + } + else if (deltaY < -50) { + dropPiece(); + } + } } function movePieceLeft() { if (pieceInPlay.canMove(-1, 0)) { @@ -496,6 +487,12 @@ function addEventListeners() { redrawPieceInPlay(); } } + function dropPiece() { + if (pieceInPlay.canMove(0, 1)) { + pieceInPlay.drop(); + redrawPieceInPlay(); + } + } function rotatePiece() { for (let i = 0; i < pieceInPlay.squares.length; i++) { pieceInPlay.squares[i].svgElement.remove(); @@ -503,17 +500,11 @@ function addEventListeners() { pieceInPlay.rotate(); pieceInPlay.draw(0, 0); } -} -function dropPiece() { - if (pieceInPlay.canMove(0, 1)) { - pieceInPlay.drop(); - redrawPieceInPlay(); - } -} -function redrawPieceInPlay() { - for (let i = 0; i < pieceInPlay.squares.length; i++) { - pieceInPlay.squares[i].svgElement.remove(); + function redrawPieceInPlay() { + for (let i = 0; i < pieceInPlay.squares.length; i++) { + pieceInPlay.squares[i].svgElement.remove(); + } + pieceInPlay.draw(0, 0); } - pieceInPlay.draw(0, 0); } //# sourceMappingURL=script.js.map \ No newline at end of file diff --git a/gehntris/script.js.map b/gehntris/script.js.map index bed18fc..9cff5f2 100644 --- a/gehntris/script.js.map +++ b/gehntris/script.js.map @@ -1 +1 @@ -{"version":3,"file":"script.js","sourceRoot":"","sources":["script.ts"],"names":[],"mappings":"AACA,MAAM,aAAa;IAMf,YAAY,KAAkB,EAAE,MAAc,EAAE,IAAY;QACxD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;CAEJ;AAED,MAAM,MAAM;IASR,YAAY,CAAS,EAAE,CAAS,EAAE,MAAc,EAAE,IAAY;QAC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,WAAW,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;YAC3B,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YACvB,iBAAiB,EAAE,CAAC;SACvB;IACL,CAAC;IAED,SAAS,SAAS;QACd,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;YAC3B,WAAW,CAAC,IAAI,EAAE,CAAC;YACnB,iBAAiB,EAAE,CAAC;SACvB;IACL,CAAC;IAED,SAAS,WAAW;QAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACjD,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;SAC9C;QACD,WAAW,CAAC,MAAM,EAAE,CAAC;QACrB,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED,SAAS,iBAAiB;QACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACjD,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;SAC9C;QACD,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3B,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/gehntris/script.ts b/gehntris/script.ts index c8c40f0..688690f 100644 --- a/gehntris/script.ts +++ b/gehntris/script.ts @@ -313,6 +313,7 @@ function addPieceToWaiting() { function addPieceToBoard() { pieceInPlay = pieceInWaiting; + pieceInPlay.move(3, 0) pieceInPlay.waiting = false; addPieceToWaiting(); okayToAddPiece = false; @@ -489,18 +490,13 @@ function tick() { } function addEventListeners() { + const pauseButton: HTMLButtonElement = document.getElementById("pause-button"); - pauseButton.addEventListener("click", event => { + pauseButton.addEventListener("click", (event) => { pauseButton.blur(); event.stopPropagation(); }); - const dropButton: HTMLButtonElement = document.getElementById("drop-button"); - dropButton.addEventListener("click", event => { - dropButton.blur(); - event.stopPropagation(); - }); - // Event listener for keyboard input document.addEventListener("keydown", event => { if (!isGameOver && pieceInPlay) { @@ -520,35 +516,23 @@ function addEventListeners() { } }); - // Variables to track touch position and movement + // Variables to track touch start position let touchStartX = 0; let touchStartY = 0; let touchEndX = 0; let touchEndY = 0; - let moving = false; - let moveInterval: number | undefined; // Event listener for touch start document.addEventListener("touchstart", event => { touchStartX = event.touches[0].clientX; touchStartY = event.touches[0].clientY; - moving = true; - movePieceContinuously(); - }); - - // Event listener for touch move - document.addEventListener("touchmove", event => { - touchEndX = event.touches[0].clientX; - touchEndY = event.touches[0].clientY; }); // Event listener for touch end document.addEventListener("touchend", event => { - moving = false; - if (moveInterval !== undefined) { - clearInterval(moveInterval); - moveInterval = undefined; - } + touchEndX = event.changedTouches[0].clientX; + touchEndY = event.changedTouches[0].clientY; + handleTouchGesture(); }); // Event listener for clicks (taps) @@ -558,20 +542,26 @@ function addEventListeners() { } }); - function movePieceContinuously() { - moveInterval = setInterval(() => { - if (moving && !isGameOver && pieceInPlay) { - const deltaX = touchEndX - touchStartX; - - if (deltaX > 50) { - movePieceRight(); - touchStartX = touchEndX; // Update the start position to the current position - } else if (deltaX < -50) { - movePieceLeft(); - touchStartX = touchEndX; // Update the start position to the current position - } + function handleTouchGesture() { + const deltaX = touchEndX - touchStartX; + const deltaY = touchEndY - touchStartY; + + // Determine if the swipe was primarily horizontal or vertical + if (Math.abs(deltaX) > Math.abs(deltaY)) { + // Horizontal swipe + if (deltaX > 50) { + movePieceRight(); + } else if (deltaX < -50) { + movePieceLeft(); + } + } else { + // Vertical swipe + if (deltaY > 50) { + movePieceDown(); + } else if (deltaY < -50) { + dropPiece(); } - }, 75); // Adjust the interval time to control the movement speed + } } function movePieceLeft() { @@ -595,6 +585,13 @@ function addEventListeners() { } } + function dropPiece() { + if (pieceInPlay.canMove(0, 1)) { + pieceInPlay.drop(); + redrawPieceInPlay(); + } + } + function rotatePiece() { for (let i = 0; i < pieceInPlay.squares.length; i++) { pieceInPlay.squares[i].svgElement.remove(); @@ -602,18 +599,11 @@ function addEventListeners() { pieceInPlay.rotate(); pieceInPlay.draw(0, 0); } -} - -function dropPiece() { - if (pieceInPlay.canMove(0, 1)) { - pieceInPlay.drop(); - redrawPieceInPlay(); - } -} -function redrawPieceInPlay() { - for (let i = 0; i < pieceInPlay.squares.length; i++) { - pieceInPlay.squares[i].svgElement.remove(); + function redrawPieceInPlay() { + for (let i = 0; i < pieceInPlay.squares.length; i++) { + pieceInPlay.squares[i].svgElement.remove(); + } + pieceInPlay.draw(0, 0); } - pieceInPlay.draw(0, 0); } \ No newline at end of file