Monster* Monster::create(const cocos2d::Color4F &color, Vec2 dir) { Monster *monster = new Monster; monster->init(color, dir); monster->autorelease(); return monster; }
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; }
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; }
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; }
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; }
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; } }
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; }