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

Method update_pos

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

Source from the content-addressed store, hash-verified

107 self.display_high = display_high
108
109 def update_pos(self) -> None:
110 if self.center_y - self.radius <= 0 or self.center_y + self.radius >= self.display_high:
111 self.invert_move(invert_y=True)
112 if self.speed_x != 0:
113 self.center_x += self.speed_x
114 if self.speed_y != 0:
115 self.center_y += self.speed_y
116
117 def set_speed(self, speed_x: int | float, speed_y: int | float) -> None:
118 if speed_x != 0:

Callers 1

run_gameMethod · 0.45

Calls 1

invert_moveMethod · 0.95

Tested by

no test coverage detected