diff --git a/src/display3d.rs b/src/display3d.rs index 9b95075..060cc49 100644 --- a/src/display3d.rs +++ b/src/display3d.rs @@ -91,7 +91,8 @@ impl Plugin for Display3dPlugin { pick_up.run_if(any_component_added::()), put_down.run_if(any_component_removed::()), dissolve_animation.run_if(any_with_component::), - capture_piece.run_if(any_with_component::), + capture_piece_start.run_if(any_component_added::()), + capture_piece_end.run_if(any_component_removed::()), monitor_animations .run_if(in_state(GameState::Play)) .run_if(any_component_changed::()), @@ -1160,93 +1161,38 @@ fn setup_dissolve_materials( /// When a piece is captured... /// 1. Play a cool "captured" animation and a neat sound -/// 2. Move the piece to the side of the board -/// 3. Play the same "captured" animation in reverse -/// The animation is like a 'beam me up scotty' sorta thing. -fn capture_piece( - events: Query<(Entity, &Dissolvable), (With, Added)>, - mut query: Query< - (&mut Transform, &Side, &Dissolvable), - (With, With), - >, - dissolving: Query>, - mut state: Local>, +fn capture_piece_start( + events: Query<(Entity, &Dissolvable), Added>, mut commands: Commands, - score: Res, - mut timer: Local, - time: Res