Can you help me? It's the first time that I use pygame and I found an error loading image. I've just searched in this site for a possible solution, but nothing seems to work for me. I tried to use pygame.image.load() with all the path or with a part, but it didn't work. I created this function that is similar of a function in pygame tutorial in the documentation of pygame.
def load_png(name = ""):
current_path = os.path.dirname(__file__)
game_path = os.path.join(current_path, 'game')
image_path = os.path.join(game_path, 'images')
image_path += "\\" + name
image = pygame.image.load(image_path)
if image.get_alpha() is None:
image = image.convert()
else:
image = image.convert_alpha()
return image, image.get_rect()