diff --git a/backend/api/consumers.py b/backend/api/consumers.py index c1e2f76f..0b20d523 100644 --- a/backend/api/consumers.py +++ b/backend/api/consumers.py @@ -718,12 +718,16 @@ async def run_match_loop(self, match_id): match_state['ball']['y'] - BALL_RADIUS <= match_state['playerA']['paddle_y'] + PADDLE_HEIGHT and # Ball's bottom is above paddle's bottom match_state['ball']['y'] + BALL_RADIUS >= match_state['playerA']['paddle_y'] - PADDLE_HEIGHT): # Ball's top is below paddle's top match_state['ball']['dx'] *= -1 + match_state['ball']['dx'] *= 1.1 + match_state['ball']['dy'] *= 1.1 await self.send_paddle_hit(match_state['playerA'], match_state['ball']) elif (match_state['ball']['x'] + BALL_RADIUS >= TERRAIN_WIDTH - PADDLE_WIDTH and # Right side of ball hits Player B's paddle match_state['ball']['y'] - BALL_RADIUS <= match_state['playerB']['paddle_y'] + PADDLE_HEIGHT and # Ball's bottom is above paddle's bottom match_state['ball']['y'] + BALL_RADIUS >= match_state['playerB']['paddle_y'] - PADDLE_HEIGHT): # Ball's top is below paddle's top match_state['ball']['dx'] *= -1 + match_state['ball']['dx'] *= 1.1 + match_state['ball']['dy'] *= 1.1 await self.send_paddle_hit(match_state['playerB'], match_state['ball']) # Check for scoring