22 lines
505 B
C#
22 lines
505 B
C#
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using Godot;
|
|
using Godot.Bridge;
|
|
using Godot.NativeInterop;
|
|
|
|
[ScriptPath("res://Scripts/Parallax.cs")]
|
|
public partial class Parallax : Node2D
|
|
{
|
|
[Export(PropertyHint.None, "")]
|
|
private float startX;
|
|
|
|
[Export(PropertyHint.None, "")]
|
|
private float divide = 1.5f;
|
|
|
|
public override void _Process(double delta)
|
|
{
|
|
base.GlobalPosition = new Vector2(CameraController.instance.GlobalPosition.X / divide + startX, base.GlobalPosition.Y);
|
|
}
|
|
|
|
}
|