예제 #1
0
Arrow *Arrow::createArrowByLevel(const std::string &level){
    
    Arrow *newArrow = new (std::nothrow) Arrow(level);
    if (newArrow && newArrow->initArrow()){
        newArrow->autorelease();
        return newArrow;
    }
    
    delete newArrow;
    newArrow = nullptr;
    return nullptr;
    
}
예제 #2
0
Arrow* Arrow::create(b2World* pWorld)
{
	// 'layer' is an autorelease object
	Arrow *pRet = new Arrow();
	if (pRet && pRet->init(pWorld))
	{
		pRet->autorelease();
		return pRet;
	}
	else
	{
		delete pRet;
		pRet = NULL;
		return NULL;
	}

	// return the scene
	return pRet;
}