From ff2f897520704adacc8287b3499167bbcf56deb8 Mon Sep 17 00:00:00 2001 From: Tom Barrett Date: Thu, 17 Nov 2022 21:15:30 +0100 Subject: for version 9 --- src/cell.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/cell.rs') diff --git a/src/cell.rs b/src/cell.rs index 6a818c5..7c2385d 100644 --- a/src/cell.rs +++ b/src/cell.rs @@ -12,9 +12,9 @@ pub struct AnimationTimer { } impl AnimationTimer { - pub fn from_seconds(duration: f32, repeating: bool) -> AnimationTimer { + pub fn from_seconds(duration: f32, mode: TimerMode) -> AnimationTimer { AnimationTimer { - timer: Timer::from_seconds(duration, repeating), + timer: Timer::from_seconds(duration, mode), } } @@ -39,7 +39,7 @@ impl AnimationTimer { } pub fn repeating(&self) -> bool { - self.timer.repeating() + self.timer.mode() == TimerMode::Repeating } } @@ -139,7 +139,7 @@ pub fn start_explosion( if cell.occupant == Occupant::Explosion { commands .entity(entity) - .insert(AnimationTimer::from_seconds(0.1, true)); + .insert(AnimationTimer::from_seconds(0.1, TimerMode::Repeating)); } } } -- cgit v1.2.3