You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
626 B
27 lines
626 B
extends Area2D
|
|
|
|
@export var KILL_ALL_NPCS = false
|
|
@export var LEVEL_MESSAGE : String = ''
|
|
@export var ENABLED_NODES : Array[Node] = []
|
|
@export var DISABLED_NODES : Array[Node] = []
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
body_entered.connect(on_body_entered)
|
|
|
|
|
|
func on_body_entered(body):
|
|
if !body.is_in_group('player'):
|
|
return
|
|
|
|
if KILL_ALL_NPCS:
|
|
if body.is_in_group("npc"):
|
|
body.queue_free()
|
|
if LEVEL_MESSAGE:
|
|
# TODO
|
|
print(LEVEL_MESSAGE)
|
|
pass
|
|
for node in ENABLED_NODES:
|
|
node.set_physics_process(true)
|
|
for node in DISABLED_NODES:
|
|
node.set_physics_process(false)
|
|
|