A Pygame framework that facilitates the creation and development of projects https://shampoo.ooo
Go to file
Frank DeMarco ff50528e09 user-event-id renamed to custom-event-id 2012-07-31 14:44:26 -04:00
pgfw user-event-id renamed to custom-event-id 2012-07-31 14:44:26 -04:00
.gitignore Initial commit 2012-07-05 17:21:49 +09:00
README TypeDeclarations reads declarations from dict 2012-07-31 14:40:31 -04:00
sample.py Initial commit 2012-07-05 17:21:49 +09:00

README

----------------
Pygame Framework
----------------

Classes that facilitate the creation of Pygame projects


Example
=======

Save and run the following script to create a project that redraws a square at a
random location every second.  This script may also be found in the `sample.py`
file.

from time import sleep
from random import randint

from pgfw.Game import Game

# inheriting from Game allows you to customize your project
class SampleGame(Game):

    square_width = 30

    # update runs every frame (a.k.a. the mainloop)
    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[0]), randint(0, bounds[1]),
                     self.square_width, self.square_width))


if __name__ == '__main__':
    # the play method begins the project's animation
    SampleGame().play()


License
=======

This software is dedicated to the public domain.  See
http://creativecommons.org/publicdomain/zero/1.0/ for details.


Contact
=======

frank dot s dot demarco at gmail
http://usethematrixze.us