I made a skeleton of a game


#1

I started this Sunday and although I have quite some experience contributing to (closed source) projects, this is my first application that I made from scratch that is not data analysis.

It is still super early days, I am on holiday and started work on this while travelling here last weekend. Just finished the first working version with the minimal feature set I wanted.

Elite 2Deep is a 2D space shooter local multiplayer game with Newtonian* mechanics. You can yaw, thrust forward, backward, and strafe. Keyboard controls only and only 2 players for now. Expanding to more players should be simple in the current code structure, depending on how simple it is to get game controller inputs.
You need to hold the Fire button for a second before you fire your rail guns.
For those familiar with Elite: Dangerous, this is a purely Flight Assist Off game.
I just added some minimal setup instructions in the wiki page.

Have fun!

*Actually I already set it up for a speed limit like Elite Dangerous has but the max speed is set very high still.


#2

Very cool, I downloaded the files, but need to download and install all that other python stuff so might be a bit till i get to check it out fully. till then I’m guessing from the description it’s similar to Spacewar!, Star Control, that kind of 2 player space combat?


#3

I’ve got my Raspberry Pi setup for Python. (Well every Pi is setup with Python–thus the name!) Until I can get the girls get away from the TV, the RasPi stays parked unfortunately. But once they go to bed I will dig inside your code and make a complete mess of it. I can’t wait!


#4

I know installing Python is too much of a barrier for most, and once I have a more complete version I will look at adding a compiled “.exe”

It is indeed similar to space war. Except it is just a duel mode for now, with no AI yet. The thing that took most effort was to get rid of limiting the world size at the screen edges: I don’t like it when you fly out of the screen on the right side and enter it on the left side, so I made a “camera” that automatically pans and zooms to follow the ship’s movement.
I plan on doing a refactoring where I put those world screen coordinate conversions and pygame draw calls in a renderer object.


#5

Nice project!

A little bit of input from my python project experience:

Regarding setup, to someone familiar with python (developers) you could make it a bit quicker to install by supplying a requirements file (a .txt with a list of all the python libraries). You can then use pip to install those into your python environment. If you use pip yourself, you can just do

$ pip freeze

and get a list of requirements that you can paste into a file such as requirements.txt and check that into your repo. It’s not that bad right now with just pygame and numpy being the requirements, but if that list ever grows, it will become a bit of a pain to update or install dependencies.

Looking at your repo, there’s a few things in there you might not want to check into git like the __pycache__ folder or your visual code studio config files. A .gitignore file could help you with that.

Lastly (and sorry for this, i’m just a coding standards Nazi, feel free to disregard :wink:) if you’re planning to cooperate with other coders, it is always a good idea to adhere to pep8 (that’s the python rulebook on coding and code formating). Other people will have a much easier time to read your code if it adheres to pep8, plus there are good linters out there that can catch things like typos, coding errors or unused imports. IMHO in the long run it makes your life a lot easier. If at some point you plan to incorporate an automatic unit testing framework (like pytest), there’s even plugins that can statically check your code for pep8 compliance.

Anyway, just my 2 cents. Looking forward to follow your progress!


#6

This is quite handy for me. I want to learn to use python. I think it would be really helpful for my job. This might be the kick up the bottom I need to start reading up on it…

Looks good dude kind of reminds me of endless sky (free game on steam worth a look BTW)


#7

Thanks for the tips! I have scrolled through PEP8 a few times, which PEP8 linter do you recommend? I just used the default pylinter, as VS code recommended.
Not very happy with it though, as it does not recognize pygame and keeps throwing problems


#8

I use sublime text 3 with a plugin called anaconda exactly for that reason. I tried for hours to get decent python linting in vscode but i just can’t make it happen.

You could also go the route of pytest with pytest-pycodestyle, but that is not a linter.

Also, autopep8 is nice, but can fix only a subclass of pep8 clauses.