First trap initialized!
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user