Other libraries like Pygame Zero¶
Pygame Zero started a trend for Python “zero” libraries. Our friends have created these great libraries. Some of these can be combined with Pygame Zero!
Network Zero¶
Network Zero makes it simpler to have several machines or several processes on one machine discovering each other and talking across a network.
Caution
If you want to use Network Zero with Pygame Zero, make sure you don’t let
it block (stop everything while waiting for messages). This will
interrupt Pygame Zero so that it stops animating the screen or even
responding to input. Always set the wait_for_s
or wait_for_reply_s
options to 0
seconds.
GUI Zero¶
GUI Zero is a library for creating Graphical User Interfaces (GUIs) with windows, buttons, sliders, textboxes and so on.
Because GUI Zero and Pygame Zero both provide different approaches for drawing to the screen, they are not usable together.
GPIO Zero¶
GPIO Zero is a library for controlling devices connected to the General Purpose Input/Output (GPIO) pins on a Raspberry Pi.
GPIO Zero generally runs in its own thread, meaning that it will usually work very well with Pygame Zero.
Adventurelib¶
Adventurelib is a library for creating making text-based games easier to write (and which doesn’t do everything for you!).
Writing text-based games requires a very different set of skills to writing graphical games. Adventurelib is pitched at a slightly more advanced level of Python programmer than Pygame Zero.
Adventurelib cannot currently be combined with Pygame Zero.
Blue Dot¶
Blue Dot allows you to control your Raspberry Pi projects wirelessly using an Android device as a Bluetooth remote.
Blue Dot generally runs in its own thread, meaning that it will usually work very well with Pygame Zero.
Caution
Avoid time.sleep()
function calls, while True:
loops and Blue Dot’s
blocking wait_for_press
and wait_for_release
methods, as these will
stop Pygame Zero animating the screen or responding to input. Use
Clock functions instead to call functions periodically, or the
update()
function to check a value every frame.