2024-10-01 15:56:30 +02:00
|
|
|
extends Marker2D
|
|
|
|
|
|
|
|
var speed
|
|
|
|
|
|
|
|
func _ready() -> void:
|
|
|
|
speed = $"/root/Global".speed #get_parent().speed
|
|
|
|
|
|
|
|
|
|
|
|
func _spawn() -> void:
|
2024-11-04 19:10:10 +01:00
|
|
|
var hindernis = preload("res://scenes/hurdle/hurdle.tscn").instantiate()
|
2024-10-01 15:56:30 +02:00
|
|
|
speed = $"/root/Global".speed
|
|
|
|
hindernis.speed = speed
|
|
|
|
|
|
|
|
var v1 = 1.5 - (speed / 260)
|
|
|
|
var v2 = 2.0 - (speed / 260)
|
2024-10-18 16:34:51 +02:00
|
|
|
#print(str(v1)," ",str(v2))
|
2024-10-01 15:56:30 +02:00
|
|
|
|
2024-10-22 19:52:35 +02:00
|
|
|
$"../SpawnTimer".wait_time = randf_range(v1,v2)
|
2024-10-01 15:56:30 +02:00
|
|
|
add_child(hindernis)
|
|
|
|
|
|
|
|
func del_all():
|
|
|
|
for child in get_children():
|
|
|
|
child.queue_free()
|