level graphics

This commit is contained in:
Lilith Schier 2026-08-28 12:42:49 +02:00
parent 8577de2c04
commit a563a3967f
17 changed files with 183 additions and 205 deletions

25
src/level/Rain.cs Normal file
View file

@ -0,0 +1,25 @@
namespace Dancer;
[Meta(typeof(IAutoNode))]
public sealed partial class Rain : Sprite2D
{
[Export] private float Speed { get; set; } = 10;
public override void _Notification(int what) => this.Notify(what);
public void OnReady()
{
SetProcess(true);
}
public void OnProcess(double delta)
{
Position += new Vector2(0, Speed * (float)delta);
var textureHeight = Texture.GetHeight();
if (Position.Y > textureHeight)
{
Position -= new Vector2(0, textureHeight);
}
}
}