【发布时间】:2014-06-18 12:22:03
【问题描述】:
我想一次移动一个精灵......但是当我像这种方法移动精灵时,其他精灵的位置..我没有触及它的位置是自动互换的......我在 SpriteIconArray 中有四个精灵并且在 PointArray 中的 SameNumber 位置。请帮帮我。
CCLOG(@"%.f,%.f",touchLocation.x,touchLocation.y);
int k=0;
for (CCSprite *sprite in spriteIconArray)
{
if (CGRectContainsPoint(sprite.boundingBox, touchLocation))
{
if (k==0)
{
sprite.position=touchLocation;
sprite.zOrder=INT_MAX;
k++;
}
else
{
sprite.position=CGPointFromString([pointArray objectAtIndex:sprite.tag]);
}
}
}
【问题讨论】:
-
这个问题很难解释,请试着重新表述一下。
标签: ios cocos2d-iphone