0

I am using this->schedule( schedule_selector(HelloWorld::Game), 0.01);

and in my game play function game slows down due to following code

CCTexture2D* texture = CCTextureCache::sharedTextureCache()->textureForKey("CloseSelected.png");
                CCParticleExplosion* firework = CCParticleExplosion::create();
                firework->setTexture(texture);
                firework->setPosition(ccp(((CCSprite *) shipLaser)->getPositionX(),((CCSprite *) shipLaser)->getPositionY()));
addChild(firework);

whenever the explosion effect take place the game remains slow.

  1. another thing how I can reduce the radius of explosion ? Thanks
Ahmad dar
  • 81
  • 1
  • 14
  • on a device? which one? do you create this effect 100 times per second perhaps since it sounds you run this code on a schedule? – CodeSmile Jun 02 '14 at 10:28
  • @LearnCocos2D no this effect does not created 100 times per second it only creates when fire hits the object only. Schedule checks that either bullet fire intersects the enemy object or not and when it touches the object the Explosion effect took place which slows down the game speed until the effect vanishes. – Ahmad dar Jun 02 '14 at 12:04

0 Answers0