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

Method _write_win

Lazy_Pong/pong.py:337–346  ·  view source on GitHub ↗
(self, winner_name: str)

Source from the content-addressed store, hash-verified

335 img, (((self._game_field.disp_w - scor_str_len) / 2) + 35, 10))
336
337 def _write_win(self, winner_name: str):
338 font_size = 30
339 font = self._pong_pygame.font.SysFont("freemono", font_size)
340 img = font.render(
341 f'{winner_name} wins!', True, self._game_field.line_color)
342 win_name_str = len(
343 str(f'{winner_name} wins!')) * font_size
344 self._game_field.screen.blit(
345 img, (((self._game_field.disp_w - win_name_str) / 2) + 35, 10))
346 self._pong_pygame.display.flip()
347
348 # Check if cpu or player wins
349 def _check_end_game(self):

Callers 1

_check_end_gameMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected