Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] How to test/run SolarWolf without installing? #9

Closed
LeeNX opened this issue Nov 16, 2020 · 4 comments
Closed

[Question] How to test/run SolarWolf without installing? #9

LeeNX opened this issue Nov 16, 2020 · 4 comments

Comments

@LeeNX
Copy link

LeeNX commented Nov 16, 2020

Long time player, long time lurker ... ;-)

Saw pygame v2.0.0 release, had me wondering if I could run SolarWolf on my Mac.

As a total python newebie, I don't have a clue how to do this. Installed pygame v2.0.0 with brew, tested ailens with python3 -m pygame.examples.aliens and this works fine.

Problem I am having, so that I can't seem to get SolarWolf to do the same. When I run python3 main.py

pygame 2.0.0 (SDL 2.0.12, python 3.8.2)
Hello from the pygame community. https://www.pygame.org/contribute.html

I have tried python3 setup.py build and still have the same problem.

Please can I ask for a little bit of help?

@illume
Copy link
Member

illume commented Nov 16, 2020

Hello!

This should work after doing a git clone:

python3 solarwolf/cli.py

(probably not the most easy to find command... it could do with a "run_game.py" or so)

If you do an install with pip, you should be able to run 'solarwolf' as a command. I'll try and pull a release together to fix these things.

@LeeNX
Copy link
Author

LeeNX commented Nov 16, 2020

Thanks @illume for the quick reply.

Looks like the data is hard coded in the source code

leet-mbp:solarwolf leet$ python3 solarwolf/cli.py
Traceback (most recent call last):
  File "solarwolf/cli.py", line 204, in <module>
    if __name__ == '__main__': main()
  File "solarwolf/cli.py", line 44, in main
    os.chdir(DATADIR)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/games/solarwolf'

I also tried in the solarwolf folder ... Was looking to see if the code looks in the current folder for the data, but my python skills is very poor ... ;-).

I could just hack the paths for testing, I will give feedback on that a little later.

I so want to see pygame v2.0.0 and SolarWolf!!!

@LeeNX
Copy link
Author

LeeNX commented Nov 17, 2020

I made the following change to cli.py

#these directories will be used if solarwolf cannot find
#the directories in the location of the main program
if sys.platform == "win32":
    DATADIR = "C:\\Program Files\\Solarwolf"
    CODEDIR = "C:\\Program Files\\Solarwolf\\code"
else:
    DATADIR = "."
    CODEDIR = "."
#    DATADIR = "/usr/share/games/solarwolf"
#    CODEDIR = "/usr/lib/games/solarwolf"

Had SolarWolf start with python3 cli.py.

Oh and I am as bad at playing now as I was all them years ago on the little 14" CRT monitor, but so much fun.

I think there is a bug in checking if the data resources are in the sub-folder data from the current path or in the FHS/distro path of /usr/share/games/solarwolf

Also adding a small ReadMe file that explains running SolarWolf and options would be great. I think I can help with that and offer a PR.

@illume
Copy link
Member

illume commented Oct 28, 2023

This was quite long ago, and I think perhaps this is fixed in the meantime.

I tried it on homebrew python just now from the main branch and the below work for me.

python3 solarwolf/cli.py

AND

python3 -m solarwolf

@illume illume closed this as completed Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants