From 83ff2ad49e6d3bf83fd85fcfee68a454372bf22a Mon Sep 17 00:00:00 2001 From: tom barrett Date: Thu, 4 Jul 2019 07:39:51 -0500 Subject: moved animation file, moved player function to enitity, tile now uses animation, move drawing from npc tile player to animation --- src/tileset.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/tileset.rs') 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 { 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() -- cgit v1.2.3