当前位置: 首页>>代码示例>>C++>>正文


C++ Star::getIndexI方法代码示例

本文整理汇总了C++中Star::getIndexI方法的典型用法代码示例。如果您正苦于以下问题:C++ Star::getIndexI方法的具体用法?C++ Star::getIndexI怎么用?C++ Star::getIndexI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Star的用法示例。


在下文中一共展示了Star::getIndexI方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: deleteSelectedList

void StarMatrix::deleteSelectedList()
{
	if(selectedList.size() <= 1)
	{
		m_layer->hideLinkNum();
		selectedList.at(0)->setSelected(false);
		return;
	}

	for(auto it = selectedList.begin();it != selectedList.end();it++)
	{
		Star* star = *it;

		showStarParticleEffect(star->getColor(),star->getPosition(),this);
		stars[star->getIndexI()][star->getIndexJ()] = nullptr;
		star->removeFromParentAndCleanup(true);

		Audio::getInstance()->playPop();
	}

	showComboEffect(selectedList.size(),this);
	Audio::getInstance()->playCombo(selectedList.size());

	refreshScore();
	m_layer->showLinkNum(selectedList.size());
	adjustMatrix();

	if(isEnded())
	{
		m_layer->floatLeftStarMsg(getLeftStarNum());
		CCLOG("ENDED");
	}

}
开发者ID:JiangWeiGitHub,项目名称:Cocos2d-X,代码行数:34,代码来源:StarMatrix.cpp

示例2: deleteSelectedList

void StarMatrix::deleteSelectedList(){
	//播放消除音效
	Audio::getInstance()->playPop();

	for(auto it = selectedList.begin();it != selectedList.end();it++){
		Star* star = *it;
		m_layer->showEveryScore(selectedListSize,5+(selectedListSize-selectedList.size())*5,selectedListSize-selectedList.size(),star->getPosition(),touchLeft);
		selectedList.pop_front();
		//粒子效果
		showStarParticleEffect(star->getColor(),star->getPosition(),this);
		stars[star->getIndexI()][star->getIndexJ()] = nullptr;
		star->removeFromParentAndCleanup(true);
		return;
	}
	clearOneByOne =false;
	//COMBO效果
	showComboEffect(selectedListSize,this);
	m_layer->showLinkNum(selectedListSize);
	selectedListSize=0;
	acceptTouch =true;
	adjustMatrix();
	if(isEnded()){
		acceptTouch=false;
		m_layer->hideProps();
		m_layer->floatLeftStarMsg(getLeftStarNum());//通知layer弹出剩余星星的信息
		CCLOG("ENDED");
	}
}
开发者ID:joyfish,项目名称:cocos2d,代码行数:28,代码来源:StarMatrix.cpp

示例3: genSelectedList

//消除检查
void StarMatrix::genSelectedList(Star* s){
	selectedList.clear();
	deque<Star*> travelList;
	travelList.push_back(s);
	deque<Star*>::iterator it;
	int color = s->getColor();
	for(it= travelList.begin();it != travelList.end();){
		Star* star = *it;
		Star* linkStar = nullptr;
		int index_i = star->getIndexI();
		int index_j = star->getIndexJ();
		//上
		if(index_i-1 >= 0 && (linkStar = stars[index_i-1][index_j]) ){
			if(!linkStar->isSelected()){
				if(star->getColor()==5&&linkStar->getColor()==color){
					travelList.push_back(stars[index_i-1][index_j]);		
				}else if((linkStar->getColor() == star->getColor()||linkStar->getColor()==5)){
					travelList.push_back(stars[index_i-1][index_j]);				
				}
			}
		}
		//下
		if(index_i+1 < ROW_NUM  && (linkStar = stars[index_i+1][index_j]) ){			
			if(!linkStar->isSelected()){
				if(star->getColor()==5&&linkStar->getColor()==color){
					travelList.push_back(stars[index_i+1][index_j]);
				}else if((linkStar->getColor() == star->getColor()||linkStar->getColor()==5)){
					travelList.push_back(stars[index_i+1][index_j]);		
				}
			}
		}
		//左
		if(index_j-1 >= 0 && (linkStar = stars[index_i][index_j-1]) ){
			if(!linkStar->isSelected()){
				if(star->getColor()==5&&linkStar->getColor()==color){
					travelList.push_back(stars[index_i][index_j-1]);
				}else if((linkStar->getColor() == star->getColor()||linkStar->getColor()==5)){
					travelList.push_back(stars[index_i][index_j-1]);	
				}
			}
		}
		//右
		if(index_j+1 < COL_NUM && (linkStar = stars[index_i][index_j+1]) ){				
			if(!linkStar->isSelected()){
				if(star->getColor()==5&&linkStar->getColor()==color){
					travelList.push_back(stars[index_i][index_j+1]);
				}else if((linkStar->getColor() == star->getColor()||linkStar->getColor()==5)){
					travelList.push_back(stars[index_i][index_j+1]);
				}
			}
		}
		if(!star->isSelected()){
			star->setSelected(true);
			selectedList.push_back(star);
		}
		travelList.pop_front();
		it = travelList.begin();
	}
}
开发者ID:joyfish,项目名称:cocos2d,代码行数:60,代码来源:StarMatrix.cpp

示例4: deleteBombList

void StarMatrix::deleteBombList(){
	//播放消除音效
	Audio::getInstance()->playPropBomb();
	for(auto it = selectedList.begin();it != selectedList.end();it++){
		Star* star = *it;
		//粒子效果
		showStarParticleEffect(star->getColor(),star->getPosition(),this);
		stars[star->getIndexI()][star->getIndexJ()] = nullptr;
		star->removeFromParentAndCleanup(true);
	}
	selectedList.clear();
	//COMBO效果
	selectedListSize=0;
	acceptTouch =true;
	adjustMatrix();
	if(isEnded()){
		acceptTouch=false;
		m_layer->hideProps();
		m_layer->floatLeftStarMsg(getLeftStarNum());
	}
}
开发者ID:joyfish,项目名称:cocos2d,代码行数:21,代码来源:StarMatrix.cpp


注:本文中的Star::getIndexI方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。