Implemented ball-paddle collision.

I decided to have the ball check for collision with
the paddle instead of having the paddle check for collision
with the ball. Either way could work, but it seemed
easier to have the ball do the checking since the
ball will need to respond with a change in velocity
anyway.
This commit is contained in:
Chris Proctor
2025-12-18 16:43:57 -05:00
parent d41f61c3bd
commit b3ce5cb09a
2 changed files with 14 additions and 6 deletions

View File

@@ -15,11 +15,6 @@ class Paddle:
def play_turn(self, game):
if not self.pieces:
self.create_pieces(game)
check_collision()
def check_collision:
x, y = self.position
print (retro.game.Game.get_agent_by_name(ball))
def handle_keystroke(self, keystroke, game):
x, y = self.position