diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-05-03 09:32:22 +0200 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-05-03 09:32:22 +0200 |
commit | 516d22c1737a9c94026b5ff0c9856bc5549aa416 (patch) | |
tree | cd9ef3089d1c8bdfc440b5673f7ad0d0dce787a9 /Scenes/Entities/Enemies/Balloon.gd | |
parent | d192b1546ab39180cdc28d2621c117539e3d26d6 (diff) |
update
Diffstat (limited to 'Scenes/Entities/Enemies/Balloon.gd')
-rw-r--r-- | Scenes/Entities/Enemies/Balloon.gd | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/Scenes/Entities/Enemies/Balloon.gd b/Scenes/Entities/Enemies/Balloon.gd index 7c4b402..ec41822 100644 --- a/Scenes/Entities/Enemies/Balloon.gd +++ b/Scenes/Entities/Enemies/Balloon.gd @@ -1,27 +1,15 @@ extends CharacterBody2D +@onready var component_collision: ComponentCollision = $Collision +@onready var component_movement: ComponentMovement = $Movement func _ready(): add_to_group("enemies") - get_node("Collision").init() - - get_node("Movement").connect("direction_changed", func(current_direction): - var frame = $AnimatedSprite2D.frame - var progress = $AnimatedSprite2D.frame_progress - if current_direction == Vector2.UP: - $AnimatedSprite2D.play("up") - elif current_direction == Vector2.DOWN: - $AnimatedSprite2D.play("down") - elif current_direction == Vector2.LEFT: - $AnimatedSprite2D.play("left") - elif current_direction == Vector2.RIGHT: - $AnimatedSprite2D.play("right") - $AnimatedSprite2D.set_frame_and_progress(frame, progress) - ) + component_collision.init() func _physics_process(delta): - get_node("Movement").physics_process(delta) + component_movement.physics_process(delta) # todo: animation shadow |