Skip to main content

A powerful Python game engine with comprehensive math library and render pipeline

Project description

Core

A powerful Python game engine with comprehensive math library and render pipeline.

Features

  • Complete Math Library (IntPy): Vectors, matrices, quaternions, geometry, advanced math
  • Render Pipeline: Camera system, materials, lighting, scene management
  • Engine Core: Main loop, time management, input handling, event system
  • Component System: Entity-component architecture
  • Resource Management: Asset loading and caching
  • Configuration: Flexible settings system
  • Logging: Built-in logging with levels

Installation

# Install from source
pip install -e .

# Or install in development mode
pip install -e ".[dev]"

Quick Start

Basic Engine Setup

from Engine import Engine

def update(delta_time):
    # Your update logic here
    pass

def render():
    # Your rendering logic here
    pass

# Create and run engine
engine = Engine(width=1280, height=720, title="My Game")
engine.set_update_callback(update)
engine.set_render_callback(render)
engine.run()

Using Math Library

from IntPy import vector3D, Matrix4x4, Quaternion, lerp

# Vectors
v1 = vector3D(1, 2, 3)
v2 = vector3D(4, 5, 6)
result = v1 + v2  # vector3D(5, 7, 9)

# Matrices
matrix = Matrix4x4.translation(10, 20, 30)
transformed = matrix * v1

# Quaternions
quat = Quaternion.from_euler(0, 45, 0)
rotated = quat.rotate_vector(v1)

# Interpolation
value = lerp(0.0, 100.0, 0.5)  # 50.0

Using Render Pipeline

from Render_Pipeline import Camera, Scene, GameObject, PrimitiveFactory, MaterialLibrary
from IntPy import vector3D

# Create camera
camera = Camera(
    position=vector3D(0, 0, 5),
    target=vector3D(0, 0, 0),
    fov=60.0
)

# Create scene
scene = Scene("MyScene")
scene.set_main_camera(camera)

# Create objects
cube_mesh = PrimitiveFactory.create_cube(1.0)
material = MaterialLibrary.metallic_rough(metallic=0.8, roughness=0.2)

obj = GameObject("Cube", mesh=cube_mesh, material=material)
obj.transform.set_position(vector3D(0, 0, 0))
scene.add_object(obj)

# Render scene (in your render callback)
from Render_Pipeline import RenderPipeline

renderer = RenderPipeline(1920, 1080)
renderer.render_scene(scene)

Input Handling

from Engine import get_input, Key, MouseButton

def update(delta_time):
    input_manager = get_input()
    
    # Keyboard
    if input_manager.is_key_pressed(Key.W):
        # Move forward
        pass
    
    if input_manager.is_key_down(Key.SPACE):
        # Jump (only on press)
        pass
    
    # Mouse
    if input_manager.is_mouse_button_pressed(MouseButton.LEFT):
        pos = input_manager.get_mouse_position()
        # Handle click
        pass
    
    scroll = input_manager.get_mouse_scroll()
    if scroll[1] != 0:
        # Handle scroll
        pass

Event System

from Engine import get_event_dispatcher, EventType

def on_window_resize(event):
    print(f"Window resized: {event.data}")

dispatcher = get_event_dispatcher()
dispatcher.subscribe(EventType.WINDOW_RESIZE, on_window_resize)

Component System

from Engine import get_entity_manager, TransformComponent

entity_manager = get_entity_manager()

# Create entity
entity = entity_manager.create_entity("Player")

# Add components
transform = TransformComponent()
transform.set_position(vector3D(0, 0, 0))
entity.add_component(transform)

# Update (called automatically by engine)
entity_manager.update(delta_time)

Examples

See the examples/ directory for more detailed examples:

  • basic_engine.py - Basic engine setup
  • math_examples.py - Math library usage
  • rendering_example.py - Render pipeline usage
  • input_example.py - Input handling
  • component_example.py - Component system

Documentation

Full documentation is available in the docstrings of each module.

License

MIT License

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

axis3-1.0.0.tar.gz (52.1 kB view details)

Uploaded Source

Built Distribution

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

axis3-1.0.0-py3-none-any.whl (53.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for axis3-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c3fc168a8b0ee32380b75a6cdfb6248161ed89fcc13254d193489f89618160f4
MD5 f620b457ad8263219d42e9653871b0d7
BLAKE2b-256 984f6344089919a0f208ea797bb4801ce7dfa6a36d6aef202cfcf61a9d810036

See more details on using hashes here.

File details

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

File metadata

  • Download URL: axis3-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 53.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for axis3-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 372fefdb551cead7fb703783b9ba560e0212bc3603371f4918291624f8fa86e3
MD5 58d439b95c98e3b32d5d8ff2f49890f5
BLAKE2b-256 f7c80f99006e05c9ba39ac77b4328785f5c754273c69a03d5434449fa349d385

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