19 lines
403 B
GDScript
19 lines
403 B
GDScript
extends CSGCylinder3D
|
|
|
|
var time_remaining : float
|
|
var collectable : Collectable
|
|
|
|
func generate_collectable() -> void:
|
|
pass
|
|
func _process(delta: float) -> void:
|
|
if time_remaining > 0:
|
|
time_remaining -= delta
|
|
|
|
if time_remaining <= 0 and collectable == null:
|
|
generate_collectable()
|
|
time_remaining = Game.level.collectable_drop_time
|
|
|
|
|
|
func _on_collectable_collected() -> void:
|
|
collectable = null
|