File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ var lifePoint = maxHealth
7
7
8
8
@onready var attackTimer = $ AttackTimer
9
9
@onready var healthbar = $ HealthBar
10
+ @onready var animation_player : AnimationPlayer = $ AnimationPlayer
10
11
11
12
@export var weapon : Weapon
12
13
var hasChest = false
@@ -31,11 +32,11 @@ func apply_attack(force: int) -> void:
31
32
return
32
33
33
34
lifePoint -= force
34
- $ AnimationPlayer .play ('Hit' )
35
+ animation_player .play ('Hit' )
35
36
healthbar .value = lifePoint
36
37
37
38
if (lifePoint == 0 ):
38
- $ AnimationPlayer .play ("Death" )
39
+ animation_player .play ("Death" )
39
40
40
41
func get_speed ():
41
42
if hasChest : return _speed * chestModifierSpeed
@@ -66,6 +67,6 @@ func _on_collecting(element):
66
67
if element is Boat :
67
68
if hasChest :
68
69
element .can_enter = true
69
- $ AnimationPlayer .play ("FadeAway" )
70
+ animation_player .play ("FadeAway" )
70
71
71
- if element .can_enter : $ AnimationPlayer .play ("FadeAway" )
72
+ if element .can_enter : animation_player .play ("FadeAway" )
You can’t perform that action at this time.
0 commit comments