Skip to content

Commit

Permalink
Auto formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
kvebers committed Apr 21, 2024
1 parent 99b0e9d commit 33171fd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions frontend/src/pages/Games/Multiplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ const GameCanvas = () => {
Math.abs(ballSpeedX);
// check for the collision with right paddle
} else if (
ballX < paddleWidth * (otherPaddleOffset + 1) + ballSize * sizeSpeedRatio &&
ballX >
paddleWidth * (otherPaddleOffset) + ballSize * sizeSpeedRatio &&
ballX <
paddleWidth * (otherPaddleOffset + 1) + ballSize * sizeSpeedRatio &&
ballX > paddleWidth * otherPaddleOffset + ballSize * sizeSpeedRatio &&
ballY > leftPaddleYSecound &&
ballY < leftPaddleYSecound + paddleHeight
) {
const leftPaddleCenterY = leftPaddleYSecound + paddleHeight / 2;
const distanceFromCenter = ballY - leftPaddleCenterY;
// eslint-disable-next-line no-unused-expressions
// eslint-disable-next-line no-unused-expressions
if (ballSpeedX > 0) paddleWidth * (otherPaddleOffset - 1) - 10;
else ballX = paddleWidth * (otherPaddleOffset + 1) + 10;
ballSpeedX *= -1;
Expand Down Expand Up @@ -294,7 +294,7 @@ const GameCanvas = () => {
const touchY = event.touches[i].clientY - rect.top - window.scrollY;
// Left paddle controls
if (touch.clientX < window.innerWidth / 2) {
// eslint-disable-next-line react-hooks/exhaustive-deps
// eslint-disable-next-line react-hooks/exhaustive-deps
leftPaddleY = touchY - paddleHeight / 2;
leftPaddleY = Math.max(
0,
Expand All @@ -303,7 +303,7 @@ const GameCanvas = () => {
}
// Right paddle controls
else {
// eslint-disable-next-line react-hooks/exhaustive-deps
// eslint-disable-next-line react-hooks/exhaustive-deps
rightPaddleY = touchY - paddleHeight / 2;
rightPaddleY = Math.max(
0,
Expand Down

0 comments on commit 33171fd

Please sign in to comment.