level graphics
This commit is contained in:
parent
8577de2c04
commit
a563a3967f
17 changed files with 183 additions and 205 deletions
25
src/level/Rain.cs
Normal file
25
src/level/Rain.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue