您能否将此cocos2d代码转换为cocos2dx?
shiprightnode = [[Shipright alloc] initWithBody:shipright game:game_];
[game_ addBodyNode:shiprightnode z:1];
[shiprightnode release];
答案 0 :(得分:1)
shiprightnode = new Shipright();
shiprightnode->init(p_game_);
game_->addBodyNode(shiprightnode);
shiprightnode->release();
答案 1 :(得分:0)
auto shiprightnode = Shipright :: createWithGame(game _);
游戏_-> addBodyNode(shiprightnode,1);
//无需释放shiprightnode,因为它会创建自动释放对象。