Git Product home page Git Product logo

pyspacetrader's Introduction

python3 SpaceTrader

A little game inspired by Space Trader, in python3/Tk, as a toy project.

Turn-based, single-player, 'strategy' game. This is neither a python port nor a full copy of original(s) Space Trader.

Space Trader is an Android strategy game in space by Benjamin Schieder. It is a port of the Palm Pilot game "Space Trader" by Pieter Spronck, which is inspired by David J. Webb’s PalmPilot game "SolarWars" (which in turn is based on Matt Lee’s game "DopeWars") and the 80’s classic 3D strategy game "Elite" (though it does not have Elite’s 3D flight mode).

This version should run wherever a decent python3/Tk run. If not, please let me know.

References

Use and tests

At the moment, you'll need:

.
├── core.py
├── constants.py
├── sgui.py
└── main.py

I try to use as less additionnal python3 modules as possible, but you will need these:

PySimpleGUI-4-foss>=4.41.2
python3 -m pip install PySimpleGUI-4-foss

You may also need to install Tkinter:

apt install python3-tk

To run (and test), simply:

python3 main.py

Select Game -> New. Navigate through the Galactic Map, set a destination, then have a look at Trading Tab, if you want to earn some profit... (Select goods, Buy cargo, next turn, Sell cargo, repeat ad nauseam... And watch for your fuel!!)

Contributing

Disclaimer: This is a toy project, early work in progress... It may never be finished and it will differ from original games.

I am not a professional developer, but I am heager to learn. I needed something to work on my (poor) python skills.

That being said, you are very welcome to help, if you want to (See CONTRIBUTING.rst).

pyspacetrader's People

Contributors

gruiick avatar ltaulell avatar

Stargazers

 avatar

Watchers

 avatar

pyspacetrader's Issues

bbox is to small

when creating planets, collision() should have a bigger radius effect

calculate_prices() is wrong

FIXME it should be stock first, then price
bug: selling price without stock!
enhancement: if no stock, buying price must be higher than selling

python (shelve module) minimal version?

changes between python3.7 and python3.9/3.11 make load/save processing variable depending on python/shelve versions.

python3.7 (main.py):
def load_game():
""" load saved game """
global univers, planetes, captain, fname
try:
fname = sg.popup_get_file('Saved game to open',
default_extension='.db',
file_types=(('saved game(s)', '.db'),
('all files', '
.*')),
).replace('.db', '')
except AttributeError:
pass

if fname == "":
    print("empty filename!")
    load_game()
    """ ... """

python3.9/3.11 (main.py):
def load_game():
""" load saved game """
global univers, planetes, captain, fname
try:
fname = sg.popup_get_file('Saved game to open',
default_extension='.db',
file_types=(('saved game(s)', '.db'),
('all files', '
.*')),
) # .replace('.db', '')
except AttributeError:
pass

if fname == "":
    print("empty filename!")
    load_game()

if ".db" not in fname:
    fname = fname + ".db"
    """ ... """

same for save()/save_as(). Deal with it or impose a minimal version for python? (as 3.7 is already deprecated)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.