<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>cocos2d for iPhone &#187; Topic: Particle System 10-30 fps drop</title>
		<link>http://www.cocos2d-iphone.org/forum/topic/5164</link>
		<description>A fast, easy to use, free, and community supported 2D game engine</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Feb 2012 02:04:13 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.cocos2d-iphone.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.cocos2d-iphone.org/forum/rss/topic/5164" rel="self" type="application/rss+xml" />

		<item>
			<title>zombie on "Particle System 10-30 fps drop"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/5164#post-30892</link>
			<pubDate>Sat, 20 Mar 2010 10:09:24 +0000</pubDate>
			<dc:creator>zombie</dc:creator>
			<guid isPermaLink="false">30892@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Its not a problem to set the position of the particle system every frame, But try to avoid to initializations of object during your game is running. I do not know how many particles your CCParticleSun is allocating. The higher that number the worse. Preallocate some systems and reuse them. You can improve this even further by batching them, but this is much more work. Start with the preallocation.</p>
<p>Hope thats helpful somehow.
</p></description>
		</item>
		<item>
			<title>mack on "Particle System 10-30 fps drop"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/5164#post-30891</link>
			<pubDate>Sat, 20 Mar 2010 09:42:30 +0000</pubDate>
			<dc:creator>mack</dc:creator>
			<guid isPermaLink="false">30891@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I run this method via schedule in 5 sec intervals.  I'm thinking it may have something to do with initializing obstacle every tick.</p>
<pre><code>-(void) moveObstacleTick: (ccTime) dt
{
	if([self isObstacleOnScreen] == NO)
	{
		obstacleType = 1+arc4random()%numberOfObstacles;
		switch (obstacleType) {
			case fireBall:
				obstacle = [CCParticleSun node];
				obstacle.texture = [[CCTextureCache sharedTextureCache] addImage: @&#34;fire.pvr&#34;];
				[obstacle setEmissionRate:50];
				break;
			default:
				break;
		}
		[obstacle setPosition: ccp(481,321)];
		[self addChild:obstacle z:0 tag:obstacleTag];
		CGPoint fireFromLane;

		// #<a href='http://www.cocos2d-iphone.org/forum/tags/2'>2</a>:lane1 #<a href='http://www.cocos2d-iphone.org/forum/tags/3'>3</a>:lane2 #<a href='http://www.cocos2d-iphone.org/forum/tags/4'>4</a>:lane3
		int randomLane = lane1 + arc4random()%lane1;
		switch (randomLane) {
			case lane1:
				fireFromLane = ccp(490, 190);
				break;
			case lane2:
				fireFromLane = ccp(490, 140);
				break;
			case lane3:
				fireFromLane = ccp(490, 90);
				break;
			default:
				break;
		}

		[obstacle setPosition:fireFromLane];
		id throw = [CCMoveTo actionWithDuration:3 position: ccp(-50, fireFromLane.y)];
		id actionSeq = [CCSequence actions:throw, nil];

		[obstacle runAction:actionSeq];
	}
}</code></pre></description>
		</item>
		<item>
			<title>zombie on "Particle System 10-30 fps drop"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/5164#post-30890</link>
			<pubDate>Sat, 20 Mar 2010 09:17:35 +0000</pubDate>
			<dc:creator>zombie</dc:creator>
			<guid isPermaLink="false">30890@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>That should not happen. Give some more details about what you are doing, please.
</p></description>
		</item>
		<item>
			<title>mack on "Particle System 10-30 fps drop"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/5164#post-30870</link>
			<pubDate>Sat, 20 Mar 2010 01:07:02 +0000</pubDate>
			<dc:creator>mack</dc:creator>
			<guid isPermaLink="false">30870@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Is this normal? how do you guys manage a stable fps with a particle system.  I'm moving a particle across the screen every 5 seconds and every time I get a 10 fps decrease of CCParticleSun and even  higher on CCParticleMeteor, dropping it down to 30 fps.
</p></description>
		</item>

	</channel>
</rss>

