18 lines
406 B
GDScript
18 lines
406 B
GDScript
extends Area2D
|
|
|
|
class_name WarpZone
|
|
|
|
signal player_entered
|
|
|
|
var NON_SPECIFIED_LEVEL :=Vector2(-1, -1)
|
|
|
|
export var to_level_coord:Vector2 =NON_SPECIFIED_LEVEL
|
|
export var is_exit:bool = true
|
|
|
|
func _ready() -> void:
|
|
add_to_group("WarpZones")
|
|
|
|
func _on_body_entered(body:Node):
|
|
if body.name == "Player" and get_parent().is_active_level:
|
|
emit_signal("player_entered", is_exit, to_level_coord, position)
|