title: Touch Event on Sprite with Cocos2d-x 3.x?
body: <p>In my scene I have a vector with multiple custom sprites. When I tap on one of them, I want an action to be fired on another element on the scene, can be another sprite in the vector, or another node. I have been researching the best way to do this, but I'm not quite sure how to implement it. The options are:</p>
  
  <ul>
  <li><p>Add a touch listener to the scene, and verify if it was tapped inside the bounds of the sprite with <code>rect. containsPoint(point)</code>. And after that, I have to get the sprite that was tapped to do the action I want. For me, it doesn't seems very clean to do it this way. And if two sprites are overlaped, I have to verify if the sprite is behind or in the front in order to retrieve the desired sprite. I followed this example: <a href="http://www.gamefromscratch.com/post/2014/10/03/Cocos2d-x-Tutorial-Series-Handling-Touch-and-Mouse-Input.aspx" rel="nofollow">Touch Event example</a></p></li>
  <li><p>Add a touch listener in the subclass of the sprite (my custom sprite). And add <code>onTouchBegan</code> and <code>onTouchEnded</code> inside it. But this way, I don't know how to modify an attribute of another sprite, or another element in the scene (Is it possible to use Delegates like Objective-C does?). I followed this example: <a href="http://www.cocos2d-x.org/wiki/How_To_Subclass_Sprite_And_Add_Event_Listeners" rel="nofollow">Subclass Sprite Example</a></p></li>
  </ul>
  
  <p>My main problem is that I don't understand very well how to make a node interact with another node in the scene. I have seen a lot of tutorials, but in all of them, when you interact with a node, it only changes its attributes, not other nodes' attributes.</p>
  
  <p>Thanks in advance.</p>