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

View File

@ -1,4 +1,17 @@
extends Panel
@onready var livelabel: Label = $HBoxContainer4/HBoxContainer3/Label
@onready var stickspawner: Button = $HBoxContainer4/HBoxContainer4/Button2
const STICK_TRAP = preload("res://Game/Traps/stick_trap.tscn")
func _ready() -> void:
stickspawner.connect("button_up", Spawn_Stick)
func Update_Lives(lives) -> void:
livelabel.text = "Lives: " + str(lives)
func Spawn_Stick() -> void:
var stick = STICK_TRAP.instantiate()
stick.name = "StickTrap-" + str(randi())
get_parent().add_child(stick)