forked from team-sg/hero-mark-2
fix INACTIVE state in player
This commit is contained in:
parent
343151ebdf
commit
d57194597e
1 changed files with 6 additions and 2 deletions
|
@ -38,12 +38,12 @@ func _ready():
|
|||
Game.respawn_point = global_position
|
||||
|
||||
func _physics_process(delta):
|
||||
if current_state == State.INACTIVE:
|
||||
return
|
||||
axis = Vector2(Input.get_axis("ui_left","ui_right"),Input.get_axis("ui_up","ui_down"))
|
||||
#Check ladder
|
||||
check_ladder()
|
||||
match current_state:
|
||||
State.INACTIVE:
|
||||
return
|
||||
State.IDLE:
|
||||
_process_idle()
|
||||
continue
|
||||
|
@ -270,6 +270,8 @@ func check_ladder():
|
|||
#climb_ray.position.x = 4 * sprite.scale.x
|
||||
|
||||
func die():
|
||||
if current_state == State.INACTIVE:
|
||||
return
|
||||
var new_particles = death_particles.duplicate()
|
||||
get_parent().add_child(new_particles)
|
||||
new_particles.global_position = global_position
|
||||
|
@ -296,6 +298,8 @@ func die():
|
|||
sprite.visible = true
|
||||
|
||||
func _on_AnimationPlayer_animation_finished(anim_name):
|
||||
if current_state == State.INACTIVE:
|
||||
return
|
||||
#Return to idle after slash
|
||||
if anim_name == "stab":
|
||||
current_state = State.IDLE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue