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

Function load_images

flappyBird_pygame/flappy_bird.py:142–157  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

140
141
142def load_images():
143 def load_image(img_file_name):
144 file_name = os.path.join(".", "images", img_file_name)
145 img = pygame.image.load(file_name)
146 img.convert()
147 return img
148
149 return {
150 "background": load_image("background.png"),
151 "pipe-end": load_image("pipe_end.png"),
152 "pipe-body": load_image("pipe_body.png"),
153 # images for animating the flapping bird -- animated GIFs are
154 # not supported in pygame
155 "bird-wingup": load_image("bird_wing_up.png"),
156 "bird-wingdown": load_image("bird_wing_down.png"),
157 }
158
159
160def frames_to_msec(frames, fps=FPS):

Callers 1

mainFunction · 0.85

Calls 1

load_imageFunction · 0.70

Tested by

no test coverage detected