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

Method _write_score

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

Source from the content-addressed store, hash-verified

325 self._player.set_speed(-self._player_speed)
326
327 def _write_score(self):
328 font_size = 30
329 font = self._pong_pygame.font.SysFont("freemono", font_size)
330 img = font.render(
331 f'{self._stat["cpu_score"]} {self._stat["player_score"]}', True, self._game_field.line_color)
332 scor_str_len = len(
333 str(f'{self._stat["cpu_score"]} {self._stat["player_score"]}')) * font_size
334 self._game_field.screen.blit(
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

Callers 1

run_gameMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected