extends Node2D

@onready var sprite = Sprite2D.new()

var orbit_center: Vector2
var orbit_radius: float
var rotation_speed: float
var angle: float = 0.0

func _ready():
	add_child(sprite)
	angle = randf() * TAU

func set_texture(tex: Texture2D):
	sprite.texture = tex
	sprite.centered = true
	sprite.scale = Vector2(0.3, 0.3)

func _process(delta):
	angle += rotation_speed * delta
	position = orbit_center + Vector2(cos(angle), sin(angle)) * orbit_radius
