| 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 |