diff options
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 |