(self)
| 303 | |
| 304 | # Move computer to follow the ball after half of the game field |
| 305 | def _move_computer(self): |
| 306 | if self._ball.get_borders()['right'] < self._game_field.disp_w / 2: |
| 307 | if self._computer.get_borders()['center_y'] < self._ball.get_borders()['center_y']: |
| 308 | self._computer.set_speed(self._cpu_speed) |
| 309 | else: |
| 310 | self._computer.set_speed(-self._cpu_speed) |
| 311 | else: |
| 312 | self._computer.set_speed(0) |
| 313 | |
| 314 | # Based on incoming keyboard event, move the player |
| 315 | def _move_player(self, event: pygame.event): |
no test coverage detected