나는 루크가 게임을 끝내지 못하도록 막으려 고하고 있습니다. 루크가 게임을 끝내지 못하도록 막으려하고 있습니다. 애니메이션 중에 그의 원래 위치.충돌 감지 및 animateWithDuration
나는 이것을 달성하기 위해 -(void)touchesBegin
에 UIView animateWithDuration을 사용했습니다. 두 객체가
-(void)collision {
if (CGRectIntersectsRect(luke.frame, smallboulder.frame)) {
[self endgame];
}
if (CGRectIntersectsRect(luke.frame, largeboulder.frame)) {
[self endgame];
}
if (CGRectIntersectsRect(luke.frame, cactus.frame)) {
[self endgame];
}
를 충돌 할 때 나는 또한 말해 CGRectIntersectsRect
을 사용하고
[UIView animateWithDuration:3
animations:^
{
luke.center = CGPointMake(luke.center.x +0, luke.center.y -60);
}
completion:^(BOOL completed)
{
if (completed)
{
[UIView animateWithDuration:3
animations:^
{
luke.center = CGPointMake(luke.center.x +0, luke.center.y +60);
}];
}
마침내 나는 점프 할 때 움직임을 보여주기 위해 NSArray
로 설정 애니메이션을 사용할 수 있습니다.
많은 감사
JP는
Xcode와 같은 구식 버전을 사용하는 이유는 무엇입니까? –
나는 스노우 레오파드 (Snow Leopard)를 넘어서서 맥북 4.1 및 나 cant 업그레이드를 사용하고있다. 그러므로 쓸모없는 버전 – user3369583
당신은 더 현대적인 PC를 가지고 있습니까? VM에 Mavericks를 설치하여 작업 할 수 있습니다. –