|ohsqueezy 2bbdc9a702||1 month ago|
|pgfw||1 month ago|
|.gitignore||11 years ago|
|LICENSE.txt||8 months ago|
|MANIFEST.in||11 years ago|
|README.md||1 month ago|
|__init__.py||8 years ago|
|sample.py||5 years ago|
|setup.py||11 years ago|
PGFW is a game framework that facilitates the creation and development of Pygame projects. It contains a class
Game which can be inherited and used as a project skeleton. There are classes for features such as sprites, animations, audio, b-splines, geometry, and screen capture. It is a collection of code used in previous projects with a focus on creating 2D games. Some examples of games using it are Picture Processing, Scrapeboard, and Cakefoot.
- Python 3+
- Pygame 1.9+
Start a project
Clone the repository (or download and unzip it)
git clone https://open.shampoo.ooo/shampoo/pgfw
Save the following script at the root of the repository to create a project that redraws a square at a random location every second. The project can be run with
python3 [SCRIPT]. Maybe some cats may even like this game. This script is also available in sample.py.
from time import sleep from random import randint from pgfw.Game import Game class SampleGame(Game): square_width = 30 # instructions in the update method automatically run once every frame def update(self): sleep(1) screen = self.get_screen() bounds = screen.get_size() screen.fill((0, 0, 0)) screen.fill((255, 255, 255), (randint(0, bounds), randint(0, bounds), self.square_width, self.square_width)) if __name__ == '__main__': SampleGame().run()
To further build this example, the Pygame API and classes in pgfw/ could be imported and used directly in the update function.
Unrestricted use, under the zlib license, see LICENSE.txt