diff options
author | tom barrett <spalf0@gmail.com> | 2019-06-27 10:00:42 -0500 |
---|---|---|
committer | tom barrett <spalf0@gmail.com> | 2019-06-27 10:00:42 -0500 |
commit | a76efb8444af9d4a0ee558e72903c67bc2cff5d3 (patch) | |
tree | b93849385e23e51466658502fe0a8a3064405ba5 /src/player.rs | |
parent | 93d0a0eb6a5c35ad8b82f368c5251d9690c508f9 (diff) | |
parent | ee8d055be8326eb1561900bcca6acd9e38071f4a (diff) |
Merge branch 'master' into feature/dude
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 |