A python game engine using PyGame
Project description
Bread Engine
The bread engine is a basic "game engine" made using PyGame. The engine allows you to create games much easier and is fully compatible with PyGame.
Example usage:
import bread_engine
engine = bread_engine.Engine()
engine.run()
Installation
pip install pygame
pip install bread_engine
More examples:
import bread_engine
class Player(bread_engine.Rect):
def __init__(self):
super().__init__(100, 100, 50, 50, bread_engine.Color.GREEN, has_physics="gravity")
self.ground_level = engine.window_height - self.rect.height
self.gravity = 0.4
self.velocity_y = 0
def update(self):
keys = bread_engine.KeyHandler.get_pressed_keys()
if keys[bread_engine.KeyHandler.Key.A] or keys[bread_engine.KeyHandler.Key.LEFT]:
self.rect.x -= 4
if keys[bread_engine.KeyHandler.Key.D] or keys[bread_engine.KeyHandler.Key.RIGHT]:
self.rect.x += 4
if keys[bread_engine.KeyHandler.Key.SPACE] and self.rect.y == self.ground_level:
self.velocity_y = -10
def cube_update(cube):
cube.rect.x += 1
def different_cube_update(cube):
cube.rect.x += 2
engine = bread_engine.Engine(debug=True, window_vsync=True, exit_bind=bread_engine.KeyHandler.Key.ESCAPE)
cube = bread_engine.Rect(200, 100, 50, 50, bread_engine.Color.RED, update_function=cube_update)
player = Player()
engine.add_object(player)
engine.add_object(cube)
engine.run()
I recommend taking a look at the source code for a better understanding of the engine!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bread_engine-0.1.1.tar.gz
(4.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bread_engine-0.1.1.tar.gz.
File metadata
- Download URL: bread_engine-0.1.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66d6ceb780ef3a7fb4f49ad34f0732ad437f968778913da6e9be5d41a9fd2d8b
|
|
| MD5 |
56bc5db618060a8876b2b303d9324e81
|
|
| BLAKE2b-256 |
8a7525471240725a26781e8238908ffd940f367a5570b2d413fd823aa6a8845d
|
File details
Details for the file bread_engine-0.1.1-py3-none-any.whl.
File metadata
- Download URL: bread_engine-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccf04a4e10b8035595d649dbec9dd6d3389601ec4a3ed1d42310b48b22faaefa
|
|
| MD5 |
b0f91679bc8f8663ec9fcce0cbfd31dc
|
|
| BLAKE2b-256 |
ab839f2291220ac8b7ff9774c1ec1098b09a84da5143fabd39cb52b27f52c45b
|