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

Method update

flappyBird_pygame/flappy_bird.py:38–48  ·  view source on GitHub ↗
(self, delta_frames=1)

Source from the content-addressed store, hash-verified

36 self._mask_wingdown = pygame.mask.from_surface(self._img_wingdown)
37
38 def update(self, delta_frames=1):
39 if self.ms_to_up > 0:
40 frac_climb_done = 1 - self.ms_to_up / Bird.UP_DURATION
41 self.y -= (
42 Bird.UP_SPEED
43 * frames_to_msec(delta_frames)
44 * (1 - math.cos(frac_climb_done * math.pi))
45 )
46 self.ms_to_up -= frames_to_msec(delta_frames)
47 else:
48 self.y += Bird.DOWN_SPEED * frames_to_msec(delta_frames)
49
50 @property
51 def image(self):

Callers 1

mainFunction · 0.95

Calls 1

frames_to_msecFunction · 0.85

Tested by

no test coverage detected