diff options
author | tom barrett <spalf0@gmail.com> | 2019-07-04 07:39:51 -0500 |
---|---|---|
committer | tom barrett <spalf0@gmail.com> | 2019-07-04 07:39:51 -0500 |
commit | 83ff2ad49e6d3bf83fd85fcfee68a454372bf22a (patch) | |
tree | 029ab8bd9d73652f1fabd9e34e970f16f93116b5 /src/tileset.rs | |
parent | c9ce92e1830505269b631ba1fdd864a173bacf48 (diff) |
moved animation file, moved player function to enitity, tile now uses animation, move drawing from npc tile player to animation
Diffstat (limited to 'src/tileset.rs')
-rw-r--r-- | src/tileset.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tileset.rs b/src/tileset.rs index 975398d..ee7128f 100644 --- a/src/tileset.rs +++ b/src/tileset.rs @@ -2,7 +2,7 @@ use ggez::filesystem::File; use ggez::graphics::Rect; use std::collections::HashMap; -use crate::animation::Frame; +use crate::animations::Frame; use crate::constants; use crate::property::Property; use crate::xmlelements::XMLElements; @@ -84,13 +84,13 @@ impl Tileset { .collect() } - pub fn get_animation(&self, tile_id: usize) -> Vec<(usize, Rect)> { + pub fn get_frames(&self, tile_id: usize) -> Vec<Frame> { if let Some(property) = self.properties.iter().find(|p| p.tile_id == tile_id) { self.properties .clone() .into_iter() .filter(|p| p.entity == property.entity && p.entity.is_some()) - .map(|p| (p.delay.unwrap(), self.get(p.tile_id))) + .map(|p| Frame::new(self.get(p.tile_id), p.delay, 0.0)) .collect() } else { Vec::new() |