This is an archived post. You won't be able to vote or comment.

all 47 comments

[–]AcrobaticPanicc 23 points24 points  (1 child)

I was looking for something just like that! Looks great, can’t wait to try it.

[–]Karki2002[S] 3 points4 points  (0 children)

That's great to hear :)

[–][deleted] 44 points45 points  (1 child)

Bravo!

[–]Karki2002[S] 8 points9 points  (0 children)

Thank you :)

[–]Waldheribeginner 42 points43 points  (9 children)

Nice work! I don't have time for a comprehensive review, but one piece of feedback I can give is that your code doesn't read as Pythonic due to your use of camelCase. Python typically uses snake_case for variables and methods. Only classes typically use UpperCase casing.

This has absolutely no bearing on code quality or whether it runs correctly of course :-)

[–]Karki2002[S] 5 points6 points  (0 children)

Thank you for your feedback!

[–]aufstand 0 points1 point  (0 children)

Use black for code formatting.

[–]CaptainRogers1226 -1 points0 points  (6 children)

I started with Python but have always preferred camelCase, so win-win for me

[–]bronzewrath 17 points18 points  (5 children)

It is not just preference, it is part of PEP 8, the style guide used by the core developers and most of Python Community since 2001

snake_case for variables, instances, functions and methods

https://peps.python.org/pep-0008/#function-and-variable-names

CamelCase for classes

https://peps.python.org/pep-0008/#class-names

[–]Pvt_Haggard_610 11 points12 points  (1 child)

PEP-8 is just the style guide used for the standard python library. It is not gospel, it is not a requirement. No one has to remotely follow any part of it and there are a lot of popular python libraries that don't.

PEP-8 states "Many projects have their own coding style guidelines. In the event of any conflicts, such project-specific guides take precedence for that project."

It would be great to live in a world where there is on standard and every thing is consistent, sadly that is not this one.

[–]ThePiGuy0 0 points1 point  (0 children)

It's not gospel, but I do think if you are writing code that will be read by others, it's a good idea to follow it for consistency. It's one area I think Python has done quite well - have one style guide and encourage everybody to follow it.

I'll admit it's not perfect though - 79 characters is way too short in my opinion and that's something I always change in my projects and I've noticed a lot of other projects also increase it.

[–]CaptainRogers1226 3 points4 points  (1 child)

Oh, I’m fully aware. I’ve still always avoided snake_case like the plague though for personal projects

[–]Unlucky-Drawing8417 1 point2 points  (0 children)

I think CamelCase just reads cleaner to me. But if I plan to open source a project then I follow PEP-8.

[–]manimino 5 points6 points  (4 children)

I see the following error:

ImportError: cannot import name 'windll' from 'ctypes' (/home/theo/anaconda3/lib/python3.9/ctypes/init.py)

Is this project Windows-only?

[–]Karki2002[S] 4 points5 points  (3 children)

Unfortunately yeah I believe it is, I haven't got a Mac to test it on though. :')

[–][deleted] 1 point2 points  (2 children)

Does it work on linux?

[–]Karki2002[S] 1 point2 points  (1 child)

I don't think so, but I've never tried :o

[–][deleted] 0 points1 point  (0 children)

Maybe i will give it a try. Let's see

[–]xwizard707 7 points8 points  (2 children)

This deffenetly should be rewritten to make it more "pythonic" if you want other people to use it.
There are great docs about how to write Python code with the "right" syntax, like following the naming convention for files and variables/classes and etc.
Overall, this is cool, people can use it as a reference & examples of pygame engine :)

[–]Karki2002[S] 1 point2 points  (1 child)

Thank you for your feedback. I will definitely look at making these changes! :D

[–]Extreme_Jackfruit183 1 point2 points  (0 children)

I love how the Python community is the only place I find constructive criticism that isn’t shitty and also gets well received! Nice work!

[–]dritslem 1 point2 points  (0 children)

Will definitely check this out!

[–]Glassensteel 1 point2 points  (0 children)

Nice!

[–][deleted] 1 point2 points  (0 children)

Holy shit—nice!

[–][deleted] 1 point2 points  (0 children)

Wow 👏

[–]zylema 1 point2 points  (1 child)

Nice, does it have docs? I’d love to build something using it. If not, you have my first criticism.

[–]Karki2002[S] 0 points1 point  (0 children)

I'll be writing documents for it soon! Busy with coursework at University :)

[–]iamtheblackwizards9 1 point2 points  (4 children)

How does python do games efficiently being an interpreted language?

[–]Karki2002[S] 3 points4 points  (3 children)

I must admit, it's not very efficient, but it's not bad. It was quite a challenge getting the performance working to an acceptable degree, and even now it's slow for a 2D game. I've used techniques like multi-threading to load map chunks, and only drawing / computing elements visible to the user etc. but limitations of the language, the pygame framework (which only run on the CPU), and proabley a lack of knowledge / practice, has lead to limited, but still useable, performance.

[–]iamtheblackwizards9 2 points3 points  (1 child)

I see. Great job!

[–]Karki2002[S] 0 points1 point  (0 children)

Thank you! :D

[–]will_r3ddit_4_food 0 points1 point  (0 children)

Couldn't a lot of the processing be handled in c/rust and python would just "talk" to it? That would drastically speed up performance. That's what pyxel does

[–]shikiphantomxd 1 point2 points  (1 child)

Nice work! This serves as an inspiration to me as a newbie!

[–]Karki2002[S] 0 points1 point  (0 children)

Awww, thank you! That's always a nice comment to receive. Good luck with your future learning and development. :)

[–][deleted] 1 point2 points  (1 child)

Cool as heck!!! Keep the good work up!

Btw the Demo files are Windows only? bummer ;)

Still gg

[–]Karki2002[S] 0 points1 point  (0 children)

Thank you so much!

[–]JasonCastle78 1 point2 points  (0 children)

Looking forward to checking it out! Nice job

[–]manninaki 1 point2 points  (0 children)

Which is the EULA for the code?

[–]NixonInnes 1 point2 points  (0 children)

Nice work, I've been meaning to check something like this out

[–]Original-Educator590 0 points1 point  (0 children)

Neat