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

Method updatePos

PingPong/Slab.py:30–41  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

28 ]
29
30 def updatePos(self):
31 keys = pygame.key.get_pressed()
32 if self.player == 1:
33 if keys[pygame.K_UP] and self.getCoords()[1] > self.minPos[1]:
34 self.pos[1] -= 0.3
35 if keys[pygame.K_DOWN] and self.getCoords()[3] < self.maxPos[1]:
36 self.pos[1] += 0.3
37 else:
38 if keys[pygame.K_w] and self.getCoords()[1] > self.minPos[1]:
39 self.pos[1] -= 0.3
40 if keys[pygame.K_s] and self.getCoords()[3] < self.maxPos[1]:
41 self.pos[1] += 0.3

Callers

nothing calls this directly

Calls 1

getCoordsMethod · 0.95

Tested by

no test coverage detected