Pirate* Pirate::createPirate(int hp)
{
	Pirate *pRet = new Pirate();
	if (pRet && pRet->init())
	{
		pRet->setMaxHp(hp);
		pRet->setCurrHp(hp);

		pRet->autorelease();
		return pRet;
	}
	else
	{
		delete pRet;
		pRet = NULL;
		return NULL;
	}
}
Exemple #2
0
Pirate* Pirate::createPirate(Vector<Node*> points, int hp)
{
    Pirate *pRet = new Pirate();
    if (pRet && pRet->init())
    {
        pRet->setPointsVector(points);
		pRet->setMaxHp(hp);
		pRet->setCurrHp(hp);
        pRet->runFllowPoint();
        
        pRet->autorelease();
        return pRet;
    }
    else
    {
        delete pRet;
        pRet = NULL;
        return NULL;
    }
}