From 14665512e17da7fd43b2c9eb9dbb61624158613b Mon Sep 17 00:00:00 2001 From: _ <_@_> Date: Thu, 23 Dec 2021 01:43:30 +0000 Subject: [PATCH] don't draw player shadow over the death pit --- src/bin/platformer/graphics.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/platformer/graphics.rs b/src/bin/platformer/graphics.rs index 080c85b..31ed7f5 100644 --- a/src/bin/platformer/graphics.rs +++ b/src/bin/platformer/graphics.rs @@ -348,7 +348,8 @@ impl Graphics { self.texture_white.bind (); - if coll.t <= 1.0 { + // kill_z + if coll.t <= 1.0 && coll.p_impact.z > -3.0 { let mvp = view_mat * Mat4::from_translation (coll.p_impact + Vec3::new (0.0, 0.0, 0.0625)) * Mat4::from_scale ((0.5, 0.5, 0.0).into ());