Slot* Slot::create(Ball* ball, Vec2 pos){ Slot* slot = new (std::nothrow) Slot(); if (slot && slot->init(ball,pos)){ slot->autorelease(); return slot; } CC_SAFE_DELETE(slot); return nullptr; }
//Create and return slot object Slot* Slot::create(cocos2d::Vec2 position) { Slot* pSprite = new Slot(); if (pSprite) { pSprite->autorelease(); pSprite->init(position); return pSprite; } CC_SAFE_DELETE(pSprite); return NULL; }