blob: 7c87a1849aa44016566516a0f350b9ed83c7e751 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
extends CharacterBody2D
func _ready():
add_to_group("enemies")
get_node("Collision").init()
set_physics_process(false)
$AnimatedSprite2D.play("spawn")
$AnimatedSprite2D.stop()
$AnimatedSprite2D.set_frame_and_progress(0, 0)
func _physics_process(delta):
get_node("Movement").physics_process(delta)
func _on_detection_body_entered(body):
$AnimatedSprite2D.play("spawn")
await $AnimatedSprite2D.animation_finished
set_physics_process(true)
|