Add charge throw mechanics; refactor bullet and brick components
This commit is contained in:
21
scripts/components/out_of_screen_component.gd
Normal file
21
scripts/components/out_of_screen_component.gd
Normal file
@@ -0,0 +1,21 @@
|
||||
class_name OutOfScreenComponent
|
||||
extends Node
|
||||
|
||||
@export var visibility_notifier: VisibleOnScreenNotifier2D
|
||||
@export var root: Node
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
if not visibility_notifier:
|
||||
printerr("Visibility notifier not set.")
|
||||
return
|
||||
|
||||
visibility_notifier.screen_exited.connect(_on_screen_exited)
|
||||
|
||||
|
||||
func _on_screen_exited() -> void:
|
||||
if not root:
|
||||
printerr("Root node not set.")
|
||||
return
|
||||
|
||||
root.queue_free()
|
Reference in New Issue
Block a user