예제 #1
0
 Monster* Monster::create(const cocos2d::Color4F &color, Vec2 dir)
 {
     Monster *monster = new Monster;
     monster->init(color, dir);
     monster->autorelease();
     return monster;
 }
예제 #2
0
Monster* Monster::create(const std::string& filename, int cntWidth, int cntHeight) {
	Monster *monster = new Monster();
	if (monster && monster->initWithFileName(filename, cntWidth, cntHeight) && monster->init()) {
		monster->autorelease();
		return monster;
	}
	CC_SAFE_DELETE(monster);
	return nullptr;
}
예제 #3
0
Monster *Monster::createWithSpriteFrameName(const char *pszSpriteFrameName)
{
    Monster *monster = new Monster();
    if (monster && monster->initWithSpriteFrameName(pszSpriteFrameName))
    {
        monster->autorelease();
        return monster;
    }
    CC_SAFE_DELETE(monster);
    return NULL;
}
예제 #4
0
Monster* Monster::create(const char *pszFileName, int MonsID)
{
	Monster *pobSprite = new Monster(MonsID);
	if (pobSprite && pobSprite->initWithFile(pszFileName))
	{
		pobSprite->autorelease();
		return pobSprite;
	}
	CC_SAFE_DELETE(pobSprite);
	return NULL;
}
예제 #5
0
Monster* Monster::create(const std::string& name){
    Monster* sprite = new Monster();
    if(sprite->initWithFile(name)){
        sprite->initOpition();
        sprite->autorelease();
        return sprite;
    }
    CC_SAFE_DELETE(sprite);
    return nullptr;


}
예제 #6
0
파일: Monster.cpp 프로젝트: baokuanze/-
Monster*Monster::create(Boss_type sprite){
    
    Monster* M = new(std::nothrow) Monster();
    
    if (M && M->init(sprite)) {
        M->autorelease();
        return M;
    }else{
        delete M;
        M = NULL;
        return NULL;
    }
}
예제 #7
0
Monster* Monster::create()
{
	Monster* pSprite = new Monster();

	if (pSprite->initWithFile("Monster.png"))
	{
		pSprite->autorelease();

		pSprite->initOptions();

		pSprite->addEvents();

		return pSprite;
	}

	CC_SAFE_DELETE(pSprite);
	return NULL;
}