I am trying to develop a game under HTML 5. I want do is when a mouse clicked on my sprite it will vanish or move to certain points. Now what i currently doing is when mouse event occurred i check whether the clicked position touched my any of sprite among others by using for loop .
Now i would like to know is there any way to do that by adding event listener on the sprite that only it will respond to mouse event without checking other.
Can javascripts custom events came in handy with this situation?
I know with KinectJS it is possible (i have not enough experience with it though).
But i would like to do it by myself without any help of library.
I am newbie here so, sorry in advance if i made any mistakes regarding my question.