blob: d287bdcc949fab19e8678c5d50feab6f9a44db0d (
plain)
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
|
extends CharacterBody2D
var angle: float = 0
func _ready():
$Body/Bottom.play("default")
add_to_group("enemies")
$Collision.init()
$Collision.collision_area.set_collision_layer_value(Utilities.Collision.Layer.ENEMY, true)
$Health.hit.connect(func():
$Body/Top.visible = false
)
$Health.died.connect(func():
$Body.remove_child($Body/Top)
)
func shrink():
$Body/Top.play_backwards("default")
func expand():
$Body/Top.play("default")
|