clear-code-projects / Zelda

Files for the Zelda in python tutorial
782 stars 350 forks source link

FileNotFoundError: No file '../graphics/test/rock.png' found in working directory #18

Open ShivamKR12 opened 6 months ago

ShivamKR12 commented 6 months ago

Traceback (most recent call last): File "c:\Users\Shivam\Desktop\voxel 3d\Zelda-main\01 - level\1 - level\code\main.py", line 29, in game = Game() ^^^^^^ File "c:\Users\Shivam\Desktop\voxel 3d\Zelda-main\01 - level\1 - level\code\main.py", line 14, in init self.level = Level() ^^^^^^^ File "c:\Users\Shivam\Desktop\voxel 3d\Zelda-main\01 - level\1 - level\code\level.py", line 18, in init self.create_map() File "c:\Users\Shivam\Desktop\voxel 3d\Zelda-main\01 - level\1 - level\code\level.py", line 26, in create_map Tile((x,y),[self.visible_sprites,self.obstacle_sprites]) File "c:\Users\Shivam\Desktop\voxel 3d\Zelda-main\01 - level\1 - level\code\tile.py", line 7, in init self.image = pygame.image.load('../graphics/test/rock.png').convert_alpha() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: No file '../graphics/test/rock.png' found in working directory 'C:\Users\Shivam\Desktop\voxel 3d\Zelda-main'.

ShivamKR12 commented 6 months ago

Traceback (most recent call last): File "c:\Users\Shivam\Desktop\voxel 3d\Zelda-main\01 - level\1 - level\code\main.py", line 29, in game = Game() ^^^^^^ File "c:\Users\Shivam\Desktop\voxel 3d\Zelda-main\01 - level\1 - level\code\main.py", line 14, in init self.level = Level() ^^^^^^^ File "c:\Users\Shivam\Desktop\voxel 3d\Zelda-main\01 - level\1 - level\code\level.py", line 18, in init self.create_map() File "c:\Users\Shivam\Desktop\voxel 3d\Zelda-main\01 - level\1 - level\code\level.py", line 26, in create_map Tile((x,y),[self.visible_sprites,self.obstacle_sprites]) File "c:\Users\Shivam\Desktop\voxel 3d\Zelda-main\01 - level\1 - level\code\tile.py", line 7, in init self.image = pygame.image.load('../graphics/test/rock.png').convert_alpha() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: No file '../graphics/test/rock.png' found in working directory 'C:\Users\Shivam\Desktop\voxel 3d\Zelda-main'.

ShivamKR12 commented 6 months ago

Traceback (most recent call last): File "c:\Users\Shivam\Desktop\voxel 3d\Zelda-main\01 - level\1 - level\code\main.py", line 29, in game = Game() ^^^^^^ File "c:\Users\Shivam\Desktop\voxel 3d\Zelda-main\01 - level\1 - level\code\main.py", line 14, in init self.level = Level() ^^^^^^^ File "c:\Users\Shivam\Desktop\voxel 3d\Zelda-main\01 - level\1 - level\code\level.py", line 18, in init self.level = Level() ^^^^^^^ File "c:\Users\Shivam\Desktop\voxel 3d\Zelda-main\01 - level\1 - level\code\level.py", line 18, in init self.create_map() File "c:\Users\Shivam\Desktop\voxel 3d\Zelda-main\01 - level\1 - level\code\level.py", line 26, in create_map Tile((x,y),[self.visible_sprites,self.obstacle_sprites]) File "c:\Users\Shivam\Desktop\voxel 3d\Zelda-main\01 - level\1 - level\code\tile.py", line 7, in init self.image = pygame.image.load('graphics/test/rock.png').convert_alpha() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: No file 'graphics/test/rock.png' found in working directory 'C:\Users\Shivam\Desktop\voxel 3d\Zelda-main'.

rralen commented 4 months ago

yo lo arregle meramente poniendo las rutas completas me funciono aunque fue tardado asi que al final para ahorarrme problemas ya que solo era para jugar saque todo de las carpetas y puse el nombre tal cual

ShivamKR12 commented 1 month ago

@rralen sorry my friend but i am unable to understand your language? could you please tell me which language do you speak?

ShivamKR12 commented 1 month ago

if you mean "I fixed it simply by using the full paths; it worked for me, although it was time-consuming. In the end, to avoid problems since it was only for playing, I removed everything from the folders and put the name exactly as it was." , then thanks for your kind suggestion but i believe it is not a permanent fix.