没有图像的图像碰撞在复位时发生碰撞

时间:2014-04-01 02:50:31

标签: ios iphone objective-c uiviewcontroller

当我的应用重新加载两个图像而没有实际触碰时,这是一个快速的问题。我已将这些图像的帧重置为原始位置,如下所示:

-(void)viewWillAppear:(BOOL)animated {

redball.frame = CGRectMake(redballpos.x, redballpos.y, redball.frame.size.width, redball.frame.size.height); //makes frame
ball1.frame = CGRectMake(ball1pos.x, ball1pos.y, ball1.frame.size.width, ball1.frame.size.height);
ball2.frame = CGRectMake(ball2pos.x, ball2pos.y, ball2.frame.size.width, ball2.frame.size.height);


}

我原来的ViewDidload如下:

- (void)viewDidLoad
{

redballpos = redball.frame.origin;
ball1pos = ball1.frame.origin;
ball2pos = ball2.frame.origin;
exit.hidden = YES;
ball2.hidden = YES;
highScore = [[NSUserDefaults standardUserDefaults] integerForKey:@"HighScoreSaved"];
adView.delegate = self;


[super viewDidLoad];

}

有谁知道我做错了什么? 非常感谢所有建议

0 个答案:

没有答案