diff --git a/src/game.rs b/src/game.rs index eb858eb..9fc323d 100644 --- a/src/game.rs +++ b/src/game.rs @@ -59,7 +59,8 @@ impl Plugin for GamePlugin { ) .add_system_to_stage(CoreStage::PostUpdate, char_char_collision_event_system) .add_system_to_stage(CoreStage::PostUpdate, char_platform_collision_event_system) - .add_system_to_stage(CoreStage::PostUpdate, collision_event_system); + // collision event system might remove items, therefore, we should detect platforms first before removing them + .add_system_to_stage(CoreStage::PostUpdate, collision_event_system.after(char_platform_collision_event_system)); } } @@ -111,12 +112,10 @@ pub struct PlatformCount(usize); impl PlatformCount { fn increment(&mut self) { - println!("increment"); self.0 += 1; } fn decrement(&mut self) { - println!("decrement"); self.0 = self.0.saturating_sub(1); }