MCPcopy Index your code
hub / github.com/geekcomputers/Python / update

Method update

PongPong_Game/pong/paddle.py:17–33  ·  view source on GitHub ↗
(self, win_size: Tuple, border: float, other_object, dt)

Source from the content-addressed store, hash-verified

15 self.event_handlers = [self, self.key_handler]
16
17 def update(self, win_size: Tuple, border: float, other_object, dt):
18 newlx = self.x + self.acc_left
19 newrx = self.x + self.acc_right
20
21 if self.key_handler[key.LEFT]:
22 self.x = newlx
23 elif self.key_handler[key.RIGHT]:
24 self.x = newrx
25
26 self.rightx = self.x + self.width
27
28 if self.x < border:
29 self.x = border
30 self.rightx = self.x + self.width
31 elif self.rightx > win_size[0] - border:
32 self.x = win_size[0] - border - self.width
33 self.rightx = self.x + self.width

Callers 3

saveFunction · 0.45
updateFunction · 0.45
main.pyFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected