https://github.com/lordmauve/wasabi2d
Cutting-edge 2D game framework for Python
https://github.com/lordmauve/wasabi2d
game-engine opengl python python-game-development
Last synced: 25 days ago
JSON representation
Cutting-edge 2D game framework for Python
- Host: GitHub
- URL: https://github.com/lordmauve/wasabi2d
- Owner: lordmauve
- License: lgpl-3.0
- Created: 2019-08-04T11:23:15.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-03-30T23:25:33.000Z (about 1 month ago)
- Last Synced: 2025-03-31T05:07:35.257Z (about 1 month ago)
- Topics: game-engine, opengl, python, python-game-development
- Language: Python
- Homepage: https://wasabi2d.readthedocs.io/
- Size: 9.23 MB
- Stars: 158
- Watchers: 9
- Forks: 27
- Open Issues: 42
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 
  
[](https://discord.gg/jBWaWHU)
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](https://wasabi2d.readthedocs.io/en/latest/coros.html) for easy animated effects.
* [Particle systems](https://wasabi2d.readthedocs.io/en/latest/particles.html)
* [Built-in post-processing effects](https://wasabi2d.readthedocs.io/en/latest/effects.html) using GLSL shaders.
* [Sound, music and tone generation](https://wasabi2d.readthedocs.io/en/latest/sound.html).
* [Event driven input handling](https://wasabi2d.readthedocs.io/en/latest/events.html) for keyboard and mouse.
* [Animation/tweening](https://wasabi2d.readthedocs.io/en/latest/animation.html).
* ["Local storage"](https://wasabi2d.readthedocs.io/en/latest/storage.html) to easily save state.Wasabi2D is based on [moderngl](supports OpenGL 4.1+), with [pygame 2.0] for some supporting functions, and supporting APIs ported from [Pygame Zero](https://github.com/lordmauve/pgzero).
[moderngl]: https://github.com/moderngl/moderngl
[pygame 2.0]: https://www.pygame.org/news## Docs and Help
Documentation is available at https://wasabi2d.readthedocs.io/
Join us on [Discord for help and announcements!](https://discord.gg/jBWaWHU)
## Quick example
Draw a drop-shadowed circle that follows the mouse:
```python
import wasabi2d as w2dscene = w2d.Scene()
scene.background = 0.9, 0.9, 1.0scene.layers[0].set_effect('dropshadow')
circle = scene.layers[0].add_circle(
radius=30,
pos=(400, 300),
color='red',
)@w2d.event
def on_mouse_move(pos):
circle.pos = posw2d.run()
```
## Installation
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.## Screenshots
This screenshot shows off polygons, sprites, text and particle effects:

[Roller Knight](https://pyweek.org/e/wasabi28) was an entry in PyWeek 28, written with Wasabi2D by Daniel Pope and Larry Hastings:

[Spire of Chaos](https://pyweek.org/e/blaze/) was another entry in PyWeek 28 written with Wasabi2D by Daniel Moisset:
