diff --git a/Cargo.toml b/Cargo.toml index a9ab9b6..0af8357 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ members = [ "crates/rust4d_render", "crates/rust4d_input", "crates/rust4d_physics", + "crates/rust4d_game", ] [workspace.dependencies] @@ -27,6 +28,7 @@ rust4d_core = { path = "crates/rust4d_core" } rust4d_render = { path = "crates/rust4d_render" } rust4d_input = { path = "crates/rust4d_input" } rust4d_physics = { path = "crates/rust4d_physics" } +rust4d_game = { path = "crates/rust4d_game" } [package] name = "rust4d" @@ -47,6 +49,7 @@ rust4d_core.workspace = true rust4d_render.workspace = true rust4d_input.workspace = true rust4d_physics.workspace = true +rust4d_game.workspace = true wgpu.workspace = true winit.workspace = true pollster.workspace = true diff --git a/crates/rust4d_game/Cargo.toml b/crates/rust4d_game/Cargo.toml new file mode 100644 index 0000000..16716d4 --- /dev/null +++ b/crates/rust4d_game/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "rust4d_game" +version = "0.1.0" +edition = "2021" + +[dependencies] +rust4d_math.workspace = true +rust4d_physics.workspace = true +rust4d_core.workspace = true +log.workspace = true diff --git a/crates/rust4d_game/src/lib.rs b/crates/rust4d_game/src/lib.rs new file mode 100644 index 0000000..20777cc --- /dev/null +++ b/crates/rust4d_game/src/lib.rs @@ -0,0 +1,17 @@ +//! Game logic layer for Rust4D +//! +//! This crate bridges the engine and game-specific code, providing: +//! +//! - [`CharacterController4D`] - First-person character controller for 4D space +//! - [`EventBus`] - Typed event bus for game events +//! - [`StateMachine`] - Generic finite state machine +//! - Scene helpers for physics setup from entity tags + +pub mod character_controller; +pub mod events; +pub mod fsm; +pub mod scene_helpers; + +pub use character_controller::{CharacterController4D, CharacterConfig}; +pub use events::EventBus; +pub use fsm::StateMachine;