From 73246ed0353e971af01bef3df83ec65e326532af Mon Sep 17 00:00:00 2001 From: Elijah Voigt Date: Tue, 9 Jun 2026 22:56:02 -0700 Subject: [PATCH] prototypes/life: the buttons all do things! --- prototypes/src/bin/life.rs | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/prototypes/src/bin/life.rs b/prototypes/src/bin/life.rs index 3e893d8..a0c062f 100644 --- a/prototypes/src/bin/life.rs +++ b/prototypes/src/bin/life.rs @@ -161,11 +161,25 @@ fn setup(mut commands: Commands) { fn play_sim(_trigger: On>, mut next: ResMut>) { next.set(SimulationState::Run); } - fn zoom_out(trigger: On>) { - todo!() + fn zoom_out(trigger: On>, mut projection: Query<&mut Projection>) { + projection.iter_mut().for_each(|mut p| { + match *p { + Projection::Orthographic(ref mut o) => { + o.scale /= 0.5; + } + _ => todo!() + } + }); } - fn zoom_in(trigger: On>) { - todo!() + fn zoom_in(trigger: On>, mut projection: Query<&mut Projection>) { + projection.iter_mut().for_each(|mut p| { + match *p { + Projection::Orthographic(ref mut o) => { + o.scale *= 0.5; + } + _ => todo!() + } + }); } // Spawn Coordiantes @@ -458,3 +472,7 @@ fn cooldown_secs(input: f32) -> impl FnMut(Local, Res