2020-10-04 14:35:24 +00:00
|
|
|
extends ScrollParent
|
|
|
|
class_name ConveyorScrollParent
|
|
|
|
|
|
|
|
|
2020-10-04 15:48:28 +00:00
|
|
|
var conveyor_belt: ConveyorBelt = null
|
2020-10-04 14:35:24 +00:00
|
|
|
|
|
|
|
|
2020-10-04 15:48:28 +00:00
|
|
|
func _ready():
|
2020-10-04 14:35:24 +00:00
|
|
|
conveyor_belt = get_tree().current_scene.get_node("ConveyorBelt")
|
2020-10-04 15:48:28 +00:00
|
|
|
_on_ConveyorBelt_cb_speed_changed(0, conveyor_belt.cb_speed)
|
2020-10-04 14:35:24 +00:00
|
|
|
conveyor_belt.connect("cb_speed_changed", self, "_on_ConveyorBelt_cb_speed_changed")
|
|
|
|
|
|
|
|
func _on_ConveyorBelt_cb_speed_changed(old, new):
|
2020-10-04 15:48:28 +00:00
|
|
|
scroll_velocity.x = -new
|