From ced37025a37051db896443d310f5f613f1281882 Mon Sep 17 00:00:00 2001 From: tom barrett Date: Wed, 10 Jul 2019 09:43:48 -0500 Subject: animation now always works, added player spawn --- src/animations.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/animations.rs') diff --git a/src/animations.rs b/src/animations.rs index 43f4326..58b6bf2 100644 --- a/src/animations.rs +++ b/src/animations.rs @@ -43,14 +43,16 @@ impl Animation { } pub fn draw(&self, spritebatch: &mut SpriteBatch, position: Point2) { - spritebatch.add( - DrawParam::default() - .src(self.current.source) - .rotation(self.current.properties.rotation) - .offset(Point2::new(0.5, 0.5)) - .dest(position) - .scale(Vector2::new(constants::TILE_SCALE, constants::TILE_SCALE)), - ); + if self.current.properties.visible.is_none() { + spritebatch.add( + DrawParam::default() + .src(self.current.source) + .rotation(self.current.properties.rotation) + .offset(Point2::new(0.5, 0.5)) + .dest(position) + .scale(Vector2::new(constants::TILE_SCALE, constants::TILE_SCALE)), + ); + } } } -- cgit v1.2.3