I've been suck on my Flappy Bird clone. If you don't know the game, there is an animation that happens when the bird fly up.
Here is a general idea of how I tried to do an animation: self.x and self.y refer to the position of the photo
Here is my code:
def move_up_animation(self):
#list of bird photos to animate
animation_list = ['1.tiff','2.tiff','3.tiff','4.tiff','5.tiff']
for i in range(len(animation_list)):
if self.y - 1 > 0: # checks if the bird is within the frame
self.y = self.y - 1 #changes the bird's, allowing the bird to fly up
self.image = pygame.image.load(animation[i])
self.display_image()
I tried time.sleep(1) but it doesn't work.
I have no idea how this code works:
for i in range(5):
print(i)
time.sleep(1)