Skip to main content

A lightweight, modular 2D game engine built on top of Pygame.

Project description

PyEngine2D

A Modular 2D Game Engine in Python

PyEngine2D is a scene-graph-based 2D game engine built on top of Pygame. It features 8 decoupled subsystems communicating via an EventBus, designed for a Software Engineering (SEPM) academic project.

Features

  • Scene Graph: Node-based architecture (similar to Godot).
  • Physics: AABB and Circle collisions, continuous velocity integration, impulses.
  • Animation: Spritesheet slicing, framerate-independent clips.
  • Camera: Smooth follow, zoom, screen shake, bounds clamping.
  • Particles: Fixed-pool particle emitters with built-in presets (Dust, Sparks, Explosion).
  • UI System: Screen-space anchors, Buttons, Labels, HealthBars, Minimap.
  • Audio: Positional audio, music streaming, master volume control.
  • Input: JSON-serialisable action bindings.

Installation

Requires Python 3.10+.

# Install dependencies
pip install -r requirements.txt

Running the Demo Game

"The Lost Relic" is a top-down RPG demo included to showcase all engine features.

# The first run will automatically generate procedural pixel-art assets
python demo/main.py

Controls

  • W, A, S, D or Arrows: Move Player
  • ESC: Pause Game
  • Mouse: Click UI buttons (Menus)

Running Tests

The test suite contains 18 Unit Tests and 8 Integration Tests (covering all PRD acceptance criteria).

# Run pytest on the tests directory
python -m pytest tests/

Documentation

UML Diagrams (Component, Class, Sequence, State) are provided as .puml (PlantUML) files in the docs/uml/ directory. You can view them using the PlantUML VSCode extension or any online PlantUML viewer.

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

pyengine2d_sagar-1.0.0.tar.gz (39.3 kB view details)

Uploaded Source

Built Distribution

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

pyengine2d_sagar-1.0.0-py3-none-any.whl (51.6 kB view details)

Uploaded Python 3

File details

Details for the file pyengine2d_sagar-1.0.0.tar.gz.

File metadata

  • Download URL: pyengine2d_sagar-1.0.0.tar.gz
  • Upload date:
  • Size: 39.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for pyengine2d_sagar-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ad88b43ecb7d9a9bcfb7f76213813e80a3fca97f13f5dc7379b4480ba118ea47
MD5 affe01e4a525c67b2d5abeaed8529315
BLAKE2b-256 99014ff5cfb78c57b48d313182f3abd0a85daa3ca4bf866719b27327810973a3

See more details on using hashes here.

File details

Details for the file pyengine2d_sagar-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pyengine2d_sagar-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 694a5b10f9c2d4dc0141b9b61cdcb824380198a55d07f420d022fa3fb1e9f5d8
MD5 bdda6ba6b95b943a52a448a6a49f744f
BLAKE2b-256 df6a0225cec21f70befb306c9587c31314b11856844a839d877d7383b8446ed1

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