16 ms·
Pygame 2.0
- n3k5 6y agoGreat news! There were 5+ years during which I warned people away from Pygame. First there was no official release with Python 3 support in sight. Once that happened, I was disappointed that it still used the old SDL, which was utterly obsolete by then. The last area I'd like to see improved is the documentation. But the list of stuff that did get done over the last couple of years looks fantastic. Thanks to all the contributors; I'm looking forward to kicking 2.0's .whls.
- nosefrog 6y agoNice! The first real game I ever made was with pygame :) https://github.com/samertm/snake-python https://github.com/samertm/snake-python
- nurettin 6y agoMade this in a few days (it is a tetris which starts shaking, rotating, inverting and solarizing the area as you pass levels) https://github.com/nurettin/tedriz https://github.com/nurettin/tedriz I don't know if pygame is really easy or if I got pretty good at coding in python. Probably the former.
- xiaodai 6y agoAny good commercial games released?
- nxpnsv 6y agoI have no idea, but to me the opposite of good commercial games is the point here. What is not to love about a title such as mediocre tetris: https://www.pygame.org/project/5421/7844 https://www.pygame.org/project/5421/7844
- billfruit 6y agoI have heard that "Unity of Command", the WW2 themed wargame was built in pygame.
- rincewind 6y agoThis comes to mind: https://store.steampowered.com/app/951360 https://store.steampowered.com/app/951360
- mkl95 6y agoDaFluffyPotato also shares his Pygame work on Twitter, if you are interested in professional Pygame development his timeline may be worth checking * * https://twitter.com/dafluffypotato?lang=en https://twitter.com/dafluffypotato?lang=en
- nodja 6y agoThis is cheating, but renpy is based on pygame. So tons of visual novels are technically made in pygame, the most popular is probably Doki Doki Literature Club.
- sourceless 6y agoFantastic! Feels like it's been a dead project for so long, it's good to see it's properly back and fully modernized.
- Tepix 6y agoPygame is great, I've used it for a one day gamejam and despite not being familiar with it, i was up and running quickly.
- kleiba 6y agoAs coincidences go, just the day before yesterday I looked into pygame and came across this Quora question: https://www.quora.com/Is-Pygame-fast-enough-for-modern-game-development https://www.quora.com/Is-Pygame-fast-enough-for-modern-game-... The sentiment seems to be that it's not suitable for more than small toy games -- which in itself would still be interesting. I mean, it's clear that professional AAA studios are not the core target group. But has anyone here on HN additional hands-on experience that would support or reject the above assessment?
- csande17 6y agoI've done a fair amount with Pygame. It's great for learning the fundamentals of 2D graphics and little toy games, it works well for writing simple programs to do things with image data, and I imagine you could use it to pretty easily get an OpenGL window to draw into. I would not recommend using Pygame to develop a serious game project. All of Pygame's provided functions use software rendering, so you won't be able to take advantage of the graphics card. More seriously, Pygame includes essentially none of the features that come out of the box in a modern game engine, so you have to do things like write the event loop yourself and find your own solutions to physics and animation and figuring out which UI element is currently under the mouse cursor. Great for learning how that stuff works, not great for getting a high-quality game shippable.
- vanderZwan 6y agoAre you sure you're not talking about an older version of Pygame regarding the software rendering? I haven't used it but the very first bullet point in the list of changes of this release says: > Support for Metal, Direct 3d, Vulkan, OpenGL 3.0+ in various profiles (core, compatibility, debug, robust, etc), OpenGL ES, and other modern hardware accelerated video APIs across many platforms.
- rincewind 6y agopygame team member here There's an important caveat: We provide an API for the SDL2 render system, and some functionality for up-scaling pixel art games on the GPU, but existing pygame 1.x games won't magically become faster by running on PyGame 2.0. They will be a little faster, because we have new, optimised blitting and drawing routines. To make use of GPU-based rendering, you will need to use the new APIs.
- hsbauauvhabzb 6y agoI self learned pygame in high school, 15 years later I’m still using it for mapping and rendering - I probably shouldn’t, but I find the library just so damn intuitive. Congrats To the pygame team, and thank you for being the core tool which truly taught my objective code, and many UI design concepts (:
- themodelplumber 6y agoThat's cool, what kind of mapping and rendering are you doing with it?
- hsbauauvhabzb 6y agoAgain things I shouldn’t be using it for. I plotted latency/ping on a map When I was having pretty bad internet trouble in early Uni. I rendered some pixel-perfect shapes when building a stub website (At the time I didn’t know how to use Inkscape). I think at some point I visualised exponential mathematical algorithms too. My initial project was to build a media center similar to Kodi. It was horrible, pseudo-objective, and built UI components from event and pixel blitting primitives. It was a year 12 project (in a ‘pick your project’ non IT class). It probably actually pushed me to complete year 12, and gave me a good foundational basis for IT at uni. I was a ‘troubled’ student who hated school, was bullied pretty bad, and hung out with people actively abusing drugs and alcohol. 15 years on am thankful I’m not a methhead, I’m sure that Kodi project had a part in saving me no matter how unstable and poorly written it was.
- sebastian_j 6y agoWow, this is still being worked on? Amazing, keep up the good work!
- alpanka 6y agoHas anyone tested the android support? It could be an interesting tool for prototypes.
- jokoon 6y agoI highly doubt it's possible to do Android stuff with toys, I'm still curious to learn otherwise.
- bane 6y agoAny uses of it for things that aren't games?
- flobosg 6y agoImpressive (http://impressive.sourceforge.net http://impressive.sourceforge.net) is a PDF slideshow viewer based on Pygame.
- mattkrause 6y agoWe used it (first directly, and then via PsychPy) for running vision experiments. You need to be a little careful about timing, but otherwise it's not bad....
- wegs 6y agoMy wishlist: * Integration with numpy/scipy/matplotlib/etc. * Integration with Python Mode for Processing * Integration with either the Arduino or the Micro:bit ecosystem * Integration with Pygame Zero (so there are smooth, documented ways to transition -- low floor/high ceiling, rather than two modes of working) * Eventually, integration and wrapping of OpenCV In other words, Pygame would benefit from integrating with the broader ecosystem one might wish to use to teach kids to code. Writing games involves a lot of math, image processing, and similar, and 2020 computers are fast enough kids can do that without writing optimized assembly. It's nice if games can be physically embedded (Arduino/Micro:bit). Right now, there's a collection of projects, but they don't play well together. The level of contortions one must go through to move a sprite from being a numpy array to an image in whatever library, to an image in another library, is well beyond what most kids (or even teachers) can handle.
- ngcc_hk 6y agoAre you serious? At least opencv is odd ...
- notpygame 6y agoA pygame volunteer here. Wish lists are fun. True, integration is important. We should do more. Luckily some of yours already came true! :) For image sharing, there's a surfarray, and sndarray modules for integration with numpy. pygame.image.frombuffer/tobuffer to going to and from buffers. PIL(low), opencv, and other python image and audio libraries can be used pretty easily this way. There's articles, books and videos on how to integrate with most other libraries. Since python 3.3 or so there's been a much better buffer interface at the C and python API levels which many python libraries are using for integration. There's currently a gap in typing around this, but there's some progress. If you don't like the 11MB download for numpy, we have a builtin pixel array module that can do a lot of the same stuff for images. There's also some built in Vector math objects (modeled closely on the GLSL ones). The pixel array stuff is usually a hit in class settings because doing visual affects is very easy to write. As you say, computers are fast enough. Better (although more advanced) is probably the shadertoy website :) Mu Editor, has built in support for pygame/pygame zero. It even comes with a pygame+arduino example. There's tutorials about for teaching it with microbits (and other little devices). CircuitPython comes with some built in game libraries. This is probably better to use than pygame. It's best place to look probably for python on micros if you're into crafting games on very small devices. pygame comes preinstalled with raspberry pi, so that's also an option considering some of them can be found for $5 (or for free if you go hunting around dusty drawers). We have some Python Mode for Processing users. There's a big community of video artists using pygame, and pygame comes built into some of the most popular video synths in recent years. Python Mode for Processing does a lot of cool things right, and is definitely better than pygame for what it does. It would be great if some of the integration work done in this direction would continue. It's one of the most compact and readable ways to go. pygame zero follows this style a little bit, but being able to reuse code and concepts from both communities is even better.
- vadim788 6y agosadf
- wpietri 6y agoIt's really nice to see how type hints are spreading. I've been surprised how natural my adoption of them has been.
- nitred 6y agoIndeed! I despised them initially thinking typing made code unreadable. But I've grown used to it and I only use type hints when necessary. I use Pydantic when I need more than just "hints" and when validating config file schemas.
- EamonnMR 6y agoPydantic is extremely useful for validation and tab-completion. We've begun using it everywhere.
- biryani_chicken 6y agoPygame was one of my initial drivers for learning Python then using Linux and become a professional programmer. Congratulations!
- intrepidhero 6y agoCirca 2007 I started messing with pygame. Just this week I dug up some of my old code and typed `python main.py` thinking, no way this'll work. But it did. The first feature on the Pygame 2 page is "Backward compatibility". Pygame's been way behind the times and I'm excited to see it getting some attention. But major kudos to the team for maintaining that priority.
- deleted 6y ago[deleted]
- johnfn 6y agoAn alternative, but much more disappointing explanation for this is that Pygame saw almost no development from '09 until about a year ago: https://github.com/pygame/pygame/graphs/contributors https://github.com/pygame/pygame/graphs/contributors
- pierrec 6y agoIt's a valid theory, but the page you linked says 2.3k commits over that period. More than enough to annihilate backwards compatibility unless you're very deliberate about it.
- fictorial 6y agoBlast from the past. I created a simple UI system for pygame a long time ago. It would be fun to hack on that again. https://github.com/fictorial/pygameui https://github.com/fictorial/pygameui
- rafaelvasco 6y agoWow. Pygame was one of my first forays into game development. I'm emotional now.
- albertzeyer 6y agoI think Python Arcade (https://github.com/pythonarcade/arcade https://github.com/pythonarcade/arcade) is/was a bit more active, right? https://arcade.academy/pygame_comparison.html https://arcade.academy/pygame_comparison.html When I checked PyGame, that was ages ago, and it looked a lot like a (higher-level) SDL wrapper to me, but more Pythonic. Although, coming from C++ and having used SDL before, I decided to use a more direct SDL wrapper instead. So I created my own simple ctypes-based wrapper (https://github.com/albertz/PySDL https://github.com/albertz/PySDL). But this is not really updated, and there are newer ones (e.g. https://github.com/marcusva/py-sdl2 https://github.com/marcusva/py-sdl2). Anyway, I don't want to say these are better. It's great that PyGame is still active (again). It's great to have such simple libraries to write games. Also for educational purpose, or just for fun. E.g. I wrote this (https://github.com/albertz/PyOverheadGame https://github.com/albertz/PyOverheadGame).
- colordrops 6y agoI put together a halloween display using a Kinect and pygame for my front yard (very quickly hacked together by the way): https://github.com/erahhal/kinect-halloween-skeleton https://github.com/erahhal/kinect-halloween-skeleton Pygame is nice and easy to use, though I think I'd go with something else next time, as it doesn't support multiple monitors or OpenGL very well. I see OpenGL stuff at the top of the Pygame 2.0 change list so maybe worth checking out.
- notpygame 6y agoIt supports multiple monitors and has better OpenGL support now.
- colordrops 6y agoI've looked in the docs for multi-monitor support without luck - do you have a link?
- nightowl_games 6y agoPygame sounds cool. All I want to know is what platforms does it support, suprised they dont list that anywhere easy to find. This blog based project home page obscures the relevant in favor of the recent. Found the relevance on the About page. "Pygame is highly portable and runs on nearly every platform and operating system." Would appreciate a list but Ok. Oh snap here we go: "Truly portable. Supports Linux (pygame comes with most main stream linux distributions), Windows (95, 98, ME, 2000, XP, Vista, 64-bit Windows, etc), Windows CE, BeOS, MacOS, Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX. The code contains support for AmigaOS, Dreamcast, Atari, AIX, OSF/Tru64, RISC OS, SymbianOS and OS/2, but these are not officially supported. You can use it on hand held devices, game consoles and the One Laptop Per Child (OLPC) computer." Wonder if it supports an HTML player?
- slazaro 6y agoI don't know specifically about pygame, but since it uses SDL, and SDL can run in browsers using emscripten, I wouldn't be surprised.
- m463 6y agoI've written a lot of stuff in pygame on the pi. The major issue I ran into was no hardware acceleration, so performance came from (software) blits of only the updated part of the screen and similar techniques. But I found it very fun to program in an environment with integrated graphics and sound and fonts and video and input devices and a event loop with timer ticks. A lot of linux folks are thinking x vs wayland, but I'll bet if we replaced everything with an integrated environment that had everything necessary to support a game, we would have much better linux user interfaces.
- tmabraham 6y agoWhen I first learned Python (2.5, so old!), pygame was my introduction to programming GUIs, sounds, and games. I learned a lot about Python using pygame. I am surprised to see it's still going fairly strong!