Exemple #1
0
Thief* Thief::create(const Vector<Node*>& points)
{
    Thief* pRet = new Thief();
    if(pRet && pRet->init()) {
        pRet->setPointsVector(points);
        pRet->runFllowPoint();
        pRet->autorelease();
    } else {
        delete pRet;
        pRet = nullptr;
    }

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

		pRet->setMaxHp(hp);
		pRet->setCurrHp(hp);
        
        pRet->autorelease();
        return pRet;
    }
    else
    {
        delete pRet;
        pRet = NULL;
        return NULL;
    }
}
Exemple #4
0
Thief* Thief::createThief(/*Vector<Node*> points,*/ int hp)
{
    Thief *pRet = new Thief();
    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;
    }
}