Lunar/autoscroll.gd

21 lines
520 B
GDScript3
Raw Permalink Normal View History

2025-06-27 16:39:28 +10:00
extends Camera2D
@export var camera_speed : float = 10
2025-07-18 22:41:26 +10:00
var current_speed : float = 0
2025-06-27 16:39:28 +10:00
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:
2025-07-18 22:41:26 +10:00
current_speed = clampf(current_speed + 10* delta,0,camera_speed)
position.x += delta * current_speed
2025-06-27 16:39:28 +10:00
func _on_lander_moved() -> void:
active = true