A convenient 2D OpenGL games framework
A fast, cutting-edge 2D game engine for Python.
Current features include:
- Sprites, text, and stroked and filled polygons - all rotatable, scalable, and colorizeable
- A coroutine programming model for easy animated effects.
- Particle systems
- Built-in post-processing effects using GLSL shaders.
- Sound, music and tone generation.
- Event driven input handling for keyboard and mouse.
- "Local storage" to easily save state.
Wasabi2D is based on moderngl, with pygame 2.0 for some supporting functions, and supporting APIs ported from Pygame Zero.
Draw a drop-shadowed circle that follows the mouse:
import wasabi2d as w2d scene = w2d.Scene() scene.background = 0.9, 0.9, 1.0 scene.layers.set_effect('dropshadow') circle = scene.layers.add_circle( radius=30, pos=(400, 300), color='red', ) @w2d.event def on_mouse_move(pos): circle.pos = pos w2d.run()
Use pip to install Wasabi2d from PyPI:
pip install wasabi2d
Please make sure your
requirements.txt pins a major version, as Wasabi2D may
continue to make breaking API and graphical changes in major versions.
Documentation is available at https://wasabi2d.readthedocs.io/
This screenshot shows off polygons, sprites, text and particle effects:
Roller Knight was an entry in PyWeek 28, written with Wasabi2D by Daniel Pope and Larry Hastings:
Spire of Chaos was another entry in PyWeek 28 written with Wasabi2D by Daniel Moisset:
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.