[HN Gopher] Pygame in All the Languages
       ___________________________________________________________________
        
       Pygame in All the Languages
        
       Author : Tomte
       Score  : 34 points
       Date   : 2022-06-18 16:15 UTC (2 days ago)
        
 (HTM) web link (www.pygame.org)
 (TXT) w3m dump (www.pygame.org)
        
       | bodge5000 wrote:
       | Anyone here have any experience with PyGame? Much as I love
       | Godot, I've been wanting to have a go at some frameworks for some
       | time, and as I already know Python it might be a good fit. That
       | being said, I dont hear much positivity about it, and as shallow
       | as I know this is, the general look of the website doesn't fill
       | me with confidence. But its also been around for long enough and
       | seems to have enough users, despite the competition that engines
       | bring for new users, that it can't be all that bad.
        
         | Tyr42 wrote:
         | I have had a heck of a time trying to update pygame when
         | running on a raspberry pi, and since it wasn't critical (mostly
         | displaying a splash screen and QR code) am looking into
         | replacing it.
        
         | joaopaulomcc wrote:
         | Depending on what you want to do, Arcade
         | (https://api.arcade.academy/en/latest/) may be a good option
         | too. I enjoy using it for my simple projects.
        
           | iamcreasy wrote:
           | Never heard of it. Thanks for sharing. How does it compare to
           | PyGame?
        
             | joaopaulomcc wrote:
             | Arcade has, in my opinion, better documentation and some
             | useful features like tile map support and a physics engine.
             | The developers of Arcade provide a more detailed comparison
             | in this page:
             | https://api.arcade.academy/en/latest/pygame_comparison.html
        
         | deckiedan wrote:
         | It's great for teaching kids / teaching yourself /
         | experimenting with game engine / concept stuff.
         | 
         | It has image loading / blitting on screen, etc, input, etc, and
         | you can do a lot with it, but it will be all pretty manual.
         | Which can be a lot of fun. But it's not a "framework" like
         | django is a web-framework. It doesn't give you any higher
         | abstractions at all (sprites, animations, objects, maps /
         | levels, etc...)
         | 
         | I like it, for teaching my son to code, having fun hacking easy
         | oldschool 2d games in it.
         | 
         | Another more "modern" alternative might be https://love2d.org/
         | - I've played with it a few years ago briefly, and may well
         | look at it again some day. It certainly seems to have a more
         | active community than pygame - but is `lua` not `python`.
         | 
         | Neither have the greatest distribution / mobile story in the
         | world, there are... options... worth checking that stuff before
         | choosing a system to build in if that's important to you.
        
         | shantnutiwari wrote:
         | PyGame is very basic- just a graphics library with some
         | wrappers. Personally, not a fan of it though Im primarily a
         | Python programmer.
         | 
         | I dont use Javascript much, but Phaser is a joy to use and I
         | wish we had something like that in Python. There is Arcade, but
         | they keep breaking the code.
         | 
         | Godot-- I liked for simple cases and games, but it became very
         | hard for complex projects (Ive heard the same complaint about
         | Unity)
        
           | jan_Inkepa wrote:
           | Pygame might be basic, but I remember it as being the single
           | best/easiest tool for interfacing with (USB) MIDI-instruments
           | - I remember it being really easy to whip up scripts to take
           | MIDI input from a keyboard, mess with them, and present them
           | as a new MIDI-device. I never used it for games (I'm a game
           | developer), but for specifically the case of MIDI it was
           | great. Make of that what you will!
        
           | drivers99 wrote:
           | > PyGame is very basic- just a graphics library with some
           | wrappers
           | 
           | I remember using it to interface with a game pad (xbox
           | controller) too. The first two things I wrote in python were
           | complete by small games (e.g. tetris clone with accurate
           | rules, and an entry for Ludum Dare) and it had everything I
           | needed.
        
         | DizzyDoo wrote:
         | 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/
         | 
         | [1] - https://twistedmatrix.com/trac/
         | 
         | [2] - https://www.pypy.org/
        
           | sitkack wrote:
           | The 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.
        
       | Georgelemental wrote:
       | * Human languages, not programming languages
        
       ___________________________________________________________________
       (page generated 2022-06-20 23:02 UTC)