title: remove a sprite in cocos2d-x
body: <p>I am new to cocos2d-x.I am developing a game in xcode using cocos2d-x. 
  In my game, i have sprite animation(man) and moving obstacles and coins. I making collision with sprite animation &amp; coins. When i get 10 coins, i am adding a life(adding a sprite for life).
  My question is when collision is happening between sprite animation(man) &amp; obstacles, life should decrease(i mean life sprite should remove) but it is not removed.
  I am using the following code.</p>
  
  <pre><code>if(coincount%10==0)
  {
    lifecount=lifecount+1;
  }
  if(lifecount==1)
  {
   life = CCSprite::create("life.png");
   life-&gt;setPosition( ccp(winwsize/2, winhsize/1.08) );
   this-&gt;addChild(life, 5);
  }
  else if(lifecount==2)
  {
   life1 = CCSprite::create("life.png");
   life1-&gt;setPosition( ccp(winwsize/1.8, winhsize/1.08) );
   this-&gt;addChild(life1, 5);
  }
  else if (lifecount==3)
  {
   life2 = CCSprite::create("life.png");
   life2-&gt;setPosition( ccp(winwsize/1.6, winhsize/1.08) );
   this-&gt;addChild(life2, 5);
  }
  
  if (manRect.intersectsRect(obs5Rect))
  {
  if(lifecount&gt;=1)
  {
   lifecount=lifecount-1;
   this-&gt;scheduleOnce(schedule_selector(PlayScene::remove),0.5f);
  }
  
  void PlayScene::remove()
  {
  if(lifecount==0)
  {
      this-&gt;removeChild(life, true);
  }
  else if(lifecount==1)
  {
  this-&gt;removeChild(life1, true);
  }
  else if(lifecount==2)
  {
  this-&gt;removeChild(life2, true);
  }
  </code></pre>
  
  <p>But sprite is not removing, when obstacle collide with sprite animation(man).
  Please anyone could help me to find the solution. Thanks.</p>