1

I have a person that remains on screen until he dies. As the person moves blocks comes off of him and fadeout into the air using an SKEmitterNode. The longer I play the lower the FPS get and my game starts to run slow, usually around 1000 nodes it slows down.

I know I need to find a way to remove the nodes that have already faded away and I have tried the basic things to remove nodes but no luck.

I am also confused as to why my game slows down so much around 1000 - 1500 nodes when there are games that have HD graphics with dust particles and a million different things happening at once that run smooth?

Here is the SKEmitterNode:

func gravityTrail(_ spriteToExplode : SKSpriteNode, color : UIColor) {

    gravityTrail = SKEmitterNode(fileNamed: "TrailGravity.sks")
    gravityTrail.particleColorSequence = nil
    gravityTrail.particleColorBlendFactor = 1.0
    gravityTrail.particleColor = color

    gravityTrail.targetNode = person

    gravityTrail.position = spriteToExplode.position

    self.addChild(gravityTrail)

}

enter image description here

Thanks for your help!

Janmenjaya
  • 4,149
  • 1
  • 23
  • 43
Timmy Sorensen
  • 570
  • 6
  • 16
  • A few questions: Can you show a screenshot with the "nodes" on at around 1000 to 1500? Can you upload the texture you're using for the particles? Or give details about its size and alpha content? What device are you testing on? Which version rendering are you using Metal, or OpenGL? – Confused Oct 08 '16 at 07:49
  • @TimmySorensen, major optimization, that is how they get things working quickly, plus we have no idea what you are doing over time – Knight0fDragon Oct 08 '16 at 11:21

0 Answers0