Fixed animation signals
This commit is contained in:
@@ -68,4 +68,6 @@ collision_mask = 0
|
||||
position = Vector2(0, 2)
|
||||
shape = SubResource("RectangleShape2D_vecdo")
|
||||
|
||||
[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_animation_finished"]
|
||||
[connection signal="animation_looped" from="AnimatedSprite2D" to="." method="_on_animation_looped"]
|
||||
[connection signal="body_entered" from="PlayerTouchArea" to="." method="_on_player_touch_area_entered"]
|
||||
|
||||
@@ -167,6 +167,10 @@ func _rearrange_pickups() -> void:
|
||||
node.position.y = 0
|
||||
|
||||
|
||||
func _play_look_around_animation() -> void:
|
||||
sprite.play(ANIMATION_LOOK_AROUND_1 if randi_range(1, 2) == 1 else ANIMATION_LOOK_AROUND_2)
|
||||
|
||||
|
||||
func _on_animation_finished() -> void:
|
||||
match sprite.animation:
|
||||
ANIMATION_LOOK_AROUND_1, ANIMATION_LOOK_AROUND_2:
|
||||
@@ -181,7 +185,3 @@ func _on_animation_looped() -> void:
|
||||
ANIMATION_IDLE:
|
||||
if randi_range(1, 100) <= LOOK_AROUND_CHANCE:
|
||||
_play_look_around_animation()
|
||||
|
||||
|
||||
func _play_look_around_animation() -> void:
|
||||
sprite.play(ANIMATION_LOOK_AROUND_1 if randi_range(1, 2) == 1 else ANIMATION_LOOK_AROUND_2)
|
||||
|
||||
@@ -13,6 +13,7 @@ collision_mask = 113
|
||||
script = ExtResource("1_xln5q")
|
||||
|
||||
[node name="AnimatedSprite2D" parent="." instance=ExtResource("2_n6ad3")]
|
||||
animation = &"death"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, 1)
|
||||
@@ -34,3 +35,6 @@ one_shot = true
|
||||
[node name="CoyoteTimeTimer" type="Timer" parent="."]
|
||||
wait_time = 0.1
|
||||
one_shot = true
|
||||
|
||||
[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_animation_finished"]
|
||||
[connection signal="animation_looped" from="AnimatedSprite2D" to="." method="_on_animation_looped"]
|
||||
|
||||
Reference in New Issue
Block a user