From 6bf9e96140c91340d6ae643b6e0896aa734d8605 Mon Sep 17 00:00:00 2001 From: tom barrett Date: Tue, 2 Jul 2019 04:23:33 -0500 Subject: entities now spawn on points --- src/tile.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/tile.rs') 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, + pub destination: Point2, rotation: f32, } @@ -50,6 +52,7 @@ impl Tile { ); Tile { + id, source, animation: tileset.get_animation(id), timer: Instant::now(), -- cgit v1.2.3