diff options
author | tom barrett <spalf0@gmail.com> | 2019-06-22 10:11:18 -0500 |
---|---|---|
committer | tom barrett <spalf0@gmail.com> | 2019-06-22 10:11:18 -0500 |
commit | cccfb66c7c58bf464252e942ef2b742b41ece19e (patch) | |
tree | 8d13331a5cb65343d1a668d6dbb3fa4a62fb598a /src/player.rs | |
parent | 99c6e61a2b8fe66dcef7eada525f6fbdd7a2cd00 (diff) |
now draw at the tile level
Diffstat (limited to 'src/player.rs')
-rw-r--r-- | src/player.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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<f32>, state: PlayerState, tile: Rect, - animation: Vec<(u32, Rect)>, - animations: HashMap<PlayerState, Vec<(u32, Rect)>>, + animation: Vec<(usize, Rect)>, + animations: HashMap<PlayerState, Vec<(usize, Rect)>>, 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 |