This commit is contained in:
LunarAkai 2025-08-05 11:35:36 +02:00
commit 62438e0d24
15 changed files with 157 additions and 7 deletions

View file

@ -5,7 +5,9 @@ version.workspace = true
authors.workspace = true
[dependencies]
moonhare_derives = { path = "../moonhare_derives" }
moonhare_ecs = { path = "../moonhare_ecs" }
moonhare_graphics = { path = "../moonhare_graphics" }
moonhare_log = { path = "../moonhare_log" }
moonhare_window = { path = "../moonhare_window" }

View file

@ -1 +0,0 @@
pub mod node;

View file

@ -1,3 +0,0 @@
pub trait Node {
}

View file

@ -10,9 +10,7 @@ use moonhare_window::{platforms::glfw_window::GLFWWindow};
use crate::systems::system::{BaseSystems, System};
pub mod systems;
pub mod basic;
/// Only one Game may exist per project
pub mod nodes;
/* #[derive(Debug)]
pub struct Game {
pub base_systems: BaseSystems,
@ -22,6 +20,7 @@ pub struct Game {
pub name: String,
} */
// when creating a game, you can add systems to it, which do _things_
// BaseSystems -> Window, Update, Render
@ -73,6 +72,8 @@ impl Game {
}
pub fn run(self) {
info("Running Game...");
//------------------------------
// Run Init on all Systems
@ -116,3 +117,4 @@ fn render(context: Rc<Context>) {
let target = moonhare_graphics::glium::Frame::new(context.clone(), context.get_framebuffer_dimensions());
moonhare_graphics::draw_background_color(Color::color_from_rgb(255, 255, 255), target);
}

View file

@ -0,0 +1,2 @@
pub mod node;
pub mod window;

View file

@ -0,0 +1,16 @@
use moonhare_derives::Node;
pub trait Node {
fn init(&mut self);
fn update(&mut self);
}
impl<T> Node for Box<T> {
fn init(&mut self) {
todo!()
}
fn update(&mut self) {
todo!()
}
}

View file

@ -0,0 +1,17 @@
use moonhare_derives::Node;
use crate::nodes::node::Node;
#[derive(Node)]
struct Window {
a: Box<String>
}
impl Window {
fn init(&mut self) {
}
fn update(&mut self) {
}
}