pygame_examples
pygbag
pygame_examples | pygbag | |
---|---|---|
6 | 6 | |
23 | 271 | |
- | 3.0% | |
5.6 | 9.1 | |
5 months ago | 6 days ago | |
Python | Python | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
pygame_examples
-
Cloth simulation with custom physics (source in comments)
Feel free to try out the project - as always the code is fully available here.
-
Asynchronous event handling example
As always, the full source code for the mentioned event handling technique can be found here.
-
Evolution simulation (explanation and source in comments)
As always, the code is open source and available here
-
Played around with some light particles (source in comments)
A little while ago, I already wrote a little light source experiment (code here), and while that worked fairly well, I wanted something a little more sophisticated (both in looks and functions), so I decided to try out a simulated particle based approach. It turned out to look like a fairly standard particle effect, with some glow around the particle (plus collisions with the screen boundary), which is not completely what I wanted, but I am happy with it anyway (plus it ended up being fun to mess around with it, as I do here in the video).
-
Made an in-game command console
The source code is available here. The console uses a standard argument parser from the python standard library module argparse. When a command is entered, the argument parser parses the results and pumps an event out to the event queue. Any functions with subscribed to this event then get called.
-
Pygame music visualisation
This is just a short draft based on some particle system code. I might flesh it out a bit more by adding more live-performance elements, or may automate the performance bit by integrating it with some music-analysis code.
pygbag
-
Playable Sandbox Now Available
Due to pygbag#16, the built-in function does not work correctly in the pygame-wasm environment. I noticed the patch to set_timer was buggy, so I made an improvement to the patch by handling other behaviors mentioned in the docs (e.g. disabling the timer and discarding an old timer for the same event).
-
Questions about pygame
Github for pygbag: https://github.com/pygame-web/pygbag
-
Getting a game using multiple libraries on a browser?
On pygbag, numpy(3.10) and pymunk(3.11) are supported but not on the same python version. for other packages have a look here https://github.com/pygame-web/archives/tree/main/repo/pkg and for missing ones make requrests here https://github.com/pygame-web/pygbag/issues/37 and possible add a use case to help with porting.
-
Running Pygame in the browser with Pygbag
if you need more modules just drop a note here https://github.com/pygame-web/pygbag/issues/37
-
How to host python game on website
Basically you can, recently a package that has also been added to `pygame/pygame-web` allows you to create all the necessary assets to be able to run a `pygame` game in a browser. The library is called `pygbag`: https://github.com/pygame-web/pygbag you can read about it there, it still is in a bit of an experimental stage so if you have questions, I'd suggest you joining the `pygame` discord server and ask questions in the `#pygame-web` channel. This is pretty exciting, you can see examples of this here: https://pmp-p.github.io/pygame-wasm/, these also have a console added and other stuff but it can be made to be a fullscreen thing too.
What are some alternatives?
gamma - A simple ECS game engine for Python, built on Pygame, with an emphasis on ease of use.
example-fine-grained-authorization - Leverage actions, custom metadata, and claims for attribute-based access control
youre-the-os - A game where you are a computer's OS and you have to manage processes, memory and I/O events.
bansoko - Space-themed :rocket: Soko-Ban :video_game: clone created in Python using Pyxel.
Hilbert-Curve-space-filling-with-pygame - Hilbert Curve Fractal with pygame (python)
HeartbeatEngine - A Visual Novel / Dating Sim game engine written in Python using Pygame, with a full editor written in PyQt5
archives - archived prebuilts
empack - Tools to pack a conda / mamba environment into a JS & WASM bundle
archives - My cloud storage