mirror of https://github.com/kivy/kivy.git
bugfix: tutorials pong score countup on right side (#7603)
The ball wasn't acting correctly when touching the right side: The score countup occured when the ball's left side touched the right wall.
This commit is contained in:
parent
390cffa3fc
commit
c2471d3098
|
@ -59,7 +59,7 @@ class PongGame(Widget):
|
|||
if self.ball.x < self.x:
|
||||
self.player2.score += 1
|
||||
self.serve_ball(vel=(4, 0))
|
||||
if self.ball.x > self.width:
|
||||
if self.ball.right > self.width:
|
||||
self.player1.score += 1
|
||||
self.serve_ball(vel=(-4, 0))
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ class PongGame(Widget):
|
|||
if self.ball.x < self.x:
|
||||
self.player2.score += 1
|
||||
self.serve_ball(vel=(4, 0))
|
||||
if self.ball.x > self.width:
|
||||
if self.ball.right > self.width:
|
||||
self.player1.score += 1
|
||||
self.serve_ball(vel=(-4, 0))
|
||||
|
||||
|
|
Loading…
Reference in New Issue