import pygame
pygame.init()

window = pygame.display.set_mode((600,400))

pygame.display.set_caption("Animation")

black = (0,0,0)
white = (255, 255, 255)

clock = pygame.time.Clock()

#sprite image load
Sprite1 = pygame.image.load("images/sprite1.png")
Sprite2 = pygame.image.load("images/sprite2.png")

SpriteCurrentImage = 1

gameLoop=True
while gameLoop:
    
    for event in pygame.event.get():
        
        if (event.type==pygame.QUIT):
            gameLoop=False

    window.fill(white)

    if SpriteCurrentImage==1:
        window.blit(Sprite1, (10,10))

    if SpriteCurrentImage==2:
        window.blit(Sprite2, (10,10))

    if SpriteCurrentImage==2:
        SpriteCurrentImage=1

    else:
        SpriteCurrentImage+=1;
        
    pygame.display.flip()

    clock.tick(10)

pygame.quit()
