Files
chaussette.sale/vehicules/brake_zone.gd
Thomas 725584c477 Des feux rouges!
Pour arrêter les voiture vroom vroom
2025-02-24 18:09:33 +01:00

15 lines
363 B
GDScript

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()