From c2471d3098e3f2391bb449d3ccc48518d0a8684c Mon Sep 17 00:00:00 2001 From: SubaruArai <78188579+SubaruArai@users.noreply.github.com> Date: Mon, 20 Sep 2021 00:39:41 +0900 Subject: [PATCH] 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. --- examples/tutorials/pong/main.py | 2 +- examples/tutorials/pong/steps/step5/main.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/tutorials/pong/main.py b/examples/tutorials/pong/main.py index b3dede4ff..9c79d882c 100644 --- a/examples/tutorials/pong/main.py +++ b/examples/tutorials/pong/main.py @@ -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)) diff --git a/examples/tutorials/pong/steps/step5/main.py b/examples/tutorials/pong/steps/step5/main.py index d2152a3f1..31d987ac5 100644 --- a/examples/tutorials/pong/steps/step5/main.py +++ b/examples/tutorials/pong/steps/step5/main.py @@ -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))