Just wanted to share my game but also wanted to highlight pyxel as a python game library. If you haven't heard of it, it's a really cool, easy to use retro game library.
If you have heard of it but haven't checked it out for a while, have another look. Kitao has been absolutely slaying it, and pyxel now has a really nice editing tool that covers images, tiles, sounds, and music. It also has some stubs and type annotations so everything works smoothly with your IDE.
Wow, I’m really impressed by your code. It’s super easy to read and clean. I have just learned something about python, didn’t know how to use class_init properly before.
I must find another cool retro game and try to code it by myself, asteroid game looks awesome but now I would think too much about your code to not just copy your idea(I mean the structure of the game and the asteroid class).
That's really good to hear – I try to make things as clear as possible as I often pick up and drop projects over time.
Although I'm using a class method for init_class (which I do have to manually call, it's not a magic dunder method), I am using the name of the classes directly a lot to access the class variables (e.g., Asteroid.asteroids) This isn't great practice in general I guess as it means everything breaks if I sub-class the class, but that isn't going to happen in this case.
I guess what I should be doing is creating an Asteroid factory class which creates the individual asteroids, but abusing the class variables seems to work for this.
u/yawpitch had some ideas over on the post over on the pyxel subreddit, like lunar lander.
Lunar lander seems awesome! Thanks for idea! I have read about different OOP frameworks/patterns like factory but haven’t understand its potential to be honest, I must try to understand it and write one by myself in python.
28
u/timbledum Jan 20 '19 edited Jan 20 '19
Hey all! Game here.
Just wanted to share my game but also wanted to highlight pyxel as a python game library. If you haven't heard of it, it's a really cool, easy to use retro game library.
If you have heard of it but haven't checked it out for a while, have another look. Kitao has been absolutely slaying it, and pyxel now has a really nice editing tool that covers images, tiles, sounds, and music. It also has some stubs and type annotations so everything works smoothly with your IDE.
There are a bunch of user made games listed here.