diff options
author | tom barrett <spalf0@gmail.com> | 2019-07-02 04:23:33 -0500 |
---|---|---|
committer | tom barrett <spalf0@gmail.com> | 2019-07-02 04:23:33 -0500 |
commit | 6bf9e96140c91340d6ae643b6e0896aa734d8605 (patch) | |
tree | ea5fba741326bd952b7808d402c4bbaf572d170d /src/tile.rs | |
parent | 1b5f06e902b9e5c5b0d5897fc981eeaa6dc39b37 (diff) |
entities now spawn on points
Diffstat (limited to 'src/tile.rs')
-rw-r--r-- | src/tile.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tile.rs b/src/tile.rs index 45b8b3e..1f3c2f7 100644 --- a/src/tile.rs +++ b/src/tile.rs @@ -6,11 +6,13 @@ use crate::constants; use crate::math::{convert_angle_to_rad, flip, next_source}; use crate::tileset::Tileset; +#[derive(Clone, Debug)] pub struct Tile { + pub id: usize, source: Rect, animation: Vec<(usize, Rect)>, timer: Instant, - destination: Point2<f32>, + pub destination: Point2<f32>, rotation: f32, } @@ -50,6 +52,7 @@ impl Tile { ); Tile { + id, source, animation: tileset.get_animation(id), timer: Instant::now(), |