use bevy_ecs::event::Events; use bevy_ecs::schedule::Schedule; use bevy_ecs::world::World; use egui::Context; use tracing::info; use crate::ecs::Camera; use crate::input::MouseWheelEvent; use crate::rendering::Renderer; use crate::rendering::ui::UiRenderable; #[cfg(target_arch = "wasm32")] #[path = "wasm/mod.rs"] pub mod platform; #[cfg(not(target_arch = "wasm32"))] #[path = "native/mod.rs"] pub mod platform; pub mod ecs; pub mod input; pub mod rendering; // Hi, you've found the real main function! This is called AFTER platform-specific initialization code. pub fn start() { info!("Hello, world! StarKingdoms.TK v{} says hello, running on {}", env!("CARGO_PKG_VERSION"), if cfg!(target_arch = "wasm32") { "wasm" } else { "native" }); info!("Creating the ECS world..."); let mut world = World::new(); world.insert_resource::>(Events::default()); world.insert_resource(Camera { x: 0.0, y: 0.0, zoom: 1.0, }); let mut start_schedule = Schedule::default(); // Add startup things here // Caution: This will run before there are things on-screen start_schedule.run(&mut world); let mut update_schedule = Schedule::default(); // Add things to run every frame here // Caution: This will run once before there are things on screen }