ShadowEngine2D
A comprehensive 2D game engine built in Rust, featuring Entity-Component-System (ECS) architecture, modern graphics rendering, audio systems, asset management, animations, and scene management.
Features
- 🎮 Entity-Component-System (ECS) - Flexible and performant game object management
- 🎨 Modern Graphics - GPU-accelerated rendering with WGPU
- 🔊 Audio System - 3D positional audio, effects, and music playback
- 📦 Asset Management - Hot-reloadable assets with multiple format support
- 🎬 Animation System - Sprite animations and tweening with easing functions
- 🎭 Scene Management - Hierarchical scenes with transitions and lifecycle management
- ⌨️ Input Handling - Keyboard, mouse, and gamepad support
- 🖼️ UI System - Immediate-mode GUI with flexible layouts
- ⏱️ Time Management - Delta time, time scaling, and frame-rate independent logic
- ✨ Particle System - Advanced 2D particles with randomization, gravity, burst emission, and custom behaviors
Particle System
ShadowEngine2D includes an advanced 2D particle system for effects like explosions, fire, smoke, and more. Features include:
- Randomized velocity, color, and size
- Gravity and acceleration
- Burst emission and emission shapes (point, circle)
- Custom update callbacks for unique behaviors
Basic Usage
use *;
let mut emitter = new;
emitter.emission_rate = 100.0;
emitter.particle_lifetime = 2.0;
emitter.particle_size = 10.0;
emitter.color = ;
emitter.velocity = new;
emitter.gravity = new;
emitter.velocity_randomness = new;
emitter.size_randomness = 5.0;
emitter.emission_shape = Circle ;
emitter.burst = Some; // Optional: burst emission
// In your update loop:
emitter.update;
// In your render loop:
emitter.render;
// Optional: custom update callback for advanced effects
emitter.custom_update = Some;
Quick Start
Add this to your Cargo.toml:
[]
= "1.1.0"
Basic Usage
use *;
Entity Creation
let entity = engine.entities.spawn
.at_position
.with_colored_square
.build;
let player = engine.entities.spawn
.game_object
.with_velocity
.build;
let ball = engine.entities.spawn
.ball
.build;
Resources
app.insert_resource;
UI
Debug Output
use ;
// Enable/disable debug output
set_enabled;
// Different log levels
debug;
info;
warn;
error;
// Or use convenient macros with formatting
debug!;
info!;
warn!;
error!;
Examples