另一種方法,我有兩個類文件hudlayer.m和actionlayer.m撥打國際長途的Cocos2D鐵漢層
我有一個方法命名爲hudlayer.m 跳,我有一個方法命名爲actionlayer jumpone。米
-(void) jumpone {
_heroBody->ApplyLinearImpulse(b2Vec2(_playerVelX/[_lhelper pixelsToMeterRatio], 1.25), _heroBody->GetWorldCenter());
}
和hudlayer.m另一種方法稱爲跳躍
-(void)jump {
ActionLayer *aob = [[ActionLayer alloc] init];
[aob jumpone];
}
問題是,當我從actionlayer.m調用Jumpone方法我的精靈跳躍(即調用的方法)動作層
- (id)initWithHUD:(HUDLayer *)hud
{
if ((self = [super init])) {
[self setupWorld];
}
return self;
}
但
我的init()方法時,我打電話通過跳轉方式jumpone來自hudlayer.m它失敗,我的應用程序崩潰。 任何幫助將不勝感激。謝謝
您可以發佈ActionLayer的init方法?並從錯誤中找出一些痕跡? – giorashc
我已更新init方法 – vishnu
ok ...讓我們看看整個初始化... :)。嘿,還有什麼發生在jump方法中的跳過呼叫? – giorashc