MCPcopy Create free account
hub / github.com/ndleah/python-mini-project / run_game

Method run_game

Lazy_Pong/pong.py:380–396  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

378 self._move_player(event)
379
380 def run_game(self):
381 pong_log.info("Game start!")
382 while True:
383 self._check_collision()
384 self._move_computer()
385 self._update_events()
386 self._game_field.fill_screen()
387 self._ball.update_pos()
388 self._player.update_pos()
389 self._computer.update_pos()
390 self._ball.draw(self._game_field.get_screen())
391 self._player.draw(self._game_field.get_screen())
392 self._computer.draw(self._game_field.get_screen())
393 self._game_field.draw_borders()
394 self._write_score()
395 self._pong_pygame.display.flip()
396 self._clock.tick(self._fps)
397
398
399def main():

Callers 1

mainFunction · 0.95

Calls 9

_check_collisionMethod · 0.95
_move_computerMethod · 0.95
_update_eventsMethod · 0.95
_write_scoreMethod · 0.95
fill_screenMethod · 0.80
get_screenMethod · 0.80
draw_bordersMethod · 0.80
update_posMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected