extends Node2D

# Speed of movement in units per second
@export var speed: float = 50.0
@onready var game: Node2D = $".."
const CLOUD = preload("res://scenes/cloud.tscn")

func _ready() -> void:
	await get_tree().create_timer(20).timeout
	var cloud = CLOUD.instantiate()
	cloud.position = Vector2(-960,0)
	game.add_child(cloud)
	
	await get_tree().create_timer(40).timeout
	queue_free()

func _process(delta: float) -> void:
	# Move the node along the X-axis
	position.x += speed * delta
