Hi all,
I am still struggling with this. I know it will "click" at some point so I'm hoping this is that moment.
I am building a breakout / arkanoid clone.
I have many brick nodes on screen.
When the ball hits the bricks, they explode.
I want to know what texture the brick contains, so the particles can use that to their advantage.
So in my brick.gd scene I have:
var currentTexture = get_node("TextureButton").get_normal_texture()
var currentTextureName = currentTexture.get_path()
emit_signal("brickColour", currentTextureName)
In my particle scene I have:
func _ready():
connect("brickColour", self, "setParticleTexture")
func setParticleTexture(colour):
print ("texture is : ", colour)
The problem is that Print statement never occurs. Nothing is being sent (or received at least).
Now I KNOW that in my particle scene I need to have something like:
func _ready():
var brick = get_node("/path/to/brick")
brick.connect("brickColour", self, "setParticleTexture")
BUT I don't know what that path is to each brick as there are HEAPS of bricks and they are named in various strange names that have been assigned to them. So I can't know what bricks name it was, that sent the signal.
How can I get around this? There MUST be a way, I just can't wrap my head around it.
Any help would be very much appreciated.