2024-11-04 19:10:10 +01:00
|
|
|
extends Marker2D
|
|
|
|
|
|
|
|
var speed
|
|
|
|
|
|
|
|
func _ready() -> void:
|
|
|
|
speed = $"/root/Global".speed #get_parent().speed
|
|
|
|
_spawn()
|
|
|
|
|
|
|
|
|
|
|
|
func _spawn() -> void:
|
|
|
|
var coin = preload("res://scenes/coin/coin.tscn").instantiate()
|
|
|
|
speed = $"/root/Global".speed
|
|
|
|
|
|
|
|
var v1 = 1.5 - (speed / 200)#260
|
|
|
|
var v2 = 2.0 - (speed / 200)
|
2024-11-10 19:51:00 +01:00
|
|
|
coin.global_position.y -= randi_range(0,2)*14
|
2024-11-04 19:10:10 +01:00
|
|
|
$"../CoinSpawnTimer".wait_time = randf_range(v1,v2)
|
|
|
|
add_child(coin)
|
|
|
|
|
|
|
|
func del_all():
|
|
|
|
for child in get_children():
|
|
|
|
child.queue_free()
|