을 예약하지 않는 장면을 실행하는 나는이 게임을 시작 않습니다적인 Cocos2D - 두 번째는 UIKit의 ViewController에서 업데이트를
+(id) scene {
CCScene *scene = [CCScene node];
MyGameLayer* layer = [MyGameLayer node];
[scene addChild:layer z:0 tag:GameSceneLayerTagGame];
return scene;
}
-(id) init {
if ((self=[super init]))
{
NSLog(@"init!");
self.isTouchEnabled = YES;
[self initPhysics];
[self scheduleUpdate];
}
return self;
}
처음 :
if (director.runningScene == nil)
{
[director runWithScene:[MyGameLayer scene]];
}
[director startAnimation];
MyGameLayer은 다음과 같습니다를 나는 게임을하고 모든 것이 잘 작동한다. -(void) update: (ccTime) dt
이 호출됩니다. 내가 게임을 종료 할이 경우
CCDirectorIOS* director = (CCDirectorIOS*)[CCDirector sharedDirector];
[director stopAnimation];
[director end];
을 그리고 다시 게임을, -(void) update: (ccTime) dt
은 내가 -init()
호출지고 알면서도, 전화를받을 수 없습니다. 게임이 화면에 나타나지만 업데이트 일정이 두 번째로 작동하지 않습니다. Cocos2d가 업데이트를 예약하지 못하게하고 어떻게 수정합니까?
아니요, 나는 그것을하지 않았습니다. – soleil
좋습니다. 다른 제안을 추가했습니다. 업데이트 – LearnCocos2D
을 참조하십시오. [디렉터 종료]를 호출하지 않으면 게임을 시작한 후 분홍색 화면이 나타납니다. 끝없는 openGL 오류 스트림 : OpenGL 오류 0x0501 in - [CCSprite draw] 532 – soleil