从我的问题here,
http://iphonegamedev.stackexchange.com/questions/82/moving-sprites-more-then-one-at-a-time
-(void)moveBox:(NSTimer*)myTimer{
float endx=[[[myTimer userInfo] valueForKey:@"endX"] floatValue];
float endy=[[[myTimer userInfo] valueForKey:@"endY"] floatValue];
float timing=[[[myTimer userInfo] valueForKey:@"timeForMove"] floatValue];
Sprite *sp=(Sprite*)[[myTimer userInfo] valueForKey:@"objSprite"];
[sp runAction: [MoveBy actionWithDuration:timing position:ccp(endx,endy)]];
}
我在我的应用程序中使用上面的代码。但我不需要这种方法。
上面的代码用于移动精灵。
我将代码放在此处只是因为您可以想象我需要什么。
现在我想一次移动 10 个精灵。
[sp runAction: [MoveBy actionWithDuration:timing position:ccp(endx,endy)]];
上线 - 一次移动一个精灵。
如何一次移动所有精灵。
为什么需要?:
你可能看过俄罗斯方块游戏。
如果最底部的行是完整的,那么上面的所有行都会向下移动一步。
我也想这样做。
如何?