From 334a2f7248b24fa49d1688cb554fd9786bb9b734 Mon Sep 17 00:00:00 2001 From: 3002102 <3002102@stud.th-mannheim.de> Date: Tue, 14 Apr 2026 14:49:34 +0200 Subject: [PATCH] fixed shuriken issue where it would bounce between two blue slimes endlessly --- scripts/shuriken.gd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/shuriken.gd b/scripts/shuriken.gd index 792e05b..081d14b 100644 --- a/scripts/shuriken.gd +++ b/scripts/shuriken.gd @@ -13,7 +13,7 @@ func _ready() -> void: launch(first.global_position) func _on_body_entered(body: Node2D) -> void: - if body.is_in_group("enemies"): + if body.is_in_group("enemies") and not body.is_hurt and not body.is_dying: enemies_hit += 1 body.hit() if enemies_hit == 20: @@ -29,7 +29,7 @@ func get_nearest_enemy(from: Vector2, exclude: Node = null) -> Node: var nearest = null var min_distance = INF for enemy in get_tree().get_nodes_in_group("enemies"): - if enemy == exclude or enemy.is_dying: + if enemy == exclude or enemy.is_dying or enemy.is_hurt: continue var dist = from.distance_to(enemy.global_position) if dist < min_distance: