(self)
| 94 | self.speed_y *= -1 |
| 95 | |
| 96 | def reset_ball(self): |
| 97 | for paddle in self.paddles: |
| 98 | if paddle.x == 20: |
| 99 | paddle.rect.center = (20, HEIGHT / 2) |
| 100 | else: |
| 101 | paddle.rect.center = (WIDTH - 20, HEIGHT / 2) |
| 102 | self.active = False |
| 103 | self.speed_x *= random.choice((-1, 1)) |
| 104 | self.speed_y *= random.choice((-1, 1)) |
| 105 | self.score_time = pygame.time.get_ticks() |
| 106 | self.rect.center = (WIDTH / 2, HEIGHT / 2) |
| 107 | if started > 1: |
| 108 | pygame.mixer.Sound.play(score_sound) |
| 109 | |
| 110 | def restart_counter(self): |
| 111 | current_time = pygame.time.get_ticks() |
no outgoing calls
no test coverage detected