Entity structure

This commit is contained in:
2025-11-26 10:57:21 +01:00
parent fde5f11568
commit df7c547ea4
3 changed files with 41 additions and 1 deletions
+16 -1
View File
@@ -1,4 +1,19 @@
use osmium::entity::Component;
pub struct Velocity(pub i32);
impl Component for Velocity {
fn tick(&mut self) {}
}
fn main() {
let mut engine = osmium::init();
engine.thread("Main.event", move || {});
engine.thread("Main.tick", || {});
let mut my_rect = engine.draw(|r| {
// r.draw_rect(0, 0, 10, 10);
});
my_rect.component(Velocity(10));
}