本文整理汇总了C++中Star::getIndexJ方法的典型用法代码示例。如果您正苦于以下问题:C++ Star::getIndexJ方法的具体用法?C++ Star::getIndexJ怎么用?C++ Star::getIndexJ使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Star
的用法示例。
在下文中一共展示了Star::getIndexJ方法的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");
}
}
示例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");
}
}
示例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();
}
}
示例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());
}
}