Repository navigation
v1.0.0a4 - Alpha Release
Pre-releasePyG Engine v1.0.0a4 Release Notes
🎉 Big Update: Event System & Better Docs!
Hey everyone (no one lol)! Super excited to share v1.0.0a4. This is a big update - added a proper event system, added a unified input system, and finally got around to writing decent documentation (sorry about that before 😅).
🚀 What's New
Event System (Finally!)
After months of putting it off, we finally built a proper event system:
- Event Class: Simple immutable events with type, data, and timestamps
- EventManager: Thread-safe event handling with priority levels (CRITICAL, HIGH, NORMAL, LOW)
- Flexible Processing: Can do immediate or queued events
- Memory Management: Uses weak references so it doesn't leak memory (learned that the hard way)
- Component Integration: Works really well with our existing component system
- Advanced Stuff: Event chaining, filtering, and broadcasting
Input System Overhaul
The old input system was getting messy, so I rewrote it:
- Unified Interface: One system for keyboard, mouse, and joystick
- Axis-Based Input: Can combine multiple inputs into axes (like WASD + arrow keys)
- Event-Based Input: Better timing for button presses
- Joystick Support: Auto-detects and maps joysticks
- Input Aliases: String-based input for easier config
- Component System: Object-specific mouse stuff
Documentation (Finally!)
Wrote a proper CORE_SYSTEMS_GUIDE that covers:
- All the engine systems with examples
- Class docs with functions and properties
- Integration patterns and best practices
- Performance tips
- Testing instructions
Runnable System
Added a system for running functions with priorities:
- Priority-based execution (4 levels)
- Performance monitoring
- Flexible event types
- Error handling
Headless Mode
You can now run the engine without a display:
- Good for automated testing
- Server-side game logic
- AI training stuff
- No graphics needed
Better Examples
Added way more examples:
- Input system demos (keyboard, mouse, joystick)
- Event system examples
- Performance tools
- Visual demos
- Snake game (shows multiple systems working together)
Technical Stuff
- Thread Safety: Added locks for concurrent access
- Memory: Better cleanup of dead references
- Performance: Optimized event processing
- Architecture: Better overall structure
Documentation
The new CORE_SYSTEMS_GUIDE includes:
- Detailed class docs
- Usage examples for everything
- Integration examples
- Performance tips
- Testing instructions
Quick Start
from pyg_engine import Engine, Event, EventManager, Priority
# Create engine
engine = Engine(size=(800, 600), windowName="Event Demo")
# Subscribe to events
def handle_collision(event):
print(f"Collision: {event.data}")
engine.event_manager.subscribe("collision", handle_collision, Priority.HIGH)
# Dispatch events
engine.event_manager.dispatch("player_moved", {
"position": (100, 200),
"velocity": (50, 0)
}, immediate=True)
engine.start()Migration
This release is backward compatible - existing code should work fine. The event system is additive.
Known Issues
- Some components might need updates to use the event system properly
- Still working on improving docs
What's Next
- Sprite rendering and physics
- State machine
- Animation system
- Audio system
- Coroutines and async stuff
Install
pip install pyg-engine==1.0.0a4PyG Engine - Making 2D game dev in Python less painful!
Remember: it's "pig engine" not "py-g engine"! 😄
Full Changelog: v1.0.0a3...v1.0.0a4