the-third-place/scenes/parallax_clouds.gd

17 lines
458 B
GDScript

extends Node2D
var scroll_multiplier: float = 200
@onready var parallax_nodes = get_tree().get_nodes_in_group("parallax_clouds")
func _ready():
EventBus.cloud_speed.connect(_on_cloud_speed)
func _on_cloud_speed():
$CoffeeBuoy.hide()
for node in parallax_nodes:
if node is Parallax2D:
var current_autoscroll = node.get_autoscroll()
current_autoscroll.y += scroll_multiplier
node.set_autoscroll(current_autoscroll)