Skip to content

Commit

Permalink
Update pong.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Pragyanur authored Jun 28, 2024
1 parent 59ca8e3 commit 41077ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/pong.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ class Ball {
}
goal(rol) {
if(rol === 'left') {
if(this.pos.x - this.radius - 5<= x_min) return true;
if(this.pos.x - this.radius < x_min) return true;
}
if (rol === 'right') {
if(this.pos.x + this.radius +5 >= x_max) return true;
if(this.pos.x + this.radius > x_max) return true;
}
}
// display ball
Expand Down

0 comments on commit 41077ae

Please sign in to comment.