20 lines
522 B
GDScript
20 lines
522 B
GDScript
extends AnimatableBody2D
|
|
|
|
@export var move=true
|
|
@export var del_on_screen_exit=true
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready() -> void:
|
|
if global_rotation_degrees > -90:
|
|
$sprite.flip_h = true
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(_delta: float) -> void:
|
|
if move:
|
|
global_position += Vector2(-4,0)
|
|
|
|
|
|
func _on_visible_on_screen_notifier_2d_screen_exited() -> void:
|
|
if del_on_screen_exit:
|
|
queue_free()
|
|
print("pipes deleted")
|