Godot-SpaceShooter/Scripts/Background.cs

12 lines
294 B
C#

using Godot;
namespace Scripts;
public partial class Background : Sprite3D {
[Export] private float moveVelocity = -250f;
public override void _Process(double delta) {
Rect2 region = RegionRect;
region.Position += new Vector2(0, moveVelocity * (float)delta);
RegionRect = region;
}
}