From da1a8351ff33946faa078c3ac5aed3103c57a958 Mon Sep 17 00:00:00 2001 From: tuxmain Date: Mon, 29 Aug 2022 09:53:50 +0200 Subject: [PATCH] Remove lost characters --- src/game.rs | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/game.rs b/src/game.rs index 015a268..204858f 100644 --- a/src/game.rs +++ b/src/game.rs @@ -25,6 +25,7 @@ pub struct GamePlugin; impl Plugin for GamePlugin { fn build(&self, app: &mut App) { app.add_event::() + .add_event::() .init_resource::() .insert_resource(CurrentLevel(None)) .init_resource::() @@ -41,7 +42,8 @@ impl Plugin for GamePlugin { .with_system(player_movement_system) .with_system(level_keyboard_system) .with_system(camera_system) - .with_system(character_particle_effect_system), + .with_system(character_particle_effect_system) + .with_system(kill_character_system), ) .add_system_set( SystemSet::on_update(AppState::Win) @@ -65,6 +67,8 @@ impl Plugin for GamePlugin { pub struct LevelStartupEvent; +pub struct ChangeCharacterEvent; + // Resources pub struct CurrentLevel(pub Option); @@ -435,14 +439,14 @@ fn collision_event_system( fn change_character_system( mut commands: Commands, - keyboard_input: Res>, characters: Query<(Entity, &CharacterColor, Option<&Player>)>, character_list: Res, audio_assets: Res, audio: Res