Des feux rouges!

Pour arrêter les voiture vroom vroom
This commit is contained in:
Thomas
2025-02-24 18:09:33 +01:00
parent 3ba18fbddf
commit 725584c477
14 changed files with 427 additions and 15 deletions

View File

@@ -12,7 +12,7 @@ func _process(delta: float) -> void:
var hasManipulatedZIndex = false
if $ShapeCast2D.is_colliding():
var nbCollisions = $ShapeCast2D.get_collision_count()
for n in range(8):
for n in range(nbCollisions):
var colider = $ShapeCast2D.get_collider(n) as Node2D
if colider != null and colider != get_parent():
(get_parent() as Node2D).z_index = colider.z_index+1