正在看cocos2d 2游戏开发实战,但书中内容都是2.0版本的,和3有不少出入,现在遇到一些问题,新手表示很困惑求大神帮助:
问题1:
cocos2d 2 中的CCLayer 是不是在 3.0中被废弃了?场景现在都继承于CCScene,CCLayer支持加速计的部分被CoreMotion框架所代替,触摸是不是被CCResponser给代替了?
问题2:
以前CCLayer中加速计的开启是需要显示调用self.isAccelerometerEnable = YES,
那现在继承了CCScene且加速计需要使用CoreMotion框架,这个显示开启应该怎么写?
还有就是原先的accelerometer中的方法都变成了什么?
-(void) accelerometer:(UIAccelerometer *)accelerometerdidAccelerate:(UIAcceleration *)acceleration
{
CGPoint pos=player.position;
pos.x+= acceleration.x * 10;
player.position = pos;
}
如上现在在3.0中又要怎样做到呢?新手问题比较多,希望大神不要嫌弃,求帮助TAT