netmasked/scripts/world_logic.gd

15 lines
413 B
GDScript

extends Node2D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
var player = get_tree().get_first_node_in_group("player")
if player:
if player.global_position.distance_to(global_position) > 600:
player.hit()
pass