diff --git a/src/game.rs b/src/game.rs index d46f66d..ec003b5 100644 --- a/src/game.rs +++ b/src/game.rs @@ -3,7 +3,8 @@ use bevy_rapier2d::prelude::*; use player::player_plugin; mod player; +mod set; fn game_plugin(app: &mut App) { - app.add_plugins((player_plugin)); + app.add_plugins(player_plugin); } diff --git a/src/game/player.rs b/src/game/player.rs index 9ec8c3a..8b4ef3e 100644 --- a/src/game/player.rs +++ b/src/game/player.rs @@ -1,14 +1,19 @@ use bevy::prelude::*; + use bevy_rapier2d::prelude::*; use crate::AppState; + +use super::set::IngameSet; #[derive(Component)] struct Player {} pub(super) fn player_plugin(app: &mut App) { - //app.add_systems(OnEnter(AppState::InGame), add_player.in_set(GameplaySet)); + app.add_systems(OnEnter(AppState::InGame), add_player.in_set(IngameSet)); } pub fn add_player(mut commands: Commands) { - commands.spawn(Player {}); + commands + .spawn(Player {}) + .insert(ActiveEvents::COLLISION_EVENTS); } diff --git a/src/game/set.rs b/src/game/set.rs new file mode 100644 index 0000000..ae46536 --- /dev/null +++ b/src/game/set.rs @@ -0,0 +1,4 @@ +use bevy::prelude::*; + +#[derive(SystemSet, Debug, Clone, PartialEq, Eq, Hash)] +pub struct IngameSet; diff --git a/src/main.rs b/src/main.rs index ca36c07..ffcea78 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,4 @@ +#![allow(unused)] use bevy::prelude::*; use bevy_rapier2d::prelude::*;