using Godot; namespace Newlon.Components.Level; public partial class SunSpawner : Node { [Export] public int MinSun = 25; [Export] public int MaxSun = 25; [Export] private PackedScene SunScene; public void Spawn() { float x = GD.Randf() * 9 * FieldParams.TileWidth; uint y = GD.Randi() % 5; var sun = SunScene.Instantiate(); PoolContainer.Instance.Projectiles.AddChild(sun); sun.GlobalPosition = new Vector2(FieldParams.LeftFieldBoundary.X + x, -90); var moveTween = CreateTween(); moveTween.TweenProperty(sun, "global_position", new Vector2(FieldParams.LeftFieldBoundary.X + x, FieldParams.LeftFieldBoundary.Y + FieldParams.TileHeight * y + FieldParams.TileHeight / 2.0f), 9 - y); } }