A Pygame framework that facilitates the creation and development of projects https://shampoo.ooo
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
ohsqueezy 2bbdc9a702 fix repo url 7 months ago
pgfw Merge commit '84d64' 7 months ago
.gitignore old print formatted 11 years ago
LICENSE.txt updated readme and license, fixed crash on non existing default asset folders 1 year ago
MANIFEST.in added distutils setup script 11 years ago
README.md fix repo url 7 months ago
__init__.py video recorder request; points; apply motion overflow 9 years ago
sample.py sound effect 6 years ago
setup.py added distutils setup script 11 years ago


Pygame Framework

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.


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):
        screen = self.get_screen()
        bounds = screen.get_size()
        screen.fill((0, 0, 0))
        screen.fill((255, 255, 255),
                    (randint(0, bounds[0]), randint(0, bounds[1]),
                     self.square_width, self.square_width))

if __name__ == '__main__':

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

Pygame powered