Floppy_Bort/scenes/pipe/pipe.gd

21 lines
522 B
GDScript3
Raw Normal View History

2025-02-11 19:47:33 +01:00
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")