I am new here and still learning the cocos2d-x framework step by step.
Currently I am doing a practise which I want to be able to do this.
I have a sprite and it can jump. when the sprite hit something like a speed ball, the sprite will jump 2x higher, so the sprite has 2 functions, jump() and superjump().
What I am doing here is when the sprite is created, I also create a particle effect and add it as a child of the sprite. then hide it immediately using myParticle->setVisible(false). when the sprite hits the speed ball, it calls the superjump() function which find the particle and set the visible to true ( myParticle->setVisible(true) ) , the problem is when it is calling “myParticle->setVisible(true) ’ , it gets an error says”draw should not be called when added to a particleBatchNode"
Just wonder if I am doing this in a right way. again the logic here is create the particle effect and hide it, when need to show it, set the visible to true. but it just gets me an error.
Please help guys.