dancer-godot/src/level/Rain.cs
2026-08-28 16:44:15 +02:00

24 lines
510 B
C#

namespace Dancer;
[Meta(typeof(IAutoNode))]
public sealed partial class Rain : Sprite2D
{
[Export] private Vector2 Movement { get; set; } = new(0, 10);
public override void _Notification(int what) => this.Notify(what);
public void OnReady()
{
SetProcess(true);
}
public void OnProcess(double delta)
{
var position = Position;
position += Movement * (float)delta;
var textureSize = Texture.GetSize();
position = position.PosMod(textureSize);
Position = position;
}
}