Wicked-Depths/spikes.gd

12 lines
459 B
GDScript

extends CharacterBody2D
func _on_area_2d_body_shape_entered(body_rid, body, body_shape_index, local_shape_index):
if body.name == "plr" and body.can_move:
body.get_node("AnimationPlayer").play("death")
body.position = get_tree().current_scene.get_node("CheckPoints").current.position
get_parent().get_node("cloud").fail = true
await body.get_node("AnimationPlayer").animation_finished
body.get_node("AnimatedSprite2D").modulate = Color(1,1,1,1)