18 lines
513 B
GDScript
18 lines
513 B
GDScript
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)
|