Platform* Platform::create(GameLayer * game) { Platform * sprite = new Platform(game); if (sprite && sprite->initWithSpriteFrameName("blank.png")) { sprite->autorelease(); sprite->createTiles(); return sprite; } CC_SAFE_DELETE(sprite); return NULL; }
Platform* Platform::create(cocos2d::Node *node) { Platform *pf = new (std::nothrow) Platform; if (pf && pf->init(node)) { pf->autorelease(); return pf; } CC_SAFE_DELETE(pf); return nullptr; }