I am just making a proof of concept for a game that I am working on and I am having an issue.
On start, the first few selections work fine, the issue is that when I try to change "category" the new parameter value I want to set with the buttons that I am re-using do not change.
Here is my code:
extends Node2D
var category
var tile
func _process(delta):
$Control/forest.connect("pressed", self, "category_selecting", ["forest"])
$Control/desert.connect("pressed", self, "category_selecting", ["desert"])
if category=="forest":
var f_b0 = $Control/button0.connect("pressed", self, "tile_selecting", [0])
var f_b1 = $Control/button1.connect("pressed", self, "tile_selecting", [1])
if category=="desert":
var d_b0 = $Control/button0.connect("pressed", self, "tile_selecting", [2])
var d_b1 = $Control/button1.connect("pressed", self, "tile_selecting", [3])
func tile_selecting(build_type):
tile=build_type
print(tile)
func category_selecting(category_type):
category=category_type
print(category)