Skip to main content

PursuedPyBear

stable: Documentation Status

canon: Documentation Status

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 Scene. 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(position=(0, -7)))


ppb.run(setup=setup)

Depending on your operating system, you may need to install additional packages (see installation guide).

Compatibility

ppb is guaranteed compatible with Python 3.6 or later.

Get Involved

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 Contributing.MD

Release files for ppb 3.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ppb 3.2.0
File Size Uploaded
ppb-3.2.0.tar.gz 2.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for ppb 3.2.0
File Interpreter ABI Platform
ppb-3.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 2.6 MB

Release files / ppb-3.2.0.tar.gz

Download URL ppb-3.2.0.tar.gz
Size 2.5 MB
Tags Source
SHA-256 checksum
How to use checksums
f5366d34cc1ce6912774a37410db12e6088e0688b0e8f82e1359e7fc5c49a61d
BLAKE2b-256 checksum
How to use checksums
b1a92db7997e2757784dfc0838d3f08af284ec57d158075f7c839af464a0a0c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release files / ppb-3.2.0-py3-none-any.whl

Download URL ppb-3.2.0-py3-none-any.whl
Size 55.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
30f38c3045df887636659a3c5923e30396b1a60693cd619a60cc23efaa4040c4
BLAKE2b-256 checksum
How to use checksums
f6cf7e5d1364434db2102aea9e5f02ab2d2ffb58efb6763364575e6fe422cd7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release history Release notifications | RSS feed

This release

3.2.0 This release

2 release files

1.1

2 release files

1.0

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

1 release file

0.2.0

1 release file

0.1.0

1 release file

0.1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page