Skip to content

Commit

Permalink
skip flipping dy when bouncing off of a paddle in the pong demo.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lokathor committed Aug 28, 2024
1 parent aa656a5 commit 5c11ad0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/mode3_pong_example_game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl Ball {
&& self.y <= paddle1.y + PADDLE_HEIGHT
{
self.dx = -self.dx;
self.dy = -self.dy;
self.dy = self.dy;
}

if self.x + BALL_SIZE >= paddle2.x
Expand All @@ -69,7 +69,7 @@ impl Ball {
&& self.y <= paddle2.y + PADDLE_HEIGHT
{
self.dx = -self.dx;
self.dy = -self.dy;
self.dy = self.dy;
}

if self.x + BALL_SIZE <= 1 + BALL_SIZE {
Expand Down

0 comments on commit 5c11ad0

Please sign in to comment.