# Move the player.
if moveDown and player.bottom < WINDOWHEIGHT:
player.top += MOVESPEED
playerImage = pygame.image.load('PlayerFSprite1.png')
playerStretchedImage = pygame.transform.scale(playerImage, (256, 256))
windowSurface.blit(playerStretchedImage, player)
if moveUp and player.top > 0:
player.top -= MOVESPEED
playerImage = pygame.image.load('Player USprite.png')
playerStretchedImage = pygame.transform.scale(playerImage, (256, 256))
windowSurface.blit(playerStretchedImage, player)
if moveLeft and player.left > 0:
player.left -= MOVESPEED
playerImage = pygame.image.load('PlayerLSprite.png')
playerStretchedImage = pygame.transform.scale(playerImage, (256, 256))
windowSurface.blit(playerStretchedImage, player)
if moveRight and player.right < WINDOWWIDTH:
player.right += MOVESPEED
playerImage = pygame.image.load('PlayerRSprite.png')
playerStretchedImage = pygame.transform.scale(playerImage, (256, 256))
windowSurface.blit(playerStretchedImage, player)
This code is making a sprite move a direction with a certain animation but I was wondering how I can make the animation switch to another animation while holding down the key direction so when holding "W" there will be the first animation and then after a 0.2 second delay another animation appears.