So I'm working on a little mobile game where you have to touch these randomly spawned physics balls. I have a system where there is an invisible box pinned to each ball, and I use that to detect the touch so that it has a larger radius, like so:
<img src="http://i.imgur.com/s6wPpxO.png" border="0" />
When the box is touched, it sets the ball as selected and destroys the box, to prevent it from being touched again. Unfortunately, sometimes when two or more balls are close to each other, you would end up touching multiple boxes, but would only select one ball. This would render the other ball un-touchable.
I probably need to do one of two things:
- Instead of destroying the box, finding a way to make it un-touchable after it has been selected.
- Find a different method of detecting a touch within a certain radius of the ball, and getting rid of the box altogether.
What do you guys think? I'd prefer to get rid of the box all together and find a way to detect a touch within a certain radius, but I can't seem to find anything. I may just be overlooking something extremely obvious and wasting my time, but maybe not.
Edit: Actually the first idea on that list wouldn't work either, so I need to figure out something with the second idea.