Lets say I have 40 sprites on the screen, and I want to be able to move them via touches.
Right now, I'm just doing something like
when ccTouchBegan
{
for each sprite
{
if (sprite location == ccTouchBegan location)
{
do evil stuffz
}
}
}
and for the sprite location == ccTouchBegan location,
I simply do something like
if ( sprite.location.x < (touch.location.x+radius) && sprite.lcation.x > (touch.location.x-radius) && sprite.location.y < (touch.locaiton.y+radius) && sprite.location.y > (touch.location.y-radius) )
which I feel like is a ghetto, inefficient way of doing it.....
So I guess what I'm asking is, does what I'm doing above sound a decent way to do it ?? Is there a better way ?