From cccfb66c7c58bf464252e942ef2b742b41ece19e Mon Sep 17 00:00:00 2001 From: tom barrett Date: Sat, 22 Jun 2019 10:11:18 -0500 Subject: now draw at the tile level --- src/player.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/player.rs') diff --git a/src/player.rs b/src/player.rs index bc019b9..e9c3a75 100644 --- a/src/player.rs +++ b/src/player.rs @@ -11,8 +11,8 @@ pub struct Player { pub position: Point2, state: PlayerState, tile: Rect, - animation: Vec<(u32, Rect)>, - animations: HashMap>, + animation: Vec<(usize, Rect)>, + animations: HashMap>, map_height: f32, map_width: f32, } @@ -106,7 +106,7 @@ impl Player { let index = match self.animation.iter().position(|a| a.1 == self.tile) { Some(index) => { - if check_update_time(context, self.animation[index].0) { + if check_update_time(context, self.animation[index].0 as u32) { index + 1 } else { index -- cgit v1.2.3