Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17070

How to use "this->getChildren"

$
0
0

@Dhiraj0116 wrote:

I am trying to make a bubble shooter game. I have searched all but not getting any help from anywhere If anyone has the source code then please give that to me.

Or

If you can help me in solving this problem

I have been stuck here for so many days...
I am trying to reset the ball in bubble shooter game. Using this->getChildren() gives error as 'type cast': cannot convert from 'cocos2d::Vector' to 'cocos2d::Array *'


void BaseScene::resetBallsState()
{
Array * balls = (Array*) this->getChildren();
for (int j=0; jcount(); j++)
{
Node * a = (Node*)balls->objectAtIndex(j);
if(a->getTag() >= Tag_Ball_Start)
{
Ball * currentBall = (Ball*)balls->objectAtIndex(j);
currentBall->setUserObject(String::create("empty"));
currentBall->hasparent = false;
}
}
}


Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 17070

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>