small snippet containing the "animated" part of the code
# importing pygame, loading images and initialising stuff
FPS = 20
frame_count = 0
While True:
# for event in pygame.event.get() and other stuff
if frame_count//5%4 == 0:
character_right = character_right1 #(pygame.load.image("path\\etc.1))
if frame_count//5%4 == 1:
character_right = character_right2 #(pygame.load.image("path\\etc.2))
if frame_count//5%4 == 2:
character_right = character_right3 #(pygame.load.image("path\\etc.3))
if frame_count//5%4 == 3:
character_right = character_right4 #(pygame.load.image("path\\etc.4))
# a bunch of game states and stuff
if game_active:
screen.blit(character_right, character_rect)
frame_count += 1
pygame.display.update()
clock.tick(FPS)
this animation was only experimental, as i'm sure theres a better way to animate things, but it seems like it works for now?
i'm just skeptical, and wondering if this way of doing stuff will become really inefficient as soon as i'm animating lots of surfaces