diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-04-27 20:06:49 +0200 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-04-27 20:06:49 +0200 |
commit | 81cc6f1d22677dd4a60aa9377c91b291bf10e523 (patch) | |
tree | 9c22712a9746ed0598a44be6e88727d021436860 /Scenes/Entities/Objects/Vines.gd | |
parent | c8a316e4b8987dad963656a34665fa0e23dedcb1 (diff) |
update
Diffstat (limited to 'Scenes/Entities/Objects/Vines.gd')
-rw-r--r-- | Scenes/Entities/Objects/Vines.gd | 11 |
1 files changed, 7 insertions, 4 deletions
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() |