FileNotFoundError: No file 'avatar.png' found in working directory '/home/runner/w'

Viewed 17

I am trying to re-make geometry dash in python but when i load the avatar it gives me an error

This is the code:

font = pygame.font.SysFont("lucidaconsole", 20)

# square block face is main character the icon of the window is the block face
avatar = pygame.image.load("avatar.png")  # load the main character
pygame.display.set_icon(avatar)
#  this surface has an alpha value with the colors, so the player trail will fade away using opacity
alpha_surf = pygame.Surface(screen.get_size(), pygame.SRCALPHA)

# sprite groups
player_sprite = pygame.sprite.Group()
elements = pygame.sprite.Group()

The error

avatar = pygame.image.load("avatar.png")  # load the main character
FileNotFoundError: No file 'avatar.png' found in working directory '/home/runner/w'.

i am not understanding where the /home/runner/w is coming from/how to change it

0 Answers
Related