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.8.tar.gz (122.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.8-py3-none-any.whl (133.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lunaengine-0.1.8.tar.gz
  • Upload date:
  • Size: 122.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.8.tar.gz
Algorithm Hash digest
SHA256 59e4c37911678508856a44af5251531049a9766bbaaf2b014dd2e823d1cf6a06
MD5 e8f08380148cdac04dfa7ebce5f1d54c
BLAKE2b-256 0393e5b92b202d91a41b56fccf16a3b5f42c722ab59cd84643d87a1d66627b3b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lunaengine-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 133.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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 5b52919398256de10e2c4f26d13643405964c5cca7407a32f7d61174b958e300
MD5 29bd58c75451e595451f5951302295fd
BLAKE2b-256 ab745217ec0455c49a486d8fc11f7c85d5bc3c06f57578314e479a864772185f

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