Godot-SpaceShooter/Scripts/Background.cs

13 lines
340 B
C#

using Godot;
namespace GodotspaceShooter.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;
}
}