Comments (8)
@IvanIsak2000 btw are you Russian? Just noticed your Windows interface is Russian
from doodle-jump.
I don't understand, the
main.py
file is insrc
, is that correct?
Yes, that's correct. And this file main.py
is supposed to be launched from project's root folder
i.e.
$ pwd # check current directory path
/home/username/projects/doodle-jump # we're in project's root
$ python3 src/main.py # launch the game
# starts successfully
Otherwise, relative imports don't work. Here's an error you get:
$ pwd # check current directory path
/home/mb6ockatf/projects/doodle-jump/src # note, we're now in `doodle-jump/src`
$ python3 main.py # raises an error, as it cannot access resources in `doodle-jump/data`
file 'data/bird_left.png' not found
Traceback (most recent call last):
File "/home/username/projects/doodle-jump/src/main.py", line 108, in <module>
gamekeeper = Gamekeeper()
File "/home/username/projects/doodle-jump/src/main.py", line 35, in __init__
self.hopalong = Hopalong(self.players, sprite_name, display_sizes)
File "/home/username/projects/doodle-jump/src/sprites/hopalong.py", line 36, in __init__
sprite_left = load_image(self.name + "_left.png")
File "/home/username/projects/doodle-jump/src/tools/funcs.py", line 16, in load_image
image = pygame.image.load(fullname)
FileNotFoundError: No file 'data/bird_left.png' found in working directory '/home/username/projects/doodle-jump/src'.
I tried my best when organising imports in this project. If you find a way to improve it, @IvanIsak2000, please create a PR for that
from doodle-jump.
Conclusion
What can be done:
-
specify the way the game is supposed to be launched more precisely in
README.md
-
improve imports
-
create a bash script in project's root, and write in README.md that the game is supposed to be launched this way
One of these should fix it
from doodle-jump.
@IvanIsak2000 please check if you're running python3 src/main.py
in project's root folder, not python3 main.py
in /src
folder.
That's because sprites are located out of /src
folder, in /data
from doodle-jump.
@IvanIsak2000 please check if you're running
python3 src/main.py
in project's root folder, notpython3 main.py
in/src
folder. That's because sprites are located out of/src
folder, in/data
That's right, I open main and gives an error :(
from doodle-jump.
I don't understand, the main.py
file is in src
, is that correct?
from doodle-jump.
@mb6ockatf
I don't understand, themain.py
file is insrc
, is that correct?
Yes, that's correct. And this file
main.py
is supposed to be launched from project's root folder i.e.$ pwd # check current directory path /home/username/projects/doodle-jump # we're in project's root $ python3 src/main.py # launch the game # starts successfullyOtherwise, relative imports don't work. Here's an error you get:
$ pwd # check current directory path /home/mb6ockatf/projects/doodle-jump/src # note, we're now in `doodle-jump/src` $ python3 main.py # raises an error, as it cannot access resources in `doodle-jump/data`file 'data/bird_left.png' not found Traceback (most recent call last): File "/home/username/projects/doodle-jump/src/main.py", line 108, in <module> gamekeeper = Gamekeeper() File "/home/username/projects/doodle-jump/src/main.py", line 35, in __init__ self.hopalong = Hopalong(self.players, sprite_name, display_sizes) File "/home/username/projects/doodle-jump/src/sprites/hopalong.py", line 36, in __init__ sprite_left = load_image(self.name + "_left.png") File "/home/username/projects/doodle-jump/src/tools/funcs.py", line 16, in load_image image = pygame.image.load(fullname) FileNotFoundError: No file 'data/bird_left.png' found in working directory '/home/username/projects/doodle-jump/src'.I tried my best when organising imports in this project. If you find a way to improve it, @IvanIsak2000, please create a PR for that
OK, I launched the app, as you said, it's great!
from doodle-jump.
actialy fixed in #30
from doodle-jump.
Related Issues (20)
- add start & finish screen
- add more sprites
- add: sqlite database
- add: documentation
- set strict version in requirements.txt
- add dependabot
- add: changelog notes HOT 1
- add: sprite selector HOT 1
- add: sounds HOT 1
- add: moving tiles
- add: obstacles
- tiles generate wrong
- improve speed logic
- score goes out of display
- fix main menu colors HOT 1
- integrate with sourceforge
- add project description :) HOT 1
- obstacle sprites
- docker question HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from doodle-jump.