Skip to main content

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)

    def update(self):
        self.rect.x += 1

class Player2(bread_engine.Rect):
    def __init__(self):
        super().__init__(100, 200, 50, 50, bread_engine.Color.BLACK, has_physics="gravity")
        self.ground_level = engine.window_height - self.rect.height

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.Keys.escape)

player = Player()

cube = bread_engine.Rect(200, 100, 50, 50, bread_engine.Color.RED, update_function=cube_update)
cube.update_function = different_cube_update # Swap out update functions after initialization
player2 = Player2() # Cube with gravity

engine.add_object(player)
engine.add_object(cube)
engine.add_object(player2)

engine.run()

I recommend taking a look at the source code for a better understanding of the engine!

Project details


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.0.2.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bread_engine-0.0.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file bread_engine-0.0.2.tar.gz.

File metadata

  • Download URL: bread_engine-0.0.2.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.9

File hashes

Hashes for bread_engine-0.0.2.tar.gz
Algorithm Hash digest
SHA256 efb5484b29b8260cdf41b69533cab97f720f0480f50e508d6c46616db4fb6b2e
MD5 4b895cb28d8218ce301b3be4464245c2
BLAKE2b-256 aa83fa84e734900e95e3852c76b72e3bad6181496b012401bda688d04c989626

See more details on using hashes here.

File details

Details for the file bread_engine-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: bread_engine-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.9

File hashes

Hashes for bread_engine-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 09c79e7bf67edaca2fb51a02f4770afcb4a7ff82bab251042c78e6fb799ebad4
MD5 e3f173952febb35af43370133cd0b923
BLAKE2b-256 47c0f88a69a017a33ec075354b3c93f83fb7f51f860042b3f7136abaff7ca6fe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page