Skip to content

Commit

Permalink
Merge pull request #318 from zstenger93/gameFixes
Browse files Browse the repository at this point in the history
Game Bug Fixes
  • Loading branch information
zstenger93 authored Apr 21, 2024
2 parents a895b83 + 9c85f1b commit 40705ca
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions frontend/src/pages/Games/Tournament.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ const Tournament = () => {
width: "100%",
height: "12%",
marginBottom: "5%",
minHeight: "12%",
alignItems: "center",
display: "flex",
flexDirection: "column",
Expand Down Expand Up @@ -498,6 +499,7 @@ const Tournament = () => {
width: "100%",
height: "12%",
marginBottom: "5%",
minHeight: "12%",
alignItems: "center",
display: "flex",
flexDirection: "column",
Expand Down Expand Up @@ -535,6 +537,7 @@ const Tournament = () => {
width: "100%",
height: "12%",
marginBottom: "5%",
minHeight: "12%",
alignItems: "center",
display: "flex",
flexDirection: "column",
Expand Down Expand Up @@ -570,6 +573,7 @@ const Tournament = () => {
style={{
width: "100%",
height: "12%",
minHeight: "12%",
marginBottom: "5%",
alignItems: "center",
display: "flex",
Expand Down Expand Up @@ -600,6 +604,7 @@ const Tournament = () => {
style={{
width: "100%",
height: "12%",
minHeight: "12%",
marginBottom: "5%",
alignItems: "center",
display: "flex",
Expand Down Expand Up @@ -908,7 +913,7 @@ const Tournament = () => {
var ballX = 50;
var ballY = 50;
var ballDirX = 1;
var ballDirY = 0;
var ballDirY = 0.05;
var scorePlayer1 = 0;
var scorePlayer2 = 0;

Expand Down Expand Up @@ -974,7 +979,7 @@ const Tournament = () => {
const match = tournament.matches[tournament.currentMatch];
match.winner = scorePlayer1 > scorePlayer2 ? match.player1 : match.player2;
match.matchId = tournament.currentMatch;
if (match.player1.score > match.player2.score) match.player1.score += 1;
if (scorePlayer1 > scorePlayer2) match.player1.score += 1;
else match.player2.score += 1;
match.scorePlayer1 = scorePlayer1;
match.scorePlayer2 = scorePlayer2;
Expand Down Expand Up @@ -1026,7 +1031,7 @@ const Tournament = () => {
ballX = canvas.width / 2;
ballY = canvas.height / 2;
ballDirX = ballDirX * -1;
ballDirY = 0;
ballDirY = 0.05;
ballSpeed = 0.9;
if (scorePlayer1 >= 2 || scorePlayer2 >= 2) {
ballSpeed = 0;
Expand Down

0 comments on commit 40705ca

Please sign in to comment.