From de4e8c1f0b82627fd1980401ae63472f49c9d89c Mon Sep 17 00:00:00 2001 From: tom barrett Date: Sun, 7 Jul 2019 11:45:49 -0500 Subject: reorganized --- src/animations.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/animations.rs') diff --git a/src/animations.rs b/src/animations.rs index 5e5740a..be10f31 100644 --- a/src/animations.rs +++ b/src/animations.rs @@ -5,7 +5,8 @@ use std::time::Instant; use crate::constants; use crate::entity::Action; -use crate::tileset::{Tile, Tileset}; +use crate::tile::Tile; +use crate::tileset::Tileset; #[derive(Debug, Clone, PartialEq)] pub struct Animation { @@ -29,7 +30,7 @@ impl Animation { pub fn update(&mut self) { if let Some(mut i) = self.frames.iter().position(|a| a == &self.current) { - if let Some(delay) = self.current.property.delay { + if let Some(delay) = self.current.properties.delay { if self.timer.elapsed().as_millis() > delay as u128 { i = if i == self.frames.len() - 1 { 0 } else { i + 1 }; self.current = self.frames[i].clone(); -- cgit v1.2.3