From 81cc6f1d22677dd4a60aa9377c91b291bf10e523 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sat, 27 Apr 2024 20:06:49 +0200 Subject: update --- Scenes/Entities/Objects/Vines.gd | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Scenes/Entities/Objects/Vines.gd') diff --git a/Scenes/Entities/Objects/Vines.gd b/Scenes/Entities/Objects/Vines.gd index ac2c249..5e36fc2 100644 --- a/Scenes/Entities/Objects/Vines.gd +++ b/Scenes/Entities/Objects/Vines.gd @@ -27,7 +27,8 @@ func _process(_delta): func spread(): var grow = func(): - $CollisionShape2D.shape.size.x += 16 * $AnimatedSprite2D.frame + $CollisionShape2D.shape.size.x += 8 * $AnimatedSprite2D.frame + $CollisionShape2D.position.x += 8 $AnimatedSprite2D.frame_changed.connect(grow) $AnimatedSprite2D.play() @@ -37,17 +38,19 @@ func spread(): func retract(): var shrink = func(): - $CollisionShape2D.shape.size.x -= 16 * ($AnimatedSprite2D.frame + 1) + $CollisionShape2D.shape.size.x -= 8 * ($AnimatedSprite2D.frame + 1) + $CollisionShape2D.position.x -= 8 $AnimatedSprite2D.frame_changed.connect(shrink) $AnimatedSprite2D.play_backwards() await $AnimatedSprite2D.animation_finished $AnimatedSprite2D.frame_changed.disconnect(shrink) - await get_tree().create_timer(3).timeout + $Timer.start() + await $Timer.timeout spread() func hit_by_explosion(): - if not $AnimatedSprite2D.is_playing(): + if not $AnimatedSprite2D.is_playing() and $Timer.is_stopped(): retract() -- cgit v1.2.3