fix for gun show
This commit is contained in:
parent
c4af95fa6b
commit
4ca6a775aa
@ -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():
|
||||
|
Loading…
Reference in New Issue
Block a user