Pages

sâmbătă, 7 noiembrie 2020

PyGame : The new pygame 2.0 .

A few days ago PyGame celebrated the anniversary of this python module ...
The 28th of October 2020 is the pygame 2.0 release date because pygame turns 20 years of age.
Here's what we find for pygame on GitHub.
Here are some of the 3306 changes...
  • 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.
  • SSE2/Neon assembly image drawing. Much faster drawing routines, image loading, and alpha blending.
  • Type Hints, for code completion (and to help you make the squiggly lines disappear) in editors and IDEs.
  • Code cleanup, using lots of code robustness tools like static analyzers, and automated CI/CD. We've been able to help dozens of people new to community projects contribute. We have lots of work to go on code quality, but we're currently the highest rated Python and highest rate C large project on LGTM.
  • Many, many bug fixes including in our pygame.draw routines, pygame.math(for vectors), and pygame.mask for pixel-perfect collision detection.
  • better support for PyPy (the fast JIT based implementation of python). See our milestone
  • Are we pypy yet? No. for our progress on making PyPy the best python for games.
  • libsdl version 2 support. Technically pygame 2.0 still works with SDL 1, but we recommend SDL2 which is vastly improved over SDL1 for most use cases. Probably we will remove SDL 1 support starting pygame 2.1.
  • Touch support (multitouch, gestures, etc)
  • Audio input support (make games with your microphone!).
  • Message alert boxes (Press OK, or Cancel).
  • Better keyboard support. Proper Unicode input and IME support.
  • Much improved game controller support.
  • Better image and audio format support. Including webp, 32bit Wav files, and much more reliable mp3 support.
  • Multiple display support, and multiple window support (multi-window support is still experimental, more will come in pygame 2.1).
  • Android support through python for android (a fork of pygame subset for android). Better documentation and better support will come in future releases.
  • to make distributing your apps easier, a built-in "pyinstaller hook" and compatibility with cxfreeze.
  • binary "wheels" on many platforms and versions of python from the old python 2.7 - to the latest python 3.9 (and with pypy!).
  • lots of quality of life improvements like Surface.fill('black')instead of Surface.fill(pygame.Color(0, 0, 0)). Also, keywords are supported by many more function arguments. You can draw rounded corners on rects.
  • plenty of new examples, like, and python3 -m pygame.examples.music_drop_fade. Additionally, the example source code has been cleaned up a lot to follow a more current python style.
  • Hundreds of documentation improvements include a new Korean tutorial.
  • a special SCALED mode that takes low pixel games and automatically translates them to a larger window. Imagine your 320x200 resolution game of glorious pixel art... on modern screens that would be a very tiny window. Now with SCALED, it shows up big on a Full HD screen, or even a 4K/8K screen and the translation of mouse coordinates and up-scaling of pixels is done for you (hardware accelerated of course).