This commit is contained in:
Jonathan Jara 2025-05-07 13:14:30 -07:00
parent 73f85a8d0d
commit c34dd3a13c
3 changed files with 30 additions and 0 deletions

View File

@ -1,10 +1,12 @@
use bevy::prelude::*;
pub mod components;
pub mod systems;
pub mod plugins;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(plugins::inventory::InventoryPlugin)
.insert_resource(Time::<Fixed>::from_hz(60.0))
.add_systems(Startup, (setup, systems::player::spawn_player, systems::wolf::spawn_wolf))
.add_systems(FixedUpdate, (systems::player::camera_lock, systems::player::player_movement))

27
src/plugins/inventory.rs Normal file
View File

@ -0,0 +1,27 @@
use bevy::prelude::*;
use bevy::ui::BackgroundColor;
pub struct InventoryPlugin;
impl Plugin for InventoryPlugin {
fn build(&self, app: &mut App) {
app.add_systems(Startup, (spawn_inventory,));
}
}
fn spawn_inventory(mut commands: Commands) {
commands
.spawn((
Node {
width: Val::Percent(100.0),
height: Val::Percent(10.0),
// flex_direction: FlexDirection::Column,
align_items: AlignItems::Center,
justify_content: JustifyContent::Center,
..Default::default()
},
BackgroundColor(Color::BLACK),
));
}

1
src/plugins/mod.rs Normal file
View File

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