First trap initialized!

This commit is contained in:
2025-03-13 19:50:05 +01:00
parent 491755209f
commit 183f575160
14 changed files with 498 additions and 22 deletions

17
Game/Traps/traps.gd Normal file
View File

@ -0,0 +1,17 @@
extends Node2D
var follower = false
func _ready() -> void:
follower = true
set_process_input(true)
func _process(delta: float) -> void:
if follower:
position = get_viewport().get_mouse_position()
func _input(event):
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
if abs(position) <= get_viewport().get_mouse_position():
follower = false