18 lines
379 B
GDScript
18 lines
379 B
GDScript
extends CSGSpawner
|
|
|
|
@export var number_of_clouds : int = 50
|
|
@export var cloud = preload("res://cloud1.tscn")
|
|
|
|
func _ready() -> void:
|
|
spawn_clouds()
|
|
|
|
func spawn_clouds():
|
|
while number_of_clouds >= 0:
|
|
number_of_clouds -= 1
|
|
|
|
var spawn_pos = random_box_pos()
|
|
|
|
var cloud = cloud.instantiate()
|
|
add_child(cloud)
|
|
cloud.global_position = self.global_position + spawn_pos
|