3 ms·
Yeah, I've done some useful things with pygame. My game business almost entirely uses Unity, but I do find that Python is helpful for tool development as, like
by DizzyDoo 4y ago
Yeah, I've done some useful things with pygame. My game business almost entirely uses Unity, but I do find that Python is helpful for tool development as, like you, I know the language well. Often it's a lot speedier to write a quick visual tool in Python that generates a bunch of json data that gets loaded in as a text asset and parsed, than it is to write the same thing as an editor plugin (at least for me!) Using Python + pygame or Python + PySDL2[0] gets you rendering stuff on the screen and receiving input, fast.
I've also used the Twisted Matrix[1] for some online TCP-based game server work, and that was pretty positive, though the library is quite daunting to figure out. That was 8 years ago though, perhaps there are better libraries nowadays.
Writing an entire game in Python might be an uphill struggle though. The interpreter is really slow, so a JIT alternative like Pypy[2] is very necessary. On my game server project I remember having to use a combination of Pypy and writing the tightest inner-most parts of my simulation loop in Cython to get the server tick to the target. As much as I love Python, if you're comfortable with Godot, it's probably a better long term investment with fewer headaches along the way.
[0] - https://pypi.org/project/PySDL2/ https://pypi.org/project/PySDL2/
[1] - https://twistedmatrix.com/trac/ https://twistedmatrix.com/trac/
[2] - https://www.pypy.org/ https://www.pypy.org/
- sitkack 4y agoThe nicest part about using PySDL2 directly is that it uses ctypes, so you don't have to worry about compiling an extension module from CPython to SDL, which is often the most broken part of PyGame. PyGame IMO is a tire fire of frustration around installing it, then using it as the parameters are haphazard and ill documented. I already have SDL2 installed via homebrew on my M1 mac. It literally took 10 seconds to clone the PySDL2 repo, `pip install .` and run the helloworld.py example that renders a test image to the screen.