Skip to content
Permalink
Browse files

Merge pull request #1 from Natim/fix-bounce-on-pad-bug

Fix bounce on pad, when the ball bounce inside the pad.
  • Loading branch information...
magopian committed Aug 7, 2019
2 parents bbb07a7 + 0759276 commit dc535518fa478a7ff403f8e792b336c5bbea0209
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/Main.elm
@@ -293,11 +293,13 @@ shouldBallBounce paddle ball =
(ball.x - ball.radius <= x + width)
&& (ball.y >= y)
&& (ball.y <= y + height)
&& (ball.horizSpeed < 0)

RightPaddle { x, y, height } ->
(ball.x + ball.radius >= x)
&& (ball.y >= y)
&& (ball.y <= y + height)
&& (ball.horizSpeed > 0)


shouldBallBounceVertically : Ball -> Bool

0 comments on commit dc53551

Please sign in to comment.
You can’t perform that action at this time.