mirror of
https://github.com/Steffo99/looping-for-loops.git
synced 2024-11-22 16:14:22 +00:00
12 lines
318 B
GDScript
12 lines
318 B
GDScript
extends Node2D
|
|
class_name WrapParent
|
|
|
|
|
|
onready var parent: Node2D = get_parent()
|
|
onready var wrapper: Wrapper = get_tree().current_scene.get_node("Wrapper")
|
|
onready var absolute_position: Vector2 = parent.position
|
|
|
|
|
|
func _physics_process(delta):
|
|
if global_position.x <= 0:
|
|
parent.position.x += wrapper.total_length
|