generated from mwc/project_game
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user