Lunar/autoscroll.gd
2025-07-18 22:41:26 +10:00

20 lines
520 B
GDScript

extends Camera2D
@export var camera_speed : float = 10
var current_speed : float = 0
var active : bool = false
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
if active:
current_speed = clampf(current_speed + 10* delta,0,camera_speed)
position.x += delta * current_speed
func _on_lander_moved() -> void:
active = true