More player animation signals
This commit is contained in:
parent
d3c5917aee
commit
4900563b71
|
@ -47,6 +47,9 @@ var ideling := true
|
||||||
# Signals for animation
|
# Signals for animation
|
||||||
signal signal_enter_idle
|
signal signal_enter_idle
|
||||||
signal signal_enter_run
|
signal signal_enter_run
|
||||||
|
signal signal_enter_jump
|
||||||
|
signal signal_enter_fall
|
||||||
|
signal signal_enter_dash
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
stm.state_debug_stat = { "key": "player state" }
|
stm.state_debug_stat = { "key": "player state" }
|
||||||
|
@ -82,6 +85,7 @@ func _physics_process(delta):
|
||||||
if coyote_jump_tmp <= 0:
|
if coyote_jump_tmp <= 0:
|
||||||
# Fall
|
# Fall
|
||||||
coyote_jump_tmp = coyote_jump
|
coyote_jump_tmp = coyote_jump
|
||||||
|
signal_enter_fall.emit()
|
||||||
stm.transition(air)
|
stm.transition(air)
|
||||||
else:
|
else:
|
||||||
coyote_jump_tmp -= delta
|
coyote_jump_tmp -= delta
|
||||||
|
@ -158,6 +162,7 @@ func _physics_process(delta):
|
||||||
if dir == Vector2.ZERO:
|
if dir == Vector2.ZERO:
|
||||||
if looking_right: dir.x = 1
|
if looking_right: dir.x = 1
|
||||||
else: dir.x = -1
|
else: dir.x = -1
|
||||||
|
signal_enter_dash.emit()
|
||||||
stm.transition(dash)
|
stm.transition(dash)
|
||||||
current_state().direction = dir
|
current_state().direction = dir
|
||||||
# Done with dash
|
# Done with dash
|
||||||
|
@ -199,6 +204,7 @@ func disable_hitboxes():
|
||||||
hitbox.set_active(false)
|
hitbox.set_active(false)
|
||||||
|
|
||||||
func do_jump():
|
func do_jump():
|
||||||
|
signal_enter_jump.emit()
|
||||||
stm.transition(air, { "jump_stats" : current_state().jump() })
|
stm.transition(air, { "jump_stats" : current_state().jump() })
|
||||||
|
|
||||||
func get_dir() -> Vector2:
|
func get_dir() -> Vector2:
|
||||||
|
|
Loading…
Reference in a new issue