I have an animation where my player swings his sword, with 5 images in pygame. The normal resting image is 14x22, and the rest are 13x23, 21x23, 18x23, and 18x23. I am having trouble with my character 'Jumping' when he swings his sword, since the size of my image is constantly changing. Could anyone help my with this?
Here's my code for the animation
elif keys[pg.K_SPACE]: now = pg.time.get_ticks() try: if now - self.last_update > self.frame_rate: if self.direction == 'left': self.game.player_img = self.game.playerattackleft[self.frame] self.frame += 1 self.last_update = now except IndexError: self.frame = 0