Exemplo n.º 1
0
void GameLayer::update(float t)
{
	if (isAnyoneMoving)
	{
		isAnyoneMoving = false;
		for (int i = 0; i < COL_COUNT * ROW_COUNT; i++)
		{
			auto ts = matrixOfTile[i];
			if ( ts && ts->getNumberOfRunningActions() > 0)
			{
				isAnyoneMoving = true;
				break;
			}
		}
	} else
	{
		cheakAndRemove();
	}
}
Exemplo n.º 2
0
void Block::moveDown(){
    
    this->lineIndex--;
    
    Size visibleSize = Director::getInstance()->getVisibleSize();
    
    if (getNumberOfRunningActions()!=0) {
        stopAllActions();
    }
    
    runAction(Sequence::create(MoveTo::create(0.1f, Point(getPositionX(), lineIndex*visibleSize.height/4)),
                               CallFunc::create([this](){
        
        if (lineIndex<0) {
            this->removeBlock();
        }
        
    }), NULL));
    
}
Exemplo n.º 3
0
void TextLayer::checkAnim(float dt)
{
    auto s2 = getChildByTag(kTagBackground);
    if ( s2->getNumberOfRunningActions() == 0 && s2->getGrid() != NULL)
        s2->setGrid(NULL);;
}