diff options
author | tom barrett <spalf0@gmail.com> | 2019-07-10 09:43:48 -0500 |
---|---|---|
committer | tom barrett <spalf0@gmail.com> | 2019-07-10 09:43:48 -0500 |
commit | ced37025a37051db896443d310f5f613f1281882 (patch) | |
tree | 6faa646addcd2cfa1c49154a06846321a6e2e423 /src/animations.rs | |
parent | 503361ce70615d7c4b66bd7e49d56c61259dab32 (diff) |
animation now always works, added player spawn
Diffstat (limited to 'src/animations.rs')
-rw-r--r-- | src/animations.rs | 18 |
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)), + ); + } } } |