Skip to content

Commit

Permalink
Missing SemiCollumn Bug Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kvebers committed Apr 21, 2024
1 parent 33171fd commit b5b8064
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions frontend/src/pages/Games/Multiplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,11 @@ const GameCanvas = () => {
const leftPaddleCenterY = leftPaddleYSecound + paddleHeight / 2;
const distanceFromCenter = ballY - leftPaddleCenterY;
// eslint-disable-next-line no-unused-expressions
if (ballSpeedX > 0) paddleWidth * (otherPaddleOffset - 1) - 10;
else ballX = paddleWidth * (otherPaddleOffset + 1) + 10;
if (ballSpeedX > 0) {
ballX = paddleWidth * (otherPaddleOffset - 1) - 10;
} else {
ballX = paddleWidth * (otherPaddleOffset + 1) + 10;
}
ballSpeedX *= -1;
// updates the balls speed in case of collusion with the paddle X speed
if (ballSpeedX < 0) ballSpeedX -= ballSpeedIncrease;
Expand Down

0 comments on commit b5b8064

Please sign in to comment.