Python Forum
Spaceship - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Game Development (https://python-forum.io/forum-11.html)
+--- Thread: Spaceship (/thread-33566.html)

Pages: 1 2


RE: Spaceship - metulburr - Jul-23-2021

What does your file structure look like? For example, what is your root file to start the program, is in what directory as opposed to the image locations?

Would be easier to view on Github where we can easily see this fike structure


RE: Spaceship - abscorpy - Jul-26-2021

Here is the link for the Github Repo

https://github.com/abscorpy/Spaceship

Cheers


RE: Spaceship - SheeppOSU - Aug-06-2021

(Jul-26-2021, 07:15 AM)abscorpy Wrote: Here is the link for the Github Repo

https://github.com/abscorpy/Spaceship

Cheers

If the file structure looks like this then pygame.image.load('spaceship_yellow.png') should work. When doing pygame.image.load(os.path.join('First_Game', 'spaceship_yellow.png')) Python is looking for a directory named First_Game within the root directory, or directory the main python file is running from. Since there is no such directory within the root directory, it throws an error.


RE: Spaceship - abscorpy - Aug-07-2021

Thanks
(Aug-06-2021, 07:53 PM)SheeppOSU Wrote:
(Jul-26-2021, 07:15 AM)abscorpy Wrote: Here is the link for the Github Repo

https://github.com/abscorpy/Spaceship

Cheers

If the file structure looks like this then pygame.image.load('spaceship_yellow.png') should work. When doing pygame.image.load(os.path.join('First_Game', 'spaceship_yellow.png')) Python is looking for a directory named First_Game within the root directory, or directory the main python file is running from. Since there is no such directory within the root directory, it throws an error.