Fix: Mirrored sprites now play the same animation always
This commit is contained in:
parent
07f3c13fd2
commit
85d1ef44a9
|
|
@ -17,8 +17,13 @@ func _ready() -> void:
|
||||||
sprite.play("Healthy")
|
sprite.play("Healthy")
|
||||||
|
|
||||||
mirrorSprite1 = sprite.duplicate()
|
mirrorSprite1 = sprite.duplicate()
|
||||||
|
sprite.play("Healthy")
|
||||||
|
|
||||||
mirrorSprite2 = sprite.duplicate()
|
mirrorSprite2 = sprite.duplicate()
|
||||||
|
sprite.play("Healthy")
|
||||||
|
|
||||||
mirrorSprite3 = sprite.duplicate()
|
mirrorSprite3 = sprite.duplicate()
|
||||||
|
sprite.play("Healthy")
|
||||||
|
|
||||||
add_child(mirrorSprite1)
|
add_child(mirrorSprite1)
|
||||||
add_child(mirrorSprite2)
|
add_child(mirrorSprite2)
|
||||||
|
|
@ -54,6 +59,9 @@ func handle_damage(dmg: int, src: Node) -> void:
|
||||||
|
|
||||||
func die() -> void:
|
func die() -> void:
|
||||||
sprite.play("Dying")
|
sprite.play("Dying")
|
||||||
|
mirrorSprite1.play("Dying")
|
||||||
|
mirrorSprite2.play("Dying")
|
||||||
|
mirrorSprite3.play("Dying")
|
||||||
super.die()
|
super.die()
|
||||||
|
|
||||||
func become_injured() -> void:
|
func become_injured() -> void:
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,6 @@ rotation = 0.474154
|
||||||
[node name="StateMachine" type="Node" parent="." index="2" unique_id=445822474 node_paths=PackedStringArray("initial_state")]
|
[node name="StateMachine" type="Node" parent="." index="2" unique_id=445822474 node_paths=PackedStringArray("initial_state")]
|
||||||
script = ExtResource("9_xxtgy")
|
script = ExtResource("9_xxtgy")
|
||||||
initial_state = NodePath("Idle")
|
initial_state = NodePath("Idle")
|
||||||
metadata/_custom_type_script = "uid://ck7k8ht54snsy"
|
|
||||||
|
|
||||||
[node name="RandomMovement" type="Node" parent="StateMachine" index="0" unique_id=1422146232]
|
[node name="RandomMovement" type="Node" parent="StateMachine" index="0" unique_id=1422146232]
|
||||||
script = ExtResource("10_rgguv")
|
script = ExtResource("10_rgguv")
|
||||||
|
|
@ -81,7 +80,6 @@ script = ExtResource("12_xxtgy")
|
||||||
|
|
||||||
[node name="Idle" type="Node" parent="StateMachine" index="2" unique_id=1424222731]
|
[node name="Idle" type="Node" parent="StateMachine" index="2" unique_id=1424222731]
|
||||||
script = ExtResource("12_ubfhk")
|
script = ExtResource("12_ubfhk")
|
||||||
metadata/_custom_type_script = "uid://co2xp7gauamql"
|
|
||||||
|
|
||||||
[node name="Timer" type="Timer" parent="StateMachine/Idle" index="0" unique_id=1050348256]
|
[node name="Timer" type="Timer" parent="StateMachine/Idle" index="0" unique_id=1050348256]
|
||||||
one_shot = true
|
one_shot = true
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue