Skip to content

pyb2d/pyb2d

Repository files navigation

pyb2d

jupyter_integration

Micromamba + CMake Pip Documentation Status Binder Anaconda-Server Badge Anaconda-Server Badge Anaconda-Server Badge Anaconda-Server Badge Anaconda-Server Badge

Warning, this is a work in progress and all APIs are subject to changes! Nothing is stable yet.

Installation

Installing from conda-forge

One can install pyb2d and its dependencies via conda:

mamba install pyb2d -c conda-forge

Installing with pip

pyb2d can be also installed via pip (conda is recommended and should be preferred over pip)

pip install pyb2d

Installing from source

pyb2d can also be install it from the sources but you will first need to install dependencies:

mamba install cmake python numpy pydantic -c conda-forge

Then you can compile the sources (replace $CONDA_PREFIX with a custom installation prefix if need be)

mkdir build && cd build
cmake .. -D CMAKE_PREFIX_PATH=$CONDA_PREFIX -D CMAKE_INSTALL_PREFIX=$CONDA_PREFIX -D CMAKE_INSTALL_LIBDIR=lib
make && make install

Trying it online

To try out pyb2d interactively in your web browser, just click on the binder link:

Binder

Documentation:

The documentation can be found here. One should pay attention to the tutorials and the examples section.

Features:

  • Liquidfun Integration
  • Examples / Testbed for various backends:
    • pygame
    • kivy
    • jupyter (vian ipycanvas)
    • opencv (for gif-rendering only)
  • Fun Examples: The examples can be started from various backend: Below we show screenshots from the jupyter integration. These examples can be tried out online with Binder

billiard angry_shapes world_of_goo rocket

Resources

Jupyter Games

A medium blogpost about the Jupyter integration of pyb2d. Disclaimer: The article was written by @DerThorsten/@ThorstenBeier (the main author of pyb2d)

.

pythonbytes

The pythonbytes podcast talked about the jupyter integration of pyb2d:

Episode #264: of pythonbytes We're just playing games with Jupyter at this point

History

This project originated 2015 with the goal to create python bindings for liquidfun. The original work can still be found here: https://github.com/DerThorsten/liquidfun/tree/master/liquidfun/Box2D/pyb2d