Files
CarRacer/opponent_car.gd
2020-11-04 22:59:53 +01:00

18 lines
375 B
GDScript

extends PathFollow2D
export (float) var speed = 0.125
# Called when the node enters the scene tree for the first time.
func _ready():
pass
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if not Global.race_started:
return -1
var position = get_unit_offset()
position += speed * delta
set_unit_offset(position)