MCPcopy Create free account
hub / github.com/geekcomputers/Python / load_images

Method load_images

Street_Fighter/src/fighter.py:28–44  ·  view source on GitHub ↗
(self, sprite_sheet, animation_steps)

Source from the content-addressed store, hash-verified

26 self.alive = True
27
28 def load_images(self, sprite_sheet, animation_steps):
29 # extract images from spritesheet
30 animation_list = []
31 for y, animation in enumerate(animation_steps):
32 temp_img_list = []
33 for x in range(animation):
34 temp_img = sprite_sheet.subsurface(
35 x * self.size, y * self.size, self.size, self.size
36 )
37 temp_img_list.append(
38 pygame.transform.scale(
39 temp_img,
40 (self.size * self.image_scale, self.size * self.image_scale),
41 )
42 )
43 animation_list.append(temp_img_list)
44 return animation_list
45
46 def move(self, screen_width, screen_height, target, round_over):
47 SPEED = 10

Callers 1

__init__Method · 0.95

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected