diff options
author | tom barrett <spalf0@gmail.com> | 2019-07-07 11:45:49 -0500 |
---|---|---|
committer | tom barrett <spalf0@gmail.com> | 2019-07-07 11:45:49 -0500 |
commit | de4e8c1f0b82627fd1980401ae63472f49c9d89c (patch) | |
tree | bcbffde08ac2e5bf843abee0dc61c2d7e20fd03b /src/animations.rs | |
parent | bfdaef7850b6ac17bb88f1b314236fb5014aac8e (diff) |
reorganized
Diffstat (limited to 'src/animations.rs')
-rw-r--r-- | src/animations.rs | 5 |
1 files changed, 3 insertions, 2 deletions
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(); |