(self, new_action)
| 190 | target.hit = True |
| 191 | |
| 192 | def update_action(self, new_action): |
| 193 | # check if the new action is different to the previous one |
| 194 | if new_action != self.action: |
| 195 | self.action = new_action |
| 196 | # update the animation settings |
| 197 | self.frame_index = 0 |
| 198 | self.update_time = pygame.time.get_ticks() |
| 199 | |
| 200 | def draw(self, surface): |
| 201 | img = pygame.transform.flip(self.image, self.flip, False) |