extends Node2D @onready var player: CharacterBody2D = $Player @onready var start_position: Marker2D = $StartPosition func _ready() -> void: var traps = get_tree().get_nodes_in_group("traps") for trap in traps: if trap is Trap: trap.touched_player.connect(_on_trap_touched_player) # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: if Input.is_action_just_pressed("quit"): get_tree().quit() elif Input.is_action_just_pressed("reset"): get_tree().reload_current_scene() func _on_death_zone_body_entered(body: Node2D) -> void: reset_player() pass # Replace with function body. func _on_trap_touched_player() -> void: reset_player() pass # Replace with function body. func reset_player() -> void: player.velocity = Vector2.ZERO player.global_position = start_position.global_position pass