PursuedPyBear

Logo

Unbearably Fun Game Development

PursuedPyBear

PursuedPyBear, also known as ppb, exists to be an educational resource. Most obviously used to teach computer science, it can be a useful tool for any topic that a simulation can be helpful.

A Game Engine

At its core, ppb provides a number of features that make it perfect for video games. The GameEngine itself provides a pluggable subsystem architecture where adding new features is as simple as subclassing and extending System. Additionally, it contains a state stack of Scenes simple containers that let you organize game scenes and UI screens in a simple way.

The entire system uses an event system which is as extensible as the rest of the system. Register new values to existing event types, and even overwrite the defaults. Adding a new event type to the system is as simple as firing an instance of your new event class with signal. Instead of a publisher system, the engine knows everything in its own scope and only calls objects with appropriate callbacks. The most basic event is Update and your handlers should match the signature on_update(self, update_event, signal).

Guiding Principles

Because ppb started to be a game framework great for learning with, the project has a few longterm goals:

Education Friendly

Non-technical educators should feel comfortable after very little training. While some programming knowledge is required, the ability to think in objects and responses to events allows educators to only focus on their lessons.

Idiomatic Python

A project built on ppb should look like idiomatic Python. It also should look like modern Python. As such, we often add new language features as soon as they’re available, letting a new user always know ppb runs on the latest Python.

Object Oriented and Event Driven

ppb games are built out of instances of objects. Each object only has enough information to respond to the event provided, which always includes the current BaseScene. Because ppb doesn’t have a master list of events, you can provide new ones simply to add more granular control over your game.

Hardware Library Agnostic

Because ppb strongly tries to be extensible and pluggable, each hardware extension can provide its own hooks to ppb, and you can nearly seamlessly switch between various Python libraries.

Fun

One of the maintainers put it best:

If it’s not fun to use, we should redo it

ppb is about filing off the rough edges so that the joy of creation and discovery are both emphasized. A new user should be able to build their first game in a few hours, and continue exploring beyond that.

Try it

Install ppb in the standard method:

pip install ppb

ppb provides a run function that makes it simple to start single screen games.

To make a very simple game, make a directory and add an image file called ship.png to it. Then add the following to a python file and run it.

import ppb
from ppb.features.default_sprites import TargetSprite


class Ship(TargetSprite):
    target = ppb.Vector(0, 40)


def setup(scene):
    scene.add(Ship(pos=(0, -7)))


ppb.run(setup=setup)

Compatibility

ppb is guaranteed compatible with Python 3.6 or later.

Get Involved

Before getting involved, you should read our Code of Conduct.

The fastest way to get involved is to check out the ongoing discussions. If you’re already using ppb feel free to report bugs, suggest enhancements, or ask for new features.

If you want to contribute code, definitely read the relevant portions of our Contributing guide.

Our Mascot

The bear in the logo is named Binny, and we have some facts about them

News

Binny's Birthday Jam

Happy birthday, Binny! 🥳

No Release, Try out ppb 1.0!

Keeping this short:

Help Make 1.0 the Best It Can Be

The official countdown to 1.0 has begun! Last night we released ppb v1.0b1! We really want 1.0 to be the best release ppb has every had, and so we need your help! You can get yourself a contribution credit (no contribution is too small!) and make ppb better at the same time.

PPB at PyCon US

We are very proud to announce that PursuedPyBear will be at PyCon US 2021, in booth and sprint forms!

June Solstice 2020 Release: More Rendering Options

This has been an exciting release cycle! Most of our focus has been on things interacting with the Renderer, so let’s go down the list.

Spring 2020 Release: PySDL

And we’re back! After a bit of a hiatus, the team has a new release for you. There’s two significant things to talk about: dramatic optimizations of the event dispatch, and replacing PyGame with PySDL2. This also allows Python 3.8!

Bug found with MacOS Mojave and PyGame

There have been problems found sometimes with the latest MacOS (Mojave) and PyGame 1. Specifically, it’ll look black until the user interacts with the window.

Fall Release: Assets and Sound!

The big headline is the Asset Revamp. Instead of just passing around strings (and the whole resource path concept), actual Asset objects are given to systems. (api reference, ) These are a mechanism for eager background loading of data.

Summer 2019 Release: PPB v0.6 and Vector v1.0

Good news, everyone! A release cycle has come to a close, resulting in ppb v0.6 and (drumroll please), ppb-vector v1.0, a stable release!

A new beta! 0.6.0b1

0.6.0b1 is now out! Want to try our new Animation feature?

PPB's new release schedule

Ok, so the PPB project has had a bit of a problem where we go too long between releases, and as the pile of unreleased features and changes grows, we get the question:

PPB v0.5.1 Released

The development team has been hard at work improving ppb-vector, but we reached a place where releasing a new version of ppb-vector would break ppb. So we’ve pinned ppb-vector in 0.5.1 to the prerelease versions of ppb-vector. Congrats, your code should just keep working!

PPB v0.5 Released

We went for a smaller release, but we got a lot done for it only being a few months. The most important bits are that all of the input events are in! Some cool stuff includes sprites scaling automatically and a new way to move between scenes that uses the event system. That means the old method is officially deprecated.