A repository for short pygame drafts, examples, tutorials and more!
Currently, this repository contains a draft lighting system, a particle system, a networked game, and more.
To get a copy of this repository, simply open up git bash in an empty folder and use the command:
$ git clone https://github.com/rbaltrusch/pygame_examples
Dependencies can be installed using the requirements.txt as below:
pip install -r requirements.txt
To run some of the examples, navigate to the respective folder in the code folder, then run main.py.
This repository contains the following small pygame examples:
- Particle system: contains a simple, but effective, particle system implementation.
- Game console: contains a minimal implementation of an in-game console.
- Animation testing tool: can be used to test out animations. Contains a fully featured in-game console with a decoupled and flexible design.
- Networked game: contains a minimal implementation of a networked game, featuring one external server and two separate clients, communicating with each other through the server.
- Dynamic lighting: contains a small draft implementation for dynamic in-game lighting.
- Squish and stretch: contains an example implementation of squishing and stretching an image.
- Timed events: contains an implementation of callbacks executed after a specified delay. Not pygame-specific.
- Random starry sky: generates a random starry sky.
To contribute to this repository, please read the contribution guidelines.
Written in Python 3.8.3.
This repository is open-source software available under the MIT license.
Please raise an issue for code changes. To reach out, please send an email to richard@baltrusch.net.