So I'm working on a little christmas game, and I have 2 sprites for my character, and I want these two sprites to make a character animation while the game is running. Sprites are called "santa1" and "santa2", here is my code:
import pygame
pygame.init()
pygame.display.set_caption("Santa Dash!")
win = pygame.display.set_mode((1200, 800))
santa = pygame.image.load("santa1.png").convert_alpha()
map = pygame.image.load("santadashmap.png").convert_alpha()
x = 100
y = 500
vel = 1
#Gameloop
run = True
while run:
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
keys = pygame.key.get_pressed()
if keys[pygame.K_w]:
y -= vel
if keys[pygame.K_s]:
y += vel
if keys[pygame.K_a]:
x -= vel
if keys[pygame.K_d]:
x += vel
win.blit(map, (0, 0))
win.blit(santa, (x, y))
pygame.display.update()
Any help is greatly appreciated, and I'll be happy to give more information if you'd need it.
//Qmobss