diff --git a/novembergame/scripts/dudecontroller.gd b/novembergame/scripts/dudecontroller.gd index ca83a40..7739a09 100644 --- a/novembergame/scripts/dudecontroller.gd +++ b/novembergame/scripts/dudecontroller.gd @@ -20,6 +20,7 @@ var isJumping = false var animPlaying = "idle" var living = true +var showGun = false signal playerDead @@ -37,12 +38,17 @@ func killPlayer(): playerSprite.play(animPlaying) func gunCollected(): print("Player knows to show gun") - gun.visible = true + showGun = true func gunDrop(): - gun.visible = false - + showGun = false + func _physics_process(delta: float) -> void: + if not showGun: + gun.visible = false + else: + gun.visible = true + if living and not animPlaying =="hurt": # Add the gravity. if not is_on_floor():