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

14
vehicules/brake_zone.gd Normal file
View File

@@ -0,0 +1,14 @@
extends Node2D
@export var fullStop: bool = true
func _on_body_entered(body: Node2D) -> void:
$Label.text = str(body)+ " " + "body entered "
if body.has_method("brake"):
(body as Car).brake(fullStop)
func _on_body_exited(body: Node2D) -> void:
$Label.text = str(body)+ " " + "body exited "
if body.has_method("accelerate"):
(body as Car).accelerate()