summaryrefslogtreecommitdiff
path: root/src/animations.rs
diff options
context:
space:
mode:
authortom barrett <spalf0@gmail.com>2019-07-10 09:43:48 -0500
committertom barrett <spalf0@gmail.com>2019-07-10 09:43:48 -0500
commitced37025a37051db896443d310f5f613f1281882 (patch)
tree6faa646addcd2cfa1c49154a06846321a6e2e423 /src/animations.rs
parent503361ce70615d7c4b66bd7e49d56c61259dab32 (diff)
animation now always works, added player spawn
Diffstat (limited to 'src/animations.rs')
-rw-r--r--src/animations.rs18
1 files changed, 10 insertions, 8 deletions
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<f32>) {
- 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)),
+ );
+ }
}
}