Zelda icon indicating copy to clipboard operation
Zelda copied to clipboard

help me please

Open RouaHabibi opened this issue 1 year ago • 1 comments

I keep running into this problem and I think its because of the Mac paths but I don't know how to fix it, please help ,

File "/Users/mac/Desktop/ISS1/code/main.py", line 30, in game = Game() ^^^^^^ File "/Users/mac/Desktop/ISS1/code/main.py", line 15, in init self.level = Level() ^^^^^^^ File "/Users/mac/Desktop/ISS1/code/level.py", line 22, in init self.create_map() File "/Users/mac/Desktop/ISS1/code/level.py", line 41, in create_map self.player = Player((1000,1000),[self.visible_sprites],self.obstacle_sprites) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/mac/Desktop/ISS1/code/player.py", line 13, in init self.import_player_assets() File "/Users/mac/Desktop/ISS1/code/player.py", line 35, in import_player_assets self.animations[animation] = import_folder(full_path) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/mac/Desktop/ISS1/code/support.py", line 19, in import_folder image_surf = pygame.image.load(full_path).convert_alpha() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pygame.error: Unsupported image format

thank you

RouaHabibi avatar Feb 11 '24 18:02 RouaHabibi

you pathLib and get the parent file path then merge. I did all mine in a settings file:

main_dir = Path(file).resolve().parent background_1_dir = os.path.join(main_dir, r"Graphics\background\ground.png")

then when loading image, use the background_1_dir, hope this helps

Eri-py avatar Feb 14 '24 03:02 Eri-py