forked from team-sg/hero-mark-2
fix player not being able to shoot while skeleton arrows exist
This commit is contained in:
parent
54c87088af
commit
7abd3fbb42
1 changed files with 3 additions and 2 deletions
|
@ -207,6 +207,7 @@ func spawn_arrow():
|
|||
global_position.y + arrowpos.y
|
||||
)
|
||||
arrow.direction = sprite.scale.x
|
||||
arrow.add_to_group("player_arrow")
|
||||
map.add_child(arrow)
|
||||
|
||||
func check_jump():
|
||||
|
@ -238,13 +239,13 @@ func check_double_jump():
|
|||
|
||||
func check_shoot():
|
||||
#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
|
||||
if is_on_floor():
|
||||
anims.play("shoot grounded")
|
||||
else:
|
||||
anims.play("shoot air") #Shoot immediately in air
|
||||
|
||||
|
||||
func move(hsp,vsp,flip:bool):
|
||||
if is_on_floor() or can_move_in_air:
|
||||
velocity.x = hsp * axis.x
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue