De la signalétique! la circulation sécurisée

Et oui, le maire de chaussette city investit
Et ça se voit, bientôt les feux rouges et la circulation alternée le
weekend moi je vous l'dis!
This commit is contained in:
Thomas
2025-02-22 09:48:33 +01:00
parent 5721680834
commit 3ba18fbddf
5 changed files with 65 additions and 15 deletions

View File

@@ -4,3 +4,8 @@
[node name="ZIndexControler" type="Node2D"]
script = ExtResource("1_fn0ft")
[node name="debugLabel" type="Label" parent="."]
visible = false
offset_right = 40.0
offset_bottom = 23.0

View File

@@ -14,9 +14,9 @@ func _process(delta: float) -> void:
var nbCollisions = $ShapeCast2D.get_collision_count()
for n in range(8):
var colider = $ShapeCast2D.get_collider(n) as Node2D
if colider != null:
if colider != null and colider != get_parent():
(get_parent() as Node2D).z_index = colider.z_index+1
hasManipulatedZIndex = true
print((get_parent() as Node2D).z_index)
$debugLabel.text = str(get_parent()) + " " + str((get_parent() as Node2D).z_index)
if !hasManipulatedZIndex:
(get_parent() as Node2D).z_index = 100