Skip to main content

A modern 2D game engine with advanced UI and graphics

Project description

LunaEngine 🚀

A modern, optimized 2D game engine built with Python and Pygame featuring advanced UI systems, procedural lighting, and embedded asset management.

! We will no longer support pygame renderer, only openGL

📋 Features

Feature Description Status
Advanced UI Roblox Studio-like UI components ✅ Functional
OpenGL Rendering Hardware-accelerated graphics ✅ Functional
Performance Tools FPS monitoring, hardware detection ✅ Functional
Themes The engine have pre-built themes ✅ Functional
Lighting System Dynamic lights and shadows 🔄 WIP
Particle Effects Particle system 🔄 WIP
Image Embedding Convert assets to Python code ⚠️ Useless
Modular Architecture Easy to extend and customize :)

Code Statistics

See this file

TestPyPi

PyPi

🚀 Quick Start

Installation

# First of all, install python 3.9+ (Not tested on older versions)
# Then you can install either from pypy or testpypi
pip install lunaengine
pip install -i https://test.pypi.org/simple/ lunaengine

Ignore

# Install dependencies
pip install -r requirements.txt

# Run a basic example
python examples/ui_comprehensive_demo.py

Requirements

Core Dependencies (required):

pygame>=2.5.0
numpy>=1.21.0
PyOpenGL>=3.1.0
PyOpenGL-accelerate>=3.1.0

Development Tools (optional):

black>=22.0.0
flake8>=4.0.0
pytest>=7.0.0
setuptools>=65.0.0
wheel>=0.37.0
twine>=4.0.0

Build

# Make build
python -m build

# Check files
twine check dist/* 

# Upload testpypi
twine upload --config-file .pypirc --repository testpypi dist/*

# Upload PyPi
twine upload --config-file .pypirc --repository pypi dist/*

OpenGL

  • Require OpenGL 3.3+
  • OpenGL come actvated by default

Network

Example usage of server scripts:

def auto_save_script(server: Server):
    """Example server script for auto-saving"""
    # This would save game state periodically
    save_data = {
        'timestamp': time.time(),
        'player_count': len(server.clients),
        'game_state': 'running'
    }
    print(f"Auto-save: {save_data}")
    return save_data

def day_night_cycle_script(server: Server):
    """Example server script for day/night cycle"""
    # Calculate current cycle phase (0-1)
    cycle_time = time.time() % 3600  # 1 hour cycle
    cycle_phase = cycle_time / 3600
    
    # Broadcast cycle update to all clients
    cycle_msg = GameStateMessage({'day_night_cycle': cycle_phase})
    server.broadcast(cycle_msg)
    
    return {'cycle_phase': cycle_phase, 'cycle_time': cycle_time}
Star History Chart

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

lunaengine-0.1.7.tar.gz (115.7 kB view details)

Uploaded Source

Built Distribution

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

lunaengine-0.1.7-py3-none-any.whl (126.1 kB view details)

Uploaded Python 3

File details

Details for the file lunaengine-0.1.7.tar.gz.

File metadata

  • Download URL: lunaengine-0.1.7.tar.gz
  • Upload date:
  • Size: 115.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for lunaengine-0.1.7.tar.gz
Algorithm Hash digest
SHA256 79d01e8f5620462b5f5ac70d828768743c0260465fa8da6faa0749896870c181
MD5 11adf964186d04e925ac7d25e746aff2
BLAKE2b-256 5a62bdfe208a751b5aad85740c3fb0898b8909ec63f1030071b1310a7d440750

See more details on using hashes here.

File details

Details for the file lunaengine-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: lunaengine-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 126.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for lunaengine-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b1c2efbdba57fdde18d6c92c3da4b09c55ec0eb26704acdb7de7886b20474da6
MD5 e0521106d1db240716eec588583099d0
BLAKE2b-256 1333b4f871b339309322168a33b016fd6d56b0a5b06faa687b6b94e15174b0c4

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