From 91787dff883570f8dfa44edfd85fc0add6d49824 Mon Sep 17 00:00:00 2001 From: "Elijah C. Voigt" Date: Sun, 12 May 2024 19:52:12 -0700 Subject: [PATCH] And with that... I believe we have correctness Animations are still a bit janky but the core gameplay loop seem secure! --- src/display3d.rs | 114 +++++++++++++---------------------------------- src/game.rs | 23 ---------- 2 files changed, 30 insertions(+), 107 deletions(-) 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