void GameLayer::explodeEffect(const MatchGrid* match) { MapManager* map = m_logic->currentMap(); if (map == NULL || match == NULL) return; Grid* grid = map->getGrid(match->head); GridNode* node = m_gridNodeArray[grid->row * TOTAL_COl+grid->col]; Effect::instance()->explodeEffect(this, node->getPosition()); grid = map->getGrid(match->tail); node = m_gridNodeArray[grid->row * TOTAL_COl+grid->col]; Effect::instance()->explodeEffect(this, node->getPosition()); }
void GameLayer::linkEffect(const MatchGrid* match) { MapManager* map = m_logic->currentMap(); if (map == NULL || match == NULL) return; int end = match->path.size(); std::vector<CCPoint> posArray; for (int i = 0; i < end; i++) { Grid* grid = map->getGrid(match->path[i]); posArray.push_back(m_gridNodeArray[grid->row * TOTAL_COl+grid->col]->getPosition()); } Effect::instance()->linkEffect(this, posArray, callfunc_selector(GameLayer::linkEffectCallback)); }