Skip to content

Commit

Permalink
Merge pull request #321 from zstenger93/gameFixes
Browse files Browse the repository at this point in the history
Missing SemiCollumn Bug Fix
  • Loading branch information
zstenger93 authored Apr 21, 2024
2 parents 303deaa + b5b8064 commit 40fdbcc
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 40fdbcc

Please sign in to comment.