<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>nulldesign // lars gerckens &#187; Cocos2D</title>
	<atom:link href="http://www.nulldesign.de/category/cocos2d/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nulldesign.de</link>
	<description>blog &#38; portfolio</description>
	<lastBuildDate>Mon, 30 Jan 2012 21:39:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Cocos2D Particle System Sources</title>
		<link>http://www.nulldesign.de/2011/03/21/cocos2d-particle-system-sources/</link>
		<comments>http://www.nulldesign.de/2011/03/21/cocos2d-particle-system-sources/#comments</comments>
		<pubDate>Mon, 21 Mar 2011 20:34:18 +0000</pubDate>
		<dc:creator>lars</dc:creator>
				<category><![CDATA[Cocos2D]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Particles]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.nulldesign.de/?p=504</guid>
		<description><![CDATA[Since I&#8217;m receiving questions about the particle system I used in my FluidToy 2 quite often lately, I thought I just release the sources here. The particle system is based on a CCNode and works similar to the existing Cocos2D particle systems. The main difference is, that you can control the position and velocity of &#8230; <a href="http://www.nulldesign.de/2011/03/21/cocos2d-particle-system-sources/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Since I&#8217;m receiving questions about the particle system I used in my <a href="http://www.nulldesign.de/fluidtoy2/" target="_blank">FluidToy 2</a> quite often lately, I thought I just release the sources here.</p>
<p>The particle system is based on a CCNode and works similar to the existing <a href="http://www.cocos2d-iphone.org/">Cocos2D</a> particle systems. The main difference is, that you can control the position and velocity of each particle. Please note that this system is not very optimized and lacks in flexibility since I just built it for <a href="http://www.nulldesign.de/fluidtoy2/" target="_blank">FluidToy 2</a> and it was never meant to be more general. In other words: The code is a bit dirty! But feel free to play around with it, modify it and make use of it (and let me know what you&#8217;re making out of it).<br/><br/>There are two different systems: The SimpleParticleSystem, which draws points of any size or a point sprite using a texture. The second one is a LineParticleSystem, which will draw line particles. If you initialize the system with a size of 1000, you&#8217;ll have 500 lines, because a line consists out of 2 points (Wow, you never imagined that, did you? ;)). So if you loop through the particles, be sure to move only every second particle, the other one will follow with a small delay.</p>
<p><a href="http://www.nulldesign.de/wp-content/uploads/2011/03/Cocos2DSimpleParticleSystem.zip">Download: Cocos2DSimpleParticleSystem</a></p>
<p>It works like every other CCNode:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">particles <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>SimpleParticleSystem node<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>particles initialize<span style="color: #002200;">:</span> <span style="color: #2400d9;">1000</span> width<span style="color: #002200;">:</span> size.width height<span style="color: #002200;">:</span> size.height<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>particles setTextureByString<span style="color: #002200;">:</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;particle_small.png&quot;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>self addChild<span style="color: #002200;">:</span> particles<span style="color: #002200;">&#93;</span>;
&nbsp;
Loop through particles<span style="color: #002200;">:</span>
&nbsp;
<span style="color: #a61390;">while</span><span style="color: #002200;">&#40;</span>count &lt; particles.particleCount<span style="color: #002200;">&#41;</span>
<span style="color: #002200;">&#123;</span>
   p <span style="color: #002200;">=</span> <span style="color: #002200;">&amp;</span>particleAr<span style="color: #002200;">&#91;</span>count<span style="color: #002200;">&#93;</span>;
   p<span style="color: #002200;">-</span>&gt;dir.x <span style="color: #002200;">+=</span> CCRANDOM_MINUS1_1<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span>;
   p<span style="color: #002200;">-</span>&gt;dir.y <span style="color: #002200;">+=</span> CCRANDOM_MINUS1_1<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span>;
   <span style="color: #002200;">++</span>count;
   ...
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nulldesign.de/2011/03/21/cocos2d-particle-system-sources/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>iPhone App: FluidToy released</title>
		<link>http://www.nulldesign.de/2010/04/11/iphone-app-fluidtoy-released/</link>
		<comments>http://www.nulldesign.de/2010/04/11/iphone-app-fluidtoy-released/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 20:55:45 +0000</pubDate>
		<dc:creator>lars</dc:creator>
				<category><![CDATA[Cocos2D]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[OpenGL]]></category>

		<guid isPermaLink="false">http://www.nulldesign.de/?p=311</guid>
		<description><![CDATA[Good news everyone. My first iPhone App got released to the AppStore: FluidToy, a little toy that turns your device into an interactive fluid simulation and helps you to relax ;). Enjoy:]]></description>
			<content:encoded><![CDATA[<p>Good news everyone. My first iPhone App got released to the AppStore: <a href="http://itunes.apple.com/us/app/fluidtoy/id363572062?mt=8" target="_blank">FluidToy</a>, a little toy that turns your device into an interactive fluid simulation and helps you to relax ;). Enjoy:</p>
<p style="text-align: center;">
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=10532572&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="300" src="http://vimeo.com/moogaloop.swf?clip_id=10532572&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p style="text-align: center;"><a href="http://itunes.apple.com/us/app/fluidtoy/id363572062?mt=8" target="_blank"><img class="size-full wp-image-319 aligncenter" src="http://www.nulldesign.de/wp-content/uploads/2010/04/App_Store_Badge.png" alt="" width="226" height="78" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nulldesign.de/2010/04/11/iphone-app-fluidtoy-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

