每次 for 循环运行时,我都需要调用处理播放器的函数动画。
-(void)animateDealingToPlayer:(Player *)player withDelay:(NSTimeInterval)delay
{
self.frame = CGRectMake(-100.0f, -100.0f, CardWidth, CardHeight);
self.transform = CGAffineTransformMakeRotation(M_PI);
NSArray *position = [NSArray arrayWithObjects:
[NSValue valueWithCGPoint:CGPointMake(100, 100)],
[NSValue valueWithCGPoint:CGPointMake(0, 0)],
[NSValue valueWithCGPoint:CGPointMake(0, 0)],
[NSValue valueWithCGPoint:CGPointMake(200, 100)],
[NSValue valueWithCGPoint:CGPointMake(200, 100)],
nil];
for(int i=0; i<6; i++) {
NSValue *value = [position objectAtIndex:i];
CGPoint point = [value CGPointValue];
NSLog(@"%@",NSStringFromCGPoint(point));
_angle = [self angleForPlayer:player];
[UIView animateWithDuration:0.2f
delay:delay
options:UIViewAnimationOptionCurveEaseOut
animations:^
{
self.center = point;
self.transform = CGAffineTransformMakeRotation(_angle);
}
completion:nil];
现在它一遍又一遍地重写 self.center 直到它给出第 5 个对象索引,而不是单独调用所有索引号。例如,它不是在所有点发牌,而是只在 (200,100) 发牌。我需要一些方法来每次调用 animaitedealingwithplayer 以便它会处理所有点,但我该怎么做呢?将感谢我能得到的任何帮助。