fix player not being able to shoot while skeleton arrows exist

This commit is contained in:
Haze Weathers 2023-01-20 23:36:51 -05:00
parent 54c87088af
commit 7abd3fbb42

View file

@ -207,6 +207,7 @@ func spawn_arrow():
global_position.y + arrowpos.y global_position.y + arrowpos.y
) )
arrow.direction = sprite.scale.x arrow.direction = sprite.scale.x
arrow.add_to_group("player_arrow")
map.add_child(arrow) map.add_child(arrow)
func check_jump(): func check_jump():
@ -238,7 +239,7 @@ func check_double_jump():
func check_shoot(): func check_shoot():
#Only Shoot if have arrows and there are no arrows onscreen #Only Shoot if have arrows and there are no arrows onscreen
if Input.is_action_just_pressed("shoot") && Game.arrows > 0 && get_tree().get_nodes_in_group("arrow").size() == 0: if Input.is_action_just_pressed("shoot") && Game.arrows > 0 && get_tree().get_nodes_in_group("player_arrow").size() == 0:
current_state = State.SHOOT current_state = State.SHOOT
if is_on_floor(): if is_on_floor():
anims.play("shoot grounded") anims.play("shoot grounded")