Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A 2D graphics/game library built in Python, on top of pyglet.

branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.md

pen-and-pyper

A 2D graphics/game library built in Python, on top of pyglet. It attempts to get around the Python GIL by running two separate processes: one which does all of the actual drawing, which I call the 'Paper', and one which does the heavy number crunching, which I call the 'Pen'. The Paper will do nothing except draw all the created entities, and listen to the simple commands sent by the Pen. For example: moving an entity, creating an entity, caching an image, etc. The Pen will calculate velocities, accelerations, collision, AI, etc. and send all needed commands to the Paper. This is likely to largely include movement commands as you control a player, AI moves enemies/NPCs around, effects of gravity, etc.

As of August 17, 2012 this library is in heavy development. That was the first commit, and it still has issues and plenty of room to improve.

On August 28, 2012 I made a large modification to the library. Now entities can interact with the two processes in a consistant way though using the 'Nibs' and 'Wells' API in engine.pennpaper.nibs.py. There is still some refactoring to be done in this API, especially since Wells.Create is used in multiple ways depending on what values you give to the Create function (eg: giving is a constructor will create a new entity in the pen process, while not giving it a constructor will create a sprite in the paper process). The pen process code also needs some more cleaning, especially _well_create. There are at least a couple things in the paper process that aren't implemented yet (I think, such as Nibs.Teleport). The really big feature that I need to put in next though is the notion of contexts: where different code and different entities are used depending on the current situation. A good example of this would be wandering around a dungeon, when you enter into a random battle. That's a completely different set of code, assets, etc. that need to be used, and having the ability to easily switch contexts handled by the underlying engine will be highly useful.

IMPORTANT NOTES

There are some pngs in the res directory which are specific to a separate project that I am working on. These will be removed eventually. The library is currently in very early development, and as such it has everything in it that I am using for testing various things. Also of note there is a png that I do not own, with 'claudius' in the name. I pulled it randomly off of Google, and I do not know who it belongs to. I am purely using it temporarily to test animation, and it will be removed as soon as is possible so as to not infringe upon another person's property.

Update on August 28, 2012: There are now a couple more image files which I will re-stress that I DO NOT OWN. These are PURELY here for testing until I am at a point where I will have my own art assets in place for testing, etc. I sincerely apologize if you find something in here that you made and do not want me to use. If I am asked, I will immediately remove any images and replace them with something else, likely my own bad programmer art.

Something went wrong with that request. Please try again.