-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathIdle.gd
34 lines (27 loc) · 897 Bytes
/
Idle.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
extends Movement
class_name Idle
func _ready() -> void:
Event.listen("shot_layer_enabled", self, "recover")
Event.listen("shot_layer_disabled", self, "recover")
# warning-ignore:return_value_discarded
character.get_node("animatedSprite").connect("animation_finished", self, "_on_animatedSprite_animation_finished")
func _StartCondition() -> bool:
if character.is_on_floor():
return true
return false
func _Setup() -> void:
character.set_horizontal_speed(0)
deactivate_low_jumpcasts()
func _Update(_delta:float) -> void:
character.set_direction(get_pressed_direction())
update_bonus_horizontal_only_conveyor()
func _EndCondition() -> bool:
if not character.is_on_floor():
return true
return false
func recover() -> void:
if executing:
character.play_animation("recover")
character.animatedSprite.set_frame(0)
func _on_animatedSprite_animation_finished() -> void:
pass