Des feux rouges!
Pour arrêter les voiture vroom vroom
This commit is contained in:
14
vehicules/brake_zone.gd
Normal file
14
vehicules/brake_zone.gd
Normal 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()
|
||||
Reference in New Issue
Block a user