fix for gun show

This commit is contained in:
OddlyTimbot 2024-12-24 14:10:44 -05:00
parent c4af95fa6b
commit 4ca6a775aa

View File

@ -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():