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 animPlaying = "idle"
var living = true var living = true
var showGun = false
signal playerDead signal playerDead
@ -37,12 +38,17 @@ func killPlayer():
playerSprite.play(animPlaying) playerSprite.play(animPlaying)
func gunCollected(): func gunCollected():
print("Player knows to show gun") print("Player knows to show gun")
gun.visible = true showGun = true
func gunDrop(): func gunDrop():
gun.visible = false showGun = false
func _physics_process(delta: float) -> void: func _physics_process(delta: float) -> void:
if not showGun:
gun.visible = false
else:
gun.visible = true
if living and not animPlaying =="hurt": if living and not animPlaying =="hurt":
# Add the gravity. # Add the gravity.
if not is_on_floor(): if not is_on_floor():