A modular 2D game engine in Rust with a custom SparseSet-based ECS. Built from scratch to learn how game engines actually work.
⚠️ Heads up: This is an experimental/educational project. I'm building this to understand engine internals, not to compete with existing engines.
What's Inside
The project is split into workspace crates:
Currently Working
kon_core- App lifecycle, plugins, eventskon_ecs- Custom ECSkon_macros- Proc macros for#[system]and#[component]kon_window- Winit-based window managementkon_input- Input handling
Still Cooking 🍳
kon_math- Math stuff with Glam integration (WIP)kon_renderer- WGPU renderer (WIP)kon_physics- 2D physics (Planned)kon_editor- Editor tools (Planned)
Features
- Plugin-based architecture
- Custom SparseSet ECS with O(1) component access
- Write systems as regular Rust functions
- Ergonomic query API
- Event system for decoupled communication
- Window context management
- Keyboard/mouse input
- Hardware-accelerated 2D rendering
- Collision detection and physics
- Integrated editor
Quick Example
Here's how you write a simple simulation:
use *;
// Define your data
// Setup runs once
// Movement runs every frame
// Update runs every frame
// Wire everything together
How to Use
As a dependency:
Or in your Cargo.toml:
[]
= "0.2.0"
From source:
# Run examples
# Linux/macOS
# Windows
License
Dual-licensed under MIT or Apache 2.0, pick whichever works for you.
- MIT: LICENSE-MIT or http://opensource.org/licenses/MIT
- Apache 2.0: LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0