<?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>cocos2d for iPhone</title>
	<atom:link href="http://www.cocos2d-iphone.org/feed" rel="self" type="application/rss+xml" />
	<link>http://www.cocos2d-iphone.org</link>
	<description>A 2d game engine for iPhone / iPad that&#039;s fast, easy to use, free, and community supported</description>
	<lastBuildDate>Thu, 02 May 2013 18:47:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>4th coordinated release: cocos2d-iphone v2.1-rc2 and much more</title>
		<link>http://www.cocos2d-iphone.org/archives/215425?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=4th-coordinated-release-cocos2d-iphone-v2-1-rc2-and-much-more</link>
		<comments>http://www.cocos2d-iphone.org/archives/215425#comments</comments>
		<pubDate>Thu, 02 May 2013 18:47:35 +0000</pubDate>
		<dc:creator>riq</dc:creator>
				<category><![CDATA[cocos2d]]></category>

		<guid isPermaLink="false">http://www.cocos2d-iphone.org/?p=215425</guid>
		<description><![CDATA[We are happy to announce the fourth coordinated release of the cocos2d family. We are releasing: cocos2d-x v2.1rc0-x-2.1.3 cocos2d-html5 v2.1.3 cocos2d-iphone v2.1-rc2 CocosBuilder v3.0-alpha4 Our goal is to provide a complete toolchain for developing multi-platform games both for Web and Mobile, all the way from rapid prototyping to a finished high performing game. cocos2d-x Download [...]]]></description>
				<content:encoded><![CDATA[<p>We are happy to announce the <strong>fourth coordinated release</strong> of the cocos2d family. We are releasing:</p>
<ul>
<li>cocos2d-x v2.1rc0-x-2.1.3</li>
<li>cocos2d-html5 v2.1.3</li>
<li>cocos2d-iphone v2.1-rc2</li>
<li>CocosBuilder v3.0-alpha4</li>
</ul>
<p>Our goal is to provide a complete toolchain for developing multi-platform games both for Web and Mobile, all the way from rapid prototyping to a finished high performing game.</p>
<h2>cocos2d-x</h2>
<p><img alt="" src="https://lh3.googleusercontent.com/-glwwzmFyUmk/UQgPnlx40uI/AAAAAAAArzg/WPRW10kkecM/s800/cocos2d-x-logo.png" /></p>
<h3>Download</h3>
<ul>
<li><a href="http://cocos2d-x.googlecode.com/files/cocos2d-2.1rc0-x-2.1.3.zip">cocos2d-2.1rc0-x-2.1.3.zip</a></li>
</ul>
<h3>Highlights</h3>
<ul>
<li>Added support for <a href="http://esotericsoftware.com/">Spine</a> skeleton animation editor</li>
<li>uses <a href="http://luajit.org/">LuaJIT</a></li>
<li>CocosPlayer supports iOS</li>
<li>add <code>kResolutionFixedHeight</code> and <code>kResolutionFixedWidth</code> resolution policy</li>
<li>updated to SpiderMonkey v20.0</li>
<li>add many Lua test cases</li>
<li>Possible to obfuscate JavaScript code. More info <a href="http://www.cocos2d-x.org/projects/cocos2d-x/wiki/How_to_Obfuscate_Javascript_Source_Code_on_JSB">here</a></li>
<li><a href="http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Plugin-X">plugin-x</a> released</li>
</ul>
<h3>More information</h3>
<p>Read more about all the new features at <a href="http://www.cocos2d-x.org/projects/cocos2d-x/wiki/213">cocos2d-x v2.1.3 release notes</a>.</p>
<h2>cocos2d-html5</h2>
<p><img alt="" src="https://lh6.googleusercontent.com/-u8a4dfBkbf4/UQgPoboEf2I/AAAAAAAArzw/7gYxZE5jEOU/s800/cocos2d-html5-logo.png" /></p>
<h3>Download</h3>
<p><a href="http://cocos2d-x.googlecode.com/files/Cocos2d-html5-v2.1.3.zip">Cocos2d-html5-v2.1.3.zip</a></p>
<h3>Highlights</h3>
<ul>
<li><code>CCEditbox</code> now implemented for WebGL and JSB</li>
<li>Updated CCBReader to latest version</li>
<li>Improved performance Firefox by about 20%</li>
<li>Added render mode flag to switch between WebGL and canvas2d</li>
<li>Added support for Tizen</li>
<li>Now able to load embedded texture file in a plist</li>
<li>EGLView now works if canvas is placed inside another DOM element</li>
<li>Added a Simulator which can be found in MoonWarriors Directory</li>
</ul>
<h3>Note</h3>
<p>The work in progress development branch will now be &#8220;develop&#8221;, while &#8220;master&#8221; branch will only hold the latest stable release. Please send all pull requests to the &#8220;develop&#8221; branch from now on.</p>
<h3>More information</h3>
<p>Read more about all the new features at <a href="http://www.cocos2d-x.org/projects/cocos2d-x/wiki/213">Cocos2d-html5 v2.1.3 release notes</a>.</p>
<h2>cocos2d-iphone</h2>
<p><img alt="" src="https://lh4.googleusercontent.com/-s1DU2gzJuys/UQgPnEX75rI/AAAAAAAArzY/bbLwZSkM7jo/s800/cocos2d-iphone-logo.png" /></p>
<h3>Download</h3>
<ul>
<li><a href="http://cocos2d-iphone.googlecode.com/files/cocos2d-iphone-2.1-rc2.tar.gz">cocos2d-iphone v2.1-rc2.tar.gz</a></li>
</ul>
<h3>Highlights</h3>
<ul>
<li>Bug fixes in many components: <code>CCParticleSystem</code>, <code>DrawingPrimitives</code>, <code>Layer</code>, <code>MenuItem</code>, <code>ProgressActions</code>, <code>TMXMaps</code> and more.</li>
<li>Includes JS remote Debugger (disabled by default)</li>
<li>Updated 3rd party libraries: SpiderMonkey 20.0, JS Bindings 0.7,</li>
</ul>
<h3>More information</h3>
<p>Read more about all the new features at <a href="https://github.com/cocos2d/cocos2d-iphone/wiki/cocos2d-v2.1-release-notes">cocos2d-iphone v2.1 release notes</a>.</p>
<p><span id="more-215425"></span></p>
<h2>CocosBuilder</h2>
<p><img alt="" src="https://lh3.googleusercontent.com/-254uAEdFGp4/UQgPn77LjOI/AAAAAAAArzo/5olLwIK5cik/s800/cocosbuilder-logo.png" /></p>
<p>This is the fourth release of CocosBuilder 3 alpha. If you are using cocos2d-js, make sure that you also update to the latest version of CocosPlayer and check CocosPlayer&#8217;s <a href="https://github.com/cocos2d/CocosBuilder/blob/master/CocosPlayer/README.md">README.md</a> file for information on how to enable the new JS debugger. Please make a backup of all your project files before updating as CocosBuilder is still in alpha state.</p>
<h3>Download</h3>
<ul>
<li><a href="http://cocosbuilder.com/?page_id=11">cocosbuilder.com/?page_id=11</a></li>
</ul>
<h3>Highlights</h3>
<ul>
<li>Visual debugger for cocos2d-js projects, works with the version of CocosPlayer included with the source code More info <a href="https://github.com/cocos2d/CocosBuilder/blob/master/Documentation/8.%20Debugging%20JavaScript%20Code.md">here</a></li>
<li>Much improved text editor with better syntax coloring, autocomplete and live syntax checking of your JavaScript files</li>
<li>Smart sprite sheets now support different formats for iOS, Android and Web</li>
<li>Publish and run in browser (for cocos2d-js projects)</li>
<li>Publisher will ask to save files before publishing</li>
<li>Many smaller enhancements and bug fixes</li>
</ul>
<p><img alt="" src="https://lh4.googleusercontent.com/-EeYIv4Abc3k/UYGt7r9ceNI/AAAAAAAAt-g/U7DsYze4xgM/s400/screenshot_debugger.png" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cocos2d-iphone.org/archives/215425/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>BADLAND &#8211; a cocos2d-iphone game</title>
		<link>http://www.cocos2d-iphone.org/archives/215418?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=badland-a-cocos2d-iphone-game</link>
		<comments>http://www.cocos2d-iphone.org/archives/215418#comments</comments>
		<pubDate>Sat, 27 Apr 2013 12:00:42 +0000</pubDate>
		<dc:creator>Johannes Vuorinen</dc:creator>
				<category><![CDATA[cocos2d]]></category>

		<guid isPermaLink="false">http://www.cocos2d-iphone.org/?p=215418</guid>
		<description><![CDATA[BADLAND launched April 4th, 2013 on App Store for iPad, iPhone &#38; iPod touch. Since then it has sold more than 100 000 copies. Try it out (iTunes link) or check out the launch trailer below so you get a better picture of what kind of game I am going to talk about. BADLAND was [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.badlandgame.com">BADLAND</a> launched April 4th, 2013 on App Store for iPad, iPhone &amp; iPod touch. Since then it has sold more than 100 000 copies. Try it out (<a href="https://itunes.apple.com/app/badland/id535176909">iTunes link</a>) or check out the launch trailer below so you get a better picture of what kind of game I am going to talk about. BADLAND was our two-man indie company&#8217;s, called <a href="http://www.frogmindgames.com">Frogmind</a>, first iOS game and it uses the latest development version of cocos2d-iphone 2.1 along with lots of other open source libraries.</p>
<p><iframe width="500" height="375" src="http://www.youtube.com/embed/7nkxyKo09Qs?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<h2>Why cocos2d?</h2>
<p>First of all we wanted to develop the game with the minimal possible team as possible. In our indie studio we have only me, Johannes Vuorinen, as the programmer, and Juhana Myllys as the artist. Audio is something neither of us do well enough, so we subcontracted a very talented audio guy, Joonas Turner, to do the audio side. So with this small team it was clear to us that we want to focus on developing the game itself and not implementing engines and tools of our own.</p>
<p>So, we decided to look for an engine with good support for tools. BADLAND is a 2D game so a 3D engine with 3D physics (e.g., Unity3D) felt a little bit overkill. Also, I prefer engines with full source code access so that I really know what&#8217;s going on under the hood, and maybe change something if there&#8217;s something I do not like. And of course, most importantly, we wanted the engine to be still in development with an active community. With all these requirements, cocos2d was an excellent choice.</p>
<table border="0">
<tr>
<td>
<a href="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2013/04/DAWN-iphone4-2.png"><img src="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2013/04/DAWN-iphone4-2-300x200.png" alt="BADLAND - Dawn" width="300" height="200" class="alignnone size-medium wp-image-215419" /></a>
</td>
<td>
<a href="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2013/04/DAY-iphone4-3.png"><img src="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2013/04/DAY-iphone4-3-300x200.png" alt="BADLAND - Noon" width="300" height="200" class="alignnone size-medium wp-image-215420" /></a>
</td>
</tr>
</table>
<h2>The other awesome engines, libraries and tools</h2>
<p>It&#8217;s not just cocos2d that makes BADLAND tick. <a href="http://box2d.org/">Box2D</a> as the physics engine is equally important. In fact, Box2D is so amazing that we were able to implement everything we wanted to the game without changing a single line of code in its source code. For example, the ability to set continuos collision detection enabled for individual bodies was a really important feature to us because we have some thin obstacles and fast moving objects in the game.</p>
<p>For the audio we chose <a href="http://www.fmod.org">FMOD</a> with FMOD Designer. I can highly recommend FMOD as well. We were able to develop very dynamic soundscape without touching the game&#8217;s source code that much as the FMOD Designer does lots of stuff for you. Use of FMOD is not completely free but it&#8217;s very inexpensive for indie developers.</p>
<p>As offline tools we used the fantastic tools by Andreas Loew: <a href="http://www.codeandweb.com/texturepacker">TexturePacker</a> and <a href="http://www.codeandweb.com/physicseditor">PhysicsEditor</a>. I can highly recommend both of them and they work easily with cocos2d and Box2D. With the TexturePacker we were able to highly optimize the game performance and memory consumption, and with PhysicsEditor we were easily able to define physics shapes.</p>
<p>In addition to these, we used <a href="http://www.71squared.com/en/glyphdesigner">GlyphDesigner</a> to rapidly create the game&#8217;s font atlas, and <a href="http://www.71squared.com/en/particledesigner">ParticleDesigner</a> to create particle effects. Both of them work out of the box with cocos2d. ParticleDesigner was not as perfect as the other tools mentioned and I have lots of improvement ideas to it but it did its job.</p>
<p>Finally we used <a href="http://cocosbuilder.com/">CocosBuilder</a> to create 80% the menus. It was easy and efficient. The only thing that I really missed using this tool was the lack of ability to use ready-made spritesheets to reduce draw calls when rendering the CocosBuilder nodes.</p>
<p>BADLAND of course also use lots of additional open source libraries that do not play as big role as the ones mentioned. However, this should give the general idea that we used a LOT of ready-made engines, libraries and tools to develop BADLAND. I would say the 95% of the time we were able to concentrate on just developing the actual game itself.</p>
<table border="0">
<tr>
<td>
<a href="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2013/04/DUSK-iphone4-4.png"><img src="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2013/04/DUSK-iphone4-4-300x200.png" alt="BADLAND - Dusk" width="300" height="200" class="alignnone size-medium wp-image-215421" /></a>
</td>
<td>
<a href="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2013/04/NIGHT-iphone4-5.png"><img src="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2013/04/NIGHT-iphone4-5-300x200.png" alt="BADLAND - Night" width="300" height="200" class="alignnone size-medium wp-image-215422" /></a>
</td>
</tr>
</table>
<h2>Conclusion</h2>
<p>All in all, I can highly recommend using cocos2d for any 2D game. It was easy to learn, use and modify. Without the engine and the awesome community, BADLAND would not have seen daylight this early. And with the cocos2d-x, we have the possibility to bring the game to other platforms too in the future. Thank you for the awesome engine and all the support!</p>
<p>We are continuing developing BADLAND further with updates so if you want to stay in the loop, you can follow us:<br />
Facebook &#8211; <a href="http://www.facebook.com/badlandgame">http://www.facebook.com/badlandgame</a><br />
Twitter &#8211; <a href="http://www.twitter.com/badlandgame">http://www.twitter.com/badlandgame</a><br />
Blog &#8211; <a href="http://www.badlandgame.com">http://www.badlandgame.com</a><br />
iTunes link &#8211; <a href="https://itunes.apple.com/app/badland/id535176909">https://itunes.apple.com/app/badland/id535176909</a></p>
<p><a href="https://itunes.apple.com/app/badland/id535176909"><img class="alignnone size-full wp-image-2187" src="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2012/12/Available_on_the_App_Store_Badge_US-UK_135x40_0824.png" alt="" width="135" height="40" /></a></p>
<p>If you have any questions, please ask for example in the comments or by twitter <a href="http://www.twitter.com/johannesvuorine">@johannesvuorine</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cocos2d-iphone.org/archives/215418/feed</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Introducing Watermelon2D: the future of cocos2d</title>
		<link>http://www.cocos2d-iphone.org/archives/215414?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=introducing-watermelon2d-the-future-of-cocos2d</link>
		<comments>http://www.cocos2d-iphone.org/archives/215414#comments</comments>
		<pubDate>Mon, 01 Apr 2013 23:15:36 +0000</pubDate>
		<dc:creator>riq</dc:creator>
				<category><![CDATA[cocos2d]]></category>
		<category><![CDATA[April fools]]></category>

		<guid isPermaLink="false">http://www.cocos2d-iphone.org/?p=215414</guid>
		<description><![CDATA[There are some features that we need in cocos2d (like multithreading, a good UI toolkit, multiple view support, auto-batching, etc.). Adding those features in the current cocos2d design is not trivial, so a reboot of cocos2d is necessary. Let me introduce you to Watermelon2D, the future of cocos2d. Planned features: Multithreading Complete UI toolkit Multiple [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2013/04/watermelon.jpg"><img class="alignright size-full wp-image-215415" alt="watermelon" src="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2013/04/watermelon.jpg" width="240" height="203" /></a>There are some features that we need in cocos2d (like multithreading, a good UI toolkit, multiple view support, auto-batching, etc.).</p>
<p>Adding those features in the current cocos2d design is not trivial, so a reboot of cocos2d is necessary. Let me introduce you to Watermelon2D, the future of cocos2d. Planned features:</p>
<ul>
<li><span style="line-height: 13px;">Multithreading</span></li>
<li>Complete UI toolkit</li>
<li>Multiple OpenGL view support</li>
<li>It is going to be implemented in <a href="http://dlang.org/">D</a> language</li>
<li>Not as tasty as a coconut, but with more water</li>
<li>Green in the outside, red in the inside with black seeds</li>
<li>Support for <a href="http://www.cocos2d-iphone.org/forum/topic/296210">Groundhog2d</a> physics engine</li>
<li>Backwards compatible with <a href="http://www.cocos2d-iphone.org/archives/837">cocos1d</a></li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cocos2d-iphone.org/archives/215414/feed</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>3rd coordinated release: cocos2d-iphone v2.1-rc1 and more</title>
		<link>http://www.cocos2d-iphone.org/archives/73139?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=3rd-coordinated-release-cocos2d-iphone-v2-1-rc1-and-more</link>
		<comments>http://www.cocos2d-iphone.org/archives/73139#comments</comments>
		<pubDate>Thu, 21 Mar 2013 01:17:32 +0000</pubDate>
		<dc:creator>riq</dc:creator>
				<category><![CDATA[cocos2d]]></category>

		<guid isPermaLink="false">http://www.cocos2d-iphone.org/?p=73139</guid>
		<description><![CDATA[We are happy to announce the third coordinated release of the cocos2d family. We are releasing: CocosBuilder v3.0-alpha3 cocos2d-html5 v2.1.2 cocos2d-iphone v2.1-rc1 cocos2d-x v2.1rc0-x–2.1.2 Our goal is to provide a complete toolchain for developing multi-platform games both for Web and Mobile, all the way from rapid prototyping to a finished high performing game. CocosBuilder This is the [...]]]></description>
				<content:encoded><![CDATA[<p>We are happy to announce the <strong>third coordinated release</strong> of the cocos2d family. We are releasing:</p>
<ul>
<li>CocosBuilder v3.0-alpha3</li>
<li>cocos2d-html5 v2.1.2</li>
<li>cocos2d-iphone v2.1-rc1</li>
<li>cocos2d-x v2.1rc0-x–2.1.2</li>
</ul>
<p>Our goal is to provide a complete toolchain for developing multi-platform games both for Web and Mobile, all the way from rapid prototyping to a finished high performing game.</p>
<h2 id="cocosbuilder">CocosBuilder</h2>
<p><img alt="" src="https://lh3.googleusercontent.com/-254uAEdFGp4/UQgPn77LjOI/AAAAAAAArzo/5olLwIK5cik/s800/cocosbuilder-logo.png" /><br />
This is the third release of CocosBuilder 3 alpha. When updating please make sure to also update to the latest version of CCBReader and CocosPlayer. You will be able to open old ccb-files with the new version, but it may not be backwards compatible. Please make a backup of all your project files before updating as CocosBuilder is still in alpha state.</p>
<h3 id="download">Download</h3>
<ul>
<li><a href="http://cocosbuilder.com/?page_id=11">cocosbuilder.com/?page_id=11</a></li>
</ul>
<h3 id="highlights">Highlights</h3>
<ul>
<li>Improved default project structure</li>
<li>Adds support for sound playback directly from the timeline</li>
<li>Adds support for callbacks from the timeline</li>
<li>Improved support for Cocos2d JS</li>
<li>Skew properties can now be animated (not supported in cocos2d-html5)</li>
<li>Plenty of bug fixes</li>
</ul>
<h3 id="moreinformation">More information</h3>
<p>Read more about all the new features at <a href="http://cocosbuilder.com">cocosbuilder.com</a>.</p>
<h2 id="cocos2d-html5">cocos2d-html5</h2>
<h3><img style="font-size: 13px;" alt="" src="https://lh6.googleusercontent.com/-u8a4dfBkbf4/UQgPoboEf2I/AAAAAAAArzw/7gYxZE5jEOU/s800/cocos2d-html5-logo.png" /></h3>
<h3 id="download">Download</h3>
<ul>
<li><a href="http://cocos2d-x.googlecode.com/files/Cocos2d-html5-v2.1.2-beta.zip">Cocos2d-html5-v2.1.2-beta.zip</a></li>
</ul>
<h3 id="highlights">Highlights</h3>
<ul>
<li>WebGL support! Great performance boost on modern browsers</li>
<li><code>cc.Loader</code> now supports multiple stage preloading &#8211; all tests now preload by multi resource groups</li>
<li><code>cc.Node</code> now uses transform matrix &#8211; better performance</li>
<li>Added Accelerometer support</li>
<li>Added support for MP4 and M4a Audio format</li>
<li>Designer resolution for multi resolution support</li>
<li>Faster <code>cc.ParticleSystem</code>, thanks to Ivo Wetzel</li>
<li>Bug fixes in audio support, file utility, Google Closure compiler, LocalStorage, <code>cc.MenuItemImage</code>, <code>cc.MenuItemToggle</code>, actions and<code>UIWebView</code> compatibility</li>
</ul>
<h3 id="moreinformation">More information</h3>
<p>Read more about all the new features at <a href="http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Html5">cocos2d-html5 release notes</a>.</p>
<h2 id="cocos2d-iphone">cocos2d-iphone</h2>
<p><img alt="" src="https://lh4.googleusercontent.com/-s1DU2gzJuys/UQgPnEX75rI/AAAAAAAArzY/bbLwZSkM7jo/s800/cocos2d-iphone-logo.png" /></p>
<h3 id="download">Download</h3>
<ul>
<li><a href="http://cocos2d-iphone.googlecode.com/files/cocos2d-iphone-2.1-rc1.tar.gz">cocos2d-iphone v2.1-rc1.tar.gz</a></li>
</ul>
<h3 id="highlights">Highlights</h3>
<ul>
<li>OpenGL bindings for JavaScript (compatible with the WebGL API)</li>
<li>New drawing primitives functions <code>ccDrawSolidCircle</code>, <code>ccDrawArc</code>, <code>ccDrawSolidArc</code></li>
<li>Bug fixes in different components: <code>CCClippingNode</code>, <code>CCDirector</code>, <code>CCGLProgram</code>, <code>CCTexture2D</code>, <code>CCRenderTexture</code>, <code>CCEaseBound*</code>,<code>CCEaseExp*</code></li>
<li>Updated 3rd party libraries: Chipmunk 6.1.4, SpiderMonkey 19.0, JS Bindings 0.6,</li>
</ul>
<h3 id="moreinformation">More information</h3>
<p>Read more about all the new features at <a href="https://github.com/cocos2d/cocos2d-iphone/wiki/cocos2d-v2.1-release-notes">cocos2d-iphone v2.1 release notes</a>.<br />
<span id="more-73139"></span></p>
<h2 id="cocos2d-x">cocos2d-x</h2>
<p><img alt="" src="https://lh3.googleusercontent.com/-glwwzmFyUmk/UQgPnlx40uI/AAAAAAAArzg/WPRW10kkecM/s800/cocos2d-x-logo.png" /></p>
<h3 id="download">Download</h3>
<ul>
<li><a href="http://cocos2d-x.googlecode.com/files/cocos2d-2.1rc0-x-2.1.2.zip">cocos2d–2.1rc0-x–2.1.2.zip</a></li>
</ul>
<h3 id="highlights">Highlights</h3>
<ul>
<li>Initial support for Chrome native client support.</li>
<li>New tool to create multi-platform projects ( <code>tools/project-creator/</code> ).</li>
<li>Eclipse integration for Android. Information <a href="https://github.com/cocos2d/cocos2d-x/blob/master/samples/Cpp/HelloCpp/proj.android/README.md">here</a>.</li>
<li>Added webp image format support.</li>
<li>Add <code>AssetsManager</code> to do auto upgrading. More info <a href="https://github.com/cocos2d/cocos2d-x/blob/master/samples/Cpp/AssetsManagerTest/README.md">here</a></li>
<li>Add VS2012 Express template installing support.</li>
<li>Update SpiderMonkey to Firefox19.</li>
<li>Improved Lua bindings and test cases</li>
<li>Synchronize with cocos2d-iphone v2.1rc0.</li>
</ul>
<h3 id="moreinformation">More information</h3>
<p>Read more about all the new features at <a href="http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Cocos2d-x">cocos2d-x-v2.1rc0–2.1.2 release notes</a>.</p>
<h2 id="improvedtests">Improved tests</h2>
<h3 id="cocos2dtests">cocos2d tests</h3>
<ul>
<li>Started test automation: 62 automated tests</li>
<li>Added OpenGL/WebGL tests</li>
<li><a href="http://www.cocos2d-x.org/html5-samples/samples/tests/index.html">Try the cocos2d tests online</a></li>
</ul>
<p><img alt="" src="https://lh5.googleusercontent.com/-ON3Nj0pojMw/UUpAERdtbdI/AAAAAAAAsmU/nGAj79FEbsc/s400/Screen%2520Shot%25202013-03-20%2520at%25204.01.48%2520PM.png" /></p>
<h3 id="howtorunthegamesandtests">How to run the games and tests</h3>
<p>For further information regarding how to run the tests, please visit this page: <a href="https://github.com/cocos2d/cocos2d-js-tests#readme">cocos2d JS tests</a></p>
<h2 id="thanks">Thanks</h2>
<p>Many thanks to all the developers, contributors and testers from the cocos2d (html5, iphone and x) and CocosBuilder communities!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cocos2d-iphone.org/archives/73139/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Coordinated release: cocos2d-iphone v2.1-rc0 and more</title>
		<link>http://www.cocos2d-iphone.org/archives/2270?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=coordinated-release-cocos2d-iphone-v2-1-rc0-and-more</link>
		<comments>http://www.cocos2d-iphone.org/archives/2270#comments</comments>
		<pubDate>Fri, 08 Feb 2013 03:34:15 +0000</pubDate>
		<dc:creator>riq</dc:creator>
				<category><![CDATA[cocos2d]]></category>
		<category><![CDATA[CocosBuilder]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://www.cocos2d-iphone.org/?p=2270</guid>
		<description><![CDATA[Update: cocos2d-iphone v2.1rc0a released. It is a hot fix release with a few important bug fixes. We are happy to announce the second coordinated release of the cocos2d family. We are releasing: CocosBuilder v3.0-alpha1 cocos2d-html5 v2.1.1 cocos2d-iphone v2.1-rc0a cocos2d-x v2.1beta3-x-2.1.1 Our goal is to provide a complete toolchain for developing multi-platform games both for Web and Mobile, [...]]]></description>
				<content:encoded><![CDATA[<p><strong>Update: </strong>cocos2d-iphone v2.1rc0a released. It is a hot fix release with a few important bug fixes.</p>
<p>We are happy to announce the <strong>second coordinated release</strong> of the cocos2d family. We are releasing:</p>
<ul>
<li>CocosBuilder v3.0-alpha1</li>
<li>cocos2d-html5 v2.1.1</li>
<li>cocos2d-iphone v2.1-rc0a</li>
<li>cocos2d-x v2.1beta3-x-2.1.1</li>
</ul>
<p>Our goal is to provide a complete toolchain for developing multi-platform games both for Web and Mobile, all the way from rapid prototyping to a finished high performing game.</p>
<h2>CocosBuilder</h2>
<p><img alt="" src="https://lh3.googleusercontent.com/-254uAEdFGp4/UQgPn77LjOI/AAAAAAAArzo/5olLwIK5cik/s800/cocosbuilder-logo.png" /></p>
<p>Today a second version of CocosBuilder 3 alpha is released. It is a fairly stable release, although there are still features missing that will be in the final version of CocosBuilder 3.</p>
<h3>Download</h3>
<ul>
<li><a href="http://cocosbuilder.com/?page_id=11">cocosbuilder.com/?page_id=11</a></li>
</ul>
<h3>Highlights</h3>
<ul>
<li>Much improved cocos2d JS support</li>
<li>Built in texture packer with support for png, pvr and pvrtc</li>
<li>Automatic resizing of assets for different devices</li>
<li>Improved publishing for Android</li>
<li>Improved support for cocos2d-x</li>
<li>Automatic audio conversions for different platforms</li>
<li>CocosPlayer support for Android, and many fixes regarding reliability</li>
</ul>
<h3>More information</h3>
<p>Read more about all the new features at <a href="http://cocosbuilder.com">cocosbuilder.com</a>.</p>
<h2>cocos2d-html5</h2>
<p><img alt="" src="https://lh6.googleusercontent.com/-u8a4dfBkbf4/UQgPoboEf2I/AAAAAAAArzw/7gYxZE5jEOU/s800/cocos2d-html5-logo.png" /></p>
<h3>Download</h3>
<ul>
<li><a href="http://cocos2d-x.googlecode.com/files/Cocos2d-html5-v2.1.1.zip">cocos2d-html5-v2.1.1 @ Jan.28, 2013</a></li>
</ul>
<h3>Highlights</h3>
<ul>
<li>Added mouse button to MouseDispatcher, supports right-click</li>
<li>Changed preload audio type from &#8220;bgm&#8221; and &#8220;effect&#8221; to &#8220;sound&#8221;</li>
<li>Added &#8220;Sys&#8221; class for system capabilities</li>
<li>Improved <code>cc.BuilderReader</code> to support .ccbi extension auto-completion</li>
<li>Improved <code>TMXXMLParser</code> to support XML, CSV and zlib compression</li>
<li>Changed <code>cc.Time.gettimeofdayCocos2d</code> to <code>Date.now</code> which is more javascript friendly.</li>
<li>Added stackable support for <code>position</code> actions like <code>cc.Move*</code>, <code>cc.Jump</code>, <code>cc.CatmullRom*</code>, etc.</li>
<li>Added filename lookup support in <code>CCFileUtils</code></li>
<li>Fixed bugs</li>
</ul>
<h3>More information</h3>
<p>Read more about all the new features at <a href="http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Html5">cocos2d-html5 release notes</a>.</p>
<h2>cocos2d-iphone</h2>
<p><img alt="" src="https://lh4.googleusercontent.com/-s1DU2gzJuys/UQgPnEX75rI/AAAAAAAArzY/bbLwZSkM7jo/s800/cocos2d-iphone-logo.png" /></p>
<h3>Download</h3>
<ul>
<li><a href="http://cocos2d-iphone.googlecode.com/files/cocos2d-iphone-2.1-rc0a.tar.gz">cocos2d-iphone v2.1-rc0a.tar.gz</a></li>
</ul>
<h3>Highlights</h3>
<ul>
<li>Added stackable support for <code>position</code> actions like <code>CCMove*</code>, <code>CCJump*</code>, <code>CCCatmullRom*</code>, etc.</li>
<li>Added filename lookup support in <code>CCFileUtils</code></li>
<li>Added option to cascade <code>color</code> and <code>opacity</code> in nodes</li>
<li>Added auto-premultiplied alpha support PVRv3 textures</li>
<li>Improved JS bindings support</li>
<li>Many bug fixes</li>
</ul>
<h3>More information</h3>
<p>Read more about all the new features at <a href="https://github.com/cocos2d/cocos2d-iphone/wiki/cocos2d-v2.1-release-notes">cocos2d-iphone v2.1 release notes</a>.</p>
<p><span id="more-2270"></span></p>
<h2>cocos2d-x</h2>
<p><img alt="" src="https://lh3.googleusercontent.com/-glwwzmFyUmk/UQgPnlx40uI/AAAAAAAArzg/WPRW10kkecM/s800/cocos2d-x-logo.png" /></p>
<p>This version is a present of Chinese New Year. Hope you like it.</p>
<h3>Download</h3>
<ul>
<li><a href="http://cocos2d-x.googlecode.com/files/cocos2d-2.1beta3-x-2.1.1.zip">cocos2d-2.1beta3-x-2.1.1.zip</a></li>
</ul>
<h3>Highlights</h3>
<ul>
<li>Added CocosPlayer support for Android. For forther info refer to <a href="https://github.com/cocos2d/cocos2d-x/tree/master/samples/Javascript/CocosPlayer">this document</a></li>
<li>Added Japanese language support</li>
<li>Added Lua support on Linux</li>
<li>Added stackable support for <code>position</code> actions like <code>CCMove*</code>, <code>CCJump*</code>, <code>CCCatmullRom*</code>, etc.</li>
<li>Added filename lookup support in <code>CCFileUtils</code></li>
<li>Added Support two strategies of loading resources. For further info refer to <a href="http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Mechanism_of_loading_resources">this article</a></li>
<li>Remove all deprecated methods to reduce warning message when compiling</li>
<li>gles20 branch is replaced with master in github</li>
<li>JSB improvements:
<ul>
<li>Added <code>sys.localStorage</code> support fo JSB</li>
<li>Updated SpiderMonkey to v18.0</li>
</ul>
</li>
</ul>
<h3>More information</h3>
<p>Read more about all the new features at <a href="http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Cocos2d-x">cocos2d-x-v2.1beta3-2.1.1 release notes</a>.</p>
<h2>New game and improved tests</h2>
<h3>Crystal Craze</h3>
<p>Crystal Craze, a simple match-3 game was added. Features:</p>
<ul>
<li>Designed with CocosBuilder</li>
<li>100% JavaScript</li>
<li>Runs at 60 FPS on iPhone 3GS</li>
<li>Uses particles, sounds and batch nodes</li>
<li>Runs on Web (on top of cocos2d-html5), on iOS (on top of cocos2d-iphone or cocos2d-x) and on Android (on top of cocos2d-x)</li>
<li><a href="http://www.cocos2d-x.org/html5-samples/samples/games/CrystalCraze/Published-HTML5/index.html">Try Crystal Craze online</a></li>
</ul>
<p><img alt="" src="https://lh4.googleusercontent.com/-TAnlgBRRZ7Y/UQcU0eAzpbI/AAAAAAAAryY/xbIneibhMH4/s400/Screen%2520Shot%25202013-01-28%2520at%25204.15.12%2520PM.png" /></p>
<h3>cocos2d tests</h3>
<p>Many tests were added.</p>
<ul>
<li><a href="http://www.cocos2d-x.org/html5-samples/samples/tests/index.html">Try the cocos2d tests online</a></li>
</ul>
<p><img alt="" src="https://lh5.googleusercontent.com/-RNCT7lB0RlQ/UJr0esUQZdI/AAAAAAAAqPg/f9CcRRdJ26k/s400/Screen%2520Shot%25202012-11-07%2520at%25203.07.56%2520PM.png" /></p>
<h3>How to run the games and tests</h3>
<p>For further information regarding how to run the tests, please visit this page: <a href="https://github.com/cocos2d/cocos2d-js-tests#readme">cocos2d JS tests</a></p>
<h2>Thanks</h2>
<p>Many thanks to all the developers, contributors and testers from the cocos2d (html5, iphone and x) and CocosBuilder communities!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cocos2d-iphone.org/archives/2270/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>LensFlare Studio &#8211; Photo Editor for Mac</title>
		<link>http://www.cocos2d-iphone.org/archives/2243?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=lensflare-studio-photo-editor-for-mac</link>
		<comments>http://www.cocos2d-iphone.org/archives/2243#comments</comments>
		<pubDate>Thu, 24 Jan 2013 19:03:27 +0000</pubDate>
		<dc:creator>jamesgrote</dc:creator>
				<category><![CDATA[cocos2d]]></category>

		<guid isPermaLink="false">http://www.cocos2d-iphone.org/?p=2243</guid>
		<description><![CDATA[LensFlare Studio How a 2D game engine came to power a professional photo editor LensFlare Studio is a brand new photo editor for adding optical effects on your Mac. With over 100 effects, you can choose from anamorphic lens flares, lighting effects, sci-fi flares, sunlight glare, and more.  The heart of LensFlare Studio is the [...]]]></description>
				<content:encoded><![CDATA[<h2>LensFlare Studio</h2>
<p><em><strong>How a 2D game engine came to power a professional photo editor</strong></em></p>
<p><img class="size-full wp-image-2246 alignright" alt="LensFlare Studio" src="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2013/01/iconShadow.png" width="120" height="105" /></p>
<p>LensFlare Studio is a brand new photo editor for adding optical effects on your Mac. With over 100 effects, you can choose from anamorphic lens flares, lighting effects, sci-fi flares, sunlight glare, and more.  The heart of LensFlare Studio is the <em>Optics Engine</em> running on cocos2d, the powerful animation framework based on OpenGL.</p>
<p>Lens flares have really become an important part of the visual language for design, adding glares and imperfections to overly perfect shots and computer animation. Lens flares add a sense of depth and brightness to an otherwise flat looking image. I’ll be the first to admit that they are often overused and can over-power an image. Nevertheless, having a powerful tool for creating optical effects is a must for any designer or photographer.</p>
<p>LensFlare Studio is great for:</p>
<ul>
<li>Graphics Design</li>
<li>Logos and Titles</li>
<li>Anamorphic Flares</li>
<li>Special Effects</li>
</ul>
<h1></h1>
<h2>Isn’t cocos2d a Game Engine?</h2>
<p>Who would have thought the leading game framework would be used for a photo editor? When I started the original app, LensFlare for iOS, I knew I needed a fast and easy framework that could handle full animation. For my photo app idea, I wasn&#8217;t interested in making static overlays and filters, but a fully interactive app where you can move, rotate, and scale optical elements effortlessly. This app would also need to render numerous image layers without any slowdown. Effective lens flares are composed of many light components that move, rotate, and scale independently relative to the light source.</p>
<p>It turns out, cocos2d is the perfect framework for this. It was super easy to get started with, yet has proven to be capable of high quality effects and rendering.</p>
<p>&nbsp;</p>
<h2>Optics Engine</h2>
<p>The heart of my apps is the <em>Optics Engine</em>. This handles all of the display and rendering duties to realize the optical effects. Each lens flare effect is a collection of images contained in classes derived from the CCSprite base image class. Cocos2d framework handles large numbers of on screen images very efficiently through the use of texture caching. My custom CCSprite image classes handle the different types of optical effects and model the physical characteristics of light and glass interaction. For example, the EdgeFlare class only shows itself when the light source is near the edge of the screen, thus modeling light hitting the edge of a physical camera lens and glaring across the the frame.</p>
<p>&nbsp;</p>
<h2>LensFlare for iOS</h2>
<p>I first developed the <em>Optics Engine</em> as the foundation of LensFlare for iOS.<br />
Over the past 2 years I’ve expanded this into two more apps; LensLight and AlienSky, which add more content and features while using the same <em>Optics Engine</em>.</p>
<p style="text-align: center;"><a href="http://www.cocos2d-iphone.org/archives/2243/iosapps" rel="attachment wp-att-2248"><img class="size-full wp-image-2248 aligncenter" alt="iosApps" src="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2013/01/iosApps.jpg" width="600" height="84" /></a></p>
<p>These are iOS apps designed for adding optical effects to your iPhone photos. They have minimal UI and are mostly gesture based. After placing an effect on your photo, you can move, rotate, and scale it by touch. These apps are universal and work on iPads as well. Making them universal was very easy to do with the cocos2d framework which elegantly handles screen resolution internally.</p>
<p>&nbsp;<br />
<span id="more-2243"></span></p>
<h2>LensFlare Studio for Mac</h2>
<p>When it came time to consider making a Mac app, I realized this would need a much richer user interface. My solution was to simply treat my cocos2d <em>Optics Engine</em> as a view surrounded by an AppKit UI. I was essentially dropping my iOS LensFlare app into an OpenGL view on the screen and building a Mac interface around that. I’m reusing the entire <em>Optics Engine</em> in the Mac app. The Mac and iOS apps share many of the same effects using the same code. The cocos2d framework has had no problems scaling up to the much higher requirements of a Mac app. It efficiently handles the huge image assets and artwork I use for the Mac version.</p>
<p><img class="size-full wp-image-2251 aligncenter" alt="screenshot1" src="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2013/01/screenshot1.jpg" width="400" height="262" /></p>
<p>Here’s a screenshot of my Xcode environment. The big OpenGL view completely encapsulates the <em>Optics Engine</em>, which is controlled by the surrounding interface. The <em>Optics Engine</em> nicely scales up to any Mac screen size, whereas the surrounding UI stays the same. This is another example of how powerful the cocos2d framework is. From the ground up, it’s designed to be scalable for any screen size or pixel density.</p>
<p style="text-align: center;"><a href="http://www.cocos2d-iphone.org/archives/2243/xcodescreenshot1" rel="attachment wp-att-2252"><img class="size-full wp-image-2252 aligncenter" alt="xcodeScreenshot1" src="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2013/01/xcodeScreenshot1.jpg" width="400" height="282" /></a></p>
<p style="text-align: center;">￼</p>
<h2>Mac Process Threading</h2>
<p>One thing to be aware of when moving from iOS to Mac is threading. When accessing the OpenGL view and cocos2d code, you have to make sure you’re on the same thread as the CCDirector instance. Some of the built in functions like document open run on different threads, so I had to make sure the calls from the document open code use the right thread to access the <em>Optics Engine</em>.</p>
<h2>Conclusion</h2>
<p>I hope this overview of LensFlare Studio helps sparks some ideas of your own. It’s relatively easy to take a pure cocos2d iOS app and drop it into a view for a more feature rich Mac app.</p>
<p><img class="aligncenter size-full wp-image-2258" alt="LensFlare Studio" src="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2013/01/lensFlareStudioAd.jpg" width="600" height="231" /></p>
<p>&nbsp;</p>
<p>Cocos2d is a powerful framework and the cocos2d community is an important part of the equation. I want to thank Riq and the cocos2d community for this awesome site!</p>
<p>I’d love to answer any questions and hear your comments. Thanks for reading!<br />
- James Grote</p>
<p><strong>WEBSITE<br />
</strong><a title="LensFlareStudioApp.com" href="http://LensFlareStudioApp.com" target="_blank">http://LensFlareStudioApp.com</a></p>
<p><strong>FACEBOOK<br />
</strong>You can find me on Facebook. I post updates and previews of new effects I’m working on.<br />
<a title="https://www.facebook.com/LensFlareStudio" href="https://www.facebook.com/LensFlareStudio" target="_blank">https://www.facebook.com/LensFlareStudio</a></p>
<p><strong>VIDEO</p>
<p><iframe src="http://player.vimeo.com/video/49759948" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></p>
<p></strong></p>
<p><strong> </strong></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cocos2d-iphone.org/archives/2243/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Creating Games with cocos2d for iPhone 2</title>
		<link>http://www.cocos2d-iphone.org/archives/2218?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=creating-games-with-cocos2d-for-iphone-2</link>
		<comments>http://www.cocos2d-iphone.org/archives/2218#comments</comments>
		<pubDate>Tue, 15 Jan 2013 02:38:51 +0000</pubDate>
		<dc:creator>Dragyn</dc:creator>
				<category><![CDATA[book]]></category>
		<category><![CDATA[cocos2d]]></category>

		<guid isPermaLink="false">http://www.cocos2d-iphone.org/?p=2218</guid>
		<description><![CDATA[I’m happy to share my new book, Creating Games with cocos2d for iPhone 2. Creating Games with cocos2d for iPhone 2 takes you through the entire process of designing and building nine complete games for the iPhone, iPod Touch, or iPad using cocos2d 2.0. The projects start simply and gradually increase in complexity, building on [...]]]></description>
				<content:encoded><![CDATA[<p>I’m happy to share my new book, <strong>Creating Games with cocos2d for iPhone 2</strong>.<a href="http://www.packtpub.com/creating-games-with-cocos2d-for-iphone-2/book"><img class="alignright size-full wp-image-2221" alt="packt_book_cover_small" src="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2013/01/packt_book_cover_small.png" width="175" height="213" /></a></p>
<p><strong>Creating Games with cocos2d for iPhone 2</strong> takes you through the entire process of designing and building nine complete games for the iPhone, iPod Touch, or iPad using cocos2d 2.0. The projects start simply and gradually increase in complexity, building on the lessons learned in previous chapters. Good design practices are emphasized throughout.</p>
<p><b>Why This Book Exists</b></p>
<p>I will dispense with the general marketing blurbs here.  If you want to read the “official” promotional information, it is all in the first post of <a title="Book's Forum Topic" href="http://www.cocos2d-iphone.org/forum/topic/131814">this forum thread</a>.</p>
<p>Instead, I want to share, from a developer’s perspective, why you might want to read this book.  Most developers learn the basics of cocos2d for iPhone v.2.0, and subsequently hit a wall.  We have all these interesting classes that are really powerful, like CCLayer, CCSprite, actions, etc.  How can we put these things together and make something equally interesting out of them?</p>
<p>That is the “gap” this book aims to fill.  Rather than take the beginner’s book approach, where we spend several pages explaining what a sprite is, how it is drawn, etc.  “Creating Games” skips many of the generalities and jumps right into the reason we are here: building games.   This is the book I wished I had in hand when I was first exploring cocos2d for iPhone.</p>
<p>Class by class, method by method, the text explains the “good parts” of why we are building the code in this fashion.  All the “good parts” are explained in detail: from building with Box2D to GameKit Bluetooth integration, and even how to build in “artificial randomness” into a Match 3 game, so you never run out of moves.</p>
<p>Each chapter is a complete game, and all source code is available as a download from the publisher’s web site. The games cover a wide variety of game types, and the games become more intricate and complex as the book progresses.</p>
<p><iframe width="500" height="281" src="http://www.youtube.com/embed/WicrChtlDs0?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>The games included in the book are:<br />
Chapter 1: Memory<br />
Chapter 2: Match 3<br />
Chapter 3: Mole Thumper<br />
Chapter 4: Snake<br />
Chapter 5: Brick Breaker (with Box2D)<br />
Chapter 6: Cycles of Light (iPad with Bluetooth integration)<br />
Chapter 7: Pool (with Box2D)<br />
Chapter 8: Scrolling Shooter (using Tiled)<br />
Chapter 9: Endless Runner</p>
<p><b>Book Giveaway</b></p>
<p>We are giving away two free copies of <strong>Creating Games with cocos2d for iPhone 2</strong>!  The contest runs until January 29, 2013.  To enter, all you need to do is post why you want the book to the book’s forum thread.  To see the particulars of the contest, read this post: <a title="Book Giveaway" href="http://www.cocos2d-iphone.org/forum/topic/131814/page/2?replies=31#post-333051">Book Giveaway</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cocos2d-iphone.org/archives/2218/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Foldify</title>
		<link>http://www.cocos2d-iphone.org/archives/2180?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=foldify</link>
		<comments>http://www.cocos2d-iphone.org/archives/2180#comments</comments>
		<pubDate>Thu, 13 Dec 2012 08:30:43 +0000</pubDate>
		<dc:creator>Krzysztof Zabłocki</dc:creator>
				<category><![CDATA[cocos2d]]></category>

		<guid isPermaLink="false">http://www.cocos2d-iphone.org/?p=2180</guid>
		<description><![CDATA[There are now over 1 000 000 apps in the App Store. And there is not a single one like Foldify. If you haven&#8217;t seen it already then you definitely should: &#160; &#160; Foldify is an Indie app, created by a team of 3: Engineering &#8211; Krzysztof Zabłocki Design &#8211; Mariusz Ostrowski &#38; Renata Ostrowska Let&#8217;s [...]]]></description>
				<content:encoded><![CDATA[<p>There are now over 1 000 000 apps in the App Store. And there is not a single one like <strong><a href="http://foldifyapp.com">Foldify</a></strong>. If you haven&#8217;t seen it already then you definitely should:</p>
<p>&nbsp;</p>
<p><iframe src="http://player.vimeo.com/video/54479185" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></p>
<p>&nbsp;</p>
<p><strong><a href="http://foldifyapp.com">Foldify</a></strong> is an Indie app, created by a team of 3:</p>
<ul>
<li>Engineering &#8211; Krzysztof Zabłocki</li>
<li>Design &#8211; Mariusz Ostrowski &amp; Renata Ostrowska</li>
</ul>
<p>Let&#8217;s talk about how it was created and the technical aspects.</p>
<h2>Basics</h2>
<p>Foldify is using cocos2d 2.x for 2d rendering, and on top of that there is custom 3d rendering code.</p>
<p>Why not cocos3d? It doesn&#8217;t work with shaders, and I like shaders a lot.Besides, the problem with cocos3d is the lack of a GitHub account. So there is no way to send pull request to the authors.</p>
<p>During the development of Foldify I&#8217;ve encounter few missing features in cocos2d, which were necessary:</p>
<p>I needed render texture with support for depth and stencil buffers, and also an easier way to render content into it.</p>
<p>Stencil buffers can be used for many effects, like shadowing and marking parts of scene immutable ( preventing drawing on them ). The second usage was actually used in Foldify to prevent the user from drawing outside the grid. These changes are now part of cocos2d 2.x.</p>
<h2>Gestures</h2>
<p>When we started working on Foldify, we decided we didn&#8217;t want to follow standard patterns, we wanted to make new ones.</p>
<p>One place where we could implement that was Creation Layer. What if instead of changing brush size we could use gestures to zoom in and out of virtual paper ?</p>
<p>The problem with changing brush size is that you can&#8217;t really change your finger size or make it transparent, so if you set small brush size how are you actually gonna see the area you are drawing on ?</p>
<p>I&#8217;m not skilled graphical artist, I want something simple and something I can use with ease. Instead let&#8217;s try zooming in on the area I want to draw detail on, now you can still use your finger-sized brush but the relative size of drawing is way smaller ( because you are zoomed in ).</p>
<p>One of the missing features of cocos2d is the lack of Gestures. We have touches[Began,Moved,Ended] which may work for simple games, but it&#8217;s just not usefull for heavy gesture driven apps.</p>
<p>That&#8217;s why I&#8217;ve created <a href="http://www.merowing.info/2012/03/using-gesturerecognizers-in-cocos2d/">Category for adding gesture recognizers in any cocos2d version</a>. Once you include this code in your project, you can add any gesture recognizer to any CCNode and it works flawlessly. This is the same code that drives Foldify creation, where you can use pinch/rotate/pan gestures at the same time.</p>
<h2>Drawing</h2>
<p>When I started working on Foldify, I was surprised by the lack of good algorithms for drawing lines. There were some materials, but people were using different bezier calculations or cat-mull roms algorithms, which really required a lot of control points to create nice smooth lines. And there was not a single article that would explain how to create line drawing from Scratch to final anti-aliased lines.</p>
<p>I&#8217;ve also been impressed by how easy and beautiful is to draw with <a href="http://www.fiftythree.com/paper">Paper by Fifty Three</a>. They have created line drawing algorithm which was based on the speed of strokes.</p>
<p>I&#8217;ve decided to come up with proper algorithm for line drawing, that would explain whole algorithm from scratch to complete anti-aliased lines. That&#8217;s how I&#8217;ve created <a href="http://www.merowing.info/2012/04/drawing-smooth-lines-with-cocos2d-ios-inspired-by-paper/">this tutorial</a>.</p>
<h2>Conclusion</h2>
<p>Foldify is probably the biggest Indie project I&#8217;ve worked on, I&#8217;ve been doing it after hours during my full-time job, which wasn&#8217;t that easy, working long nights and getting little sleep.</p>
<p>The feedback we received from everyone is just amazing. It&#8217;s really great to see your work appreciated!</p>
<p>Most of all I&#8217;d like to thank all people that contributed to cocos2d, as this is probably the best 2d framework. And the community of cocos2d is full of really creative people. I hope my contributions will help you create fascinating games!</p>
<p>If you have any questions, don&#8217;t be afraid to ask <img src='http://www.cocos2d-iphone.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Thank you for reading. Let’s keep in touch on twitter <a href="http://twitter.com/merowing_">@merowing_</a></p>
<p><strong><a href="http://itunes.com/apps/foldify"><img class="alignnone size-full wp-image-2187" src="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2012/12/Available_on_the_App_Store_Badge_US-UK_135x40_0824.png" alt="" width="135" height="40" /></a></strong></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cocos2d-iphone.org/archives/2180/feed</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Introducing the cocos2d multi-platform toolchain</title>
		<link>http://www.cocos2d-iphone.org/archives/2196?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=introducing-the-cocos2d-multi-plaform-toolchain</link>
		<comments>http://www.cocos2d-iphone.org/archives/2196#comments</comments>
		<pubDate>Tue, 04 Dec 2012 23:54:52 +0000</pubDate>
		<dc:creator>riq</dc:creator>
				<category><![CDATA[cocos2d]]></category>

		<guid isPermaLink="false">http://www.cocos2d-iphone.org/?p=2196</guid>
		<description><![CDATA[We are happy to announce the first coordinated release of the cocos2d family. We are releasing: CocosBuilder v3.0-alpha0 cocos2d-html5 v2.1 cocos2d-iphone v2.1-beta4 cocos2d-x v2.1beta3-x–2.1.0 Our goal is to provide a complete toolchain for developing multi-platform games both for Web and Mobile, all the way from rapid prototyping to a finished high performing game. The main [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2009/06/cocos2d_67.png"><img class="alignright size-full wp-image-82" title="cocos2d icon" src="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2009/06/cocos2d_67.png" alt="" width="67" height="67" /></a>We are happy to announce the first coordinated release of the cocos2d family. We are releasing:</p>
<ul>
<li>CocosBuilder v3.0-alpha0</li>
<li>cocos2d-html5 v2.1</li>
<li>cocos2d-iphone v2.1-beta4</li>
<li>cocos2d-x v2.1beta3-x–2.1.0</li>
</ul>
<p>Our goal is to provide a complete toolchain for developing multi-platform games both for Web and Mobile, all the way from rapid prototyping to a finished high performing game.</p>
<p>The main components of our stack are:</p>
<ul>
<li>A visual editor ( <a href="http://www.cocosbuilder.com">CocosBuilder</a> )</li>
<li>A graphics engine ( <a href="http://github.com/cocos2d">cocos2d</a> )</li>
<li>A physics engine ( <a href="http://www.chipmunk-physics.net">Chipmunk</a> )</li>
</ul>
<p>For the Web, we are using pure JavaScript code, while for Mobile we are using JavaScript on top of native engines for maximum performance.</p>
<h2 id="cocosbuilder">CocosBuilder</h2>
<p><img src="http://cocosbuilder.com/wp-content/uploads/2011/05/screenshot2.png" alt="" width="400" /></p>
<p>Version 3.0 will be the next main release of CocosBuilder, today an alpha version is released.</p>
<h3 id="download">Download</h3>
<ul>
<li><a href="http://cocosbuilder.com/?page_id=11">cocosbuilder.com/?page_id=11</a></li>
</ul>
<h3 id="highlights">Highlights</h3>
<ul>
<li>Support for cocos2d JavaScript API</li>
<li>Publishing to HTML5</li>
<li>CocosPlayer lets you test your JavaScript apps directly on your iOS device without recompilation</li>
<li>Many bug fixes</li>
</ul>
<h3 id="moreinformation">More information</h3>
<p>Read more about all the new features at <a href="http://cocosbuilder.com">cocosbuilder.com</a>.</p>
<h2 id="cocos2dhtml5">cocos2d html5</h2>
<p><img src="http://www.cocos2d-x.org/reference/html5-js/css/cocos2d-html5.png" alt="" /></p>
<h3 id="download">Download</h3>
<ul>
<li><a href="http://cocos2d-x.googlecode.com/files/Cocos2d-html5-v2.1.zip">cocos2d-html5-v2.1 @ Dec.4, 2012</a></li>
</ul>
<h3 id="hightlights">Highlights</h3>
<ul>
<li>Integrated <a href="https://github.com/josephg/Chipmunk-js">Chipmunk-JS</a> physics engine. API is compatible with cocos2d-x and cocos2d-iphone</li>
<li>10% performance increase across the board with <a href="http://www.cocos2d-x.org/projects/cocos2d-x/wiki/About_ccClass_Release_Mode"><code>cc.Class</code> Release Mode</a></li>
<li>Added support for <code>google.base</code> which offers alternate javascript inheritance style.</li>
<li>Added support for <a href="http://cocosbuilder.com">CocosBuilder</a> and Bone Animation.</li>
<li>Added <code>cc.PhysicsDebugNode</code>, <code>cc.PhysicsSprite</code>, <code>cc.DrawNode</code>.</li>
<li>Better support for mouse, touch and keyboard</li>
<li>Fixed various bugs</li>
<li>Added Watermelon with Me game sample, which is 10% done in CocosBuilder and 90% JavaScript</li>
<li>Added CocosDragon game sample, which is 90% done in CocosBuilder and 10% Javascript Code</li>
<li>Added Edit Box for text input</li>
</ul>
<h3 id="moreinformation">More information</h3>
<p>Read more about all the new features at <a href="http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Html5">cocos2d-html5 release notes</a>.</p>
<h2 id="cocos2d-iphone">cocos2d-iphone</h2>
<p><img src="http://www.cocos2d-iphone.org/wiki/lib/exe/fetch.php/resources:official-cocos-logo-landscape-happy.png" alt="" width="250" /></p>
<h3 id="download">Download</h3>
<ul>
<li><a href="http://cocos2d-iphone.googlecode.com/files/cocos2d-iphone-2.1-beta4.tar.gz">cocos2d-iphone v2.1-beta4.tar.gz</a></li>
</ul>
<h3 id="highlights">Highlights</h3>
<ul>
<li>JS Bindings: compatible with cocos2d-html5 / chipmunk-js API</li>
<li>Improved <code>CCFileUtils</code>:</li>
<li>Added option to load resources from directories for different devices, instead of using suffixes</li>
<li>Added option to add additional search paths</li>
<li>Many bug fixes</li>
</ul>
<h3 id="moreinformation">More information</h3>
<p>Read more about all the new features at <a href="https://github.com/cocos2d/cocos2d-iphone/wiki/cocos2d-v2.1-release-notes">cocos2d-iphone v2.1 release notes</a>.</p>
<h2 id="cocos2d-x">cocos2d-x</h2>
<p><img src="http://www.cocos2d-x.org/attachments/710/cocos2dx_landscape.png" alt="" width="250" /></p>
<p>After one month of hard work, cocos2d–2.1beta3-x–2.1.0 is available for download. This version includes some exciting new features and big improvements.</p>
<h3 id="download">Download</h3>
<ul>
<li><a href="http://cocos2d-x.googlecode.com/files/cocos2d-2.1beta3-x-2.1.0.zip">cocos2d–2.1beta3-x–2.1.0.zip</a></li>
</ul>
<h3 id="highlights">Highlights</h3>
<ul>
<li>JS Bindings: compatible with cocos2d-html5 / chipmunk-js API</li>
<li>Added marmalade support</li>
<li>Added sample games: Watermelon With Me and CocosDragon</li>
<li>Updated CCBReader to latest version of CocosBuilder</li>
<li>Added new features from cocos2d-iphone v2.1 beta3 like:</li>
<li><code>CCClippingNode</code></li>
<li><code>CCDrawNode</code></li>
<li><code>CCPhysicsDebugNode</code> and <code>CCPhysicsSprite</code> (under extensions/physics_nodes/)</li>
<li>Accessing to files from APK is boosted. You can refer to this <a href="https://github.com/cocos2d/cocos2d-x/pull/1562">PR</a> for detail information.</li>
<li>CocosDragon, MoonWarriors, Watermelon With Me and JS Tests use the same JavaScript code as cocos2d-html5 and cocos2d-iphone.</li>
</ul>
<h3 id="moreinformation">More information</h3>
<p>Read more about all the new features at <a href="http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Native">cocos2d-x release notes</a>.</p>
<p><span id="more-2196"></span></p>
<h2 id="tryoursamplesonline">Try our samples online</h2>
<h3 id="watermelonwithme">Watermelon with Me</h3>
<ul>
<li><a href="http://www.cocos2d-x.org/html5-samples/samples/games/WatermelonWithMe/index.html">Play Watermelon with Me online</a></li>
</ul>
<p><img src="https://lh4.googleusercontent.com/-UN172XDeYuc/UJr0dwmusrI/AAAAAAAAqPU/PnxFym4bEAg/s400/Screen%2520Shot%25202012-11-07%2520at%25203.07.32%2520PM.png" alt="" /></p>
<h3 id="cocosdragon">CocosDragon</h3>
<ul>
<li><a href="http://www.cocos2d-x.org/html5-samples/samples/games/CocosDragonJS/Published%20files%20HTML5/index.html">Play CocosDragon online</a></li>
</ul>
<p><img src="https://lh3.googleusercontent.com/-W1iYcgwD9tQ/UJr0bwshvdI/AAAAAAAAqPM/MRiCiugxbHU/s400/Screen%2520Shot%25202012-11-07%2520at%25203.05.49%2520PM.png" alt="" /></p>
<h3 id="moonwarriors">MoonWarriors</h3>
<ul>
<li><a href="http://www.cocos2d-x.org/html5-samples/samples/games/MoonWarriors/index.html">Play MoonWarriors online</a></li>
</ul>
<p><img src="https://lh6.googleusercontent.com/-LOH3b6udHUE/UJr0eYGuhkI/AAAAAAAAqPc/6jI78PBIYM8/s400/Screen%2520Shot%25202012-11-07%2520at%25203.06.28%2520PM.png" alt="" /></p>
<h3 id="cocos2dtests">cocos2d tests</h3>
<ul>
<li><a href="http://www.cocos2d-x.org/html5-samples/samples/tests/index.html">Try the cocos2d tests online</a></li>
</ul>
<p><img src="https://lh5.googleusercontent.com/-RNCT7lB0RlQ/UJr0esUQZdI/AAAAAAAAqPg/f9CcRRdJ26k/s400/Screen%2520Shot%25202012-11-07%2520at%25203.07.56%2520PM.png" alt="" /></p>
<h2 id="thanks">Thanks</h2>
<p>Many thanks to all the developers, contributors and testers from the cocos2d (html5 / iphone and x) and CocosBuilder communities!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cocos2d-iphone.org/archives/2196/feed</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Pixel based destructible ground with Cocos2d</title>
		<link>http://www.cocos2d-iphone.org/archives/2113?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=pixel-based-destructible-ground-with-cocos2d</link>
		<comments>http://www.cocos2d-iphone.org/archives/2113#comments</comments>
		<pubDate>Wed, 21 Nov 2012 18:10:44 +0000</pubDate>
		<dc:creator>jptsetung</dc:creator>
				<category><![CDATA[cocos2d]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[source code]]></category>

		<guid isPermaLink="false">http://www.cocos2d-iphone.org/?p=2113</guid>
		<description><![CDATA[&#160; Worms, Lemmings, Micro Miners&#8230; A pixel based destructible ground is the kind of engine used in many popular games such as early appstore hit iShoot by Ethan Nicholas, Worms, or Lemmings. And also, since the 15th of November 2012, in my new iOS game Micro Miners. I started Micro Miners two years ago, after testing an amazing class [...]]]></description>
				<content:encoded><![CDATA[<div id="attachment_2139" class="wp-caption alignleft" style="width: 330px"><img class="size-full wp-image-2139" src="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2012/11/half__worms2_iphone.png" alt="Micro Miners iOS game" width="320" height="480" /><p class="wp-caption-text">OMG a giant worm! Micro Miners iOS game.</p></div>
<p>&nbsp;</p>
<p><strong>Worms, Lemmings, Micro Miners&#8230;</strong></p>
<p>A pixel based destructible ground is the kind of engine used in many popular games such as early appstore hit <a title="iShoot" href="http://www.iphonesavior.com/2009/01/iphone-developer-quits-day-job-after-ishoot-hits-number-one.html">iShoot by Ethan Nicholas</a>, <a title="Worms" href="http://en.wikipedia.org/wiki/Worms_(1995_video_game)">Worms</a>, or <a href="http://en.wikipedia.org/wiki/Lemmings_(video_game)">Lemmings</a>. And also, since the 15th of November 2012, in my new iOS game <a title="Micro Miners on the appstore" href="https://itunes.apple.com/app/micro-miners/id413240207">Micro Miners</a>. I started Micro Miners two years ago, after testing an amazing class called <em><a title="CCMutableTexture" href="http://www.cocos2d-iphone.org/forum/topic/2449">CCMutableTexture</a> </em>that was crafted and shared by the not less amazing <a title="Lam Pham on twitter" href="https://twitter.com/LamPham">Lam Pham</a>. &#8220;2 years ago&#8221; means the source code provided here is based on cocos2d v1, but not too difficult to adapt to v2, I guess.</p>
<p>For this article, I&#8217;ve created a Xcode v4.5 + Cocos2d v1.01 project with a basic destructible ground engine. This is intended to be very simple starting point if you want to make your own game base on destructible grounds. But in any case this is a ready to use destructible ground engine.</p>
<p>I also recorded a short video of the project in action on the iPhone simulator. A quick way to see if this article could be of any interest to you.</p>
<p>Source code : <a title="Pixel-based-destructible-ground-with-Cocos2d-iPhone" href="https://github.com/jpsarda/Pixel-based-destructible-ground-with-Cocos2d-iPhone">https://github.com/jpsarda/Pixel-based-destructible-ground-with-Cocos2d-iPhone</a></p>
<div style="clear: both;"></div>
<p><strong>1) GitHub project and video demo</strong></p>
<p>Watch carefully the video below, it shows exactly what you get when you download, compile and run the demo project provided on <a title="Pixel-based-destructible-ground-with-Cocos2d-iPhone" href="https://github.com/jpsarda/Pixel-based-destructible-ground-with-Cocos2d-iPhone">GitHub</a>.</p>
<p><iframe width="500" height="375" src="http://www.youtube.com/embed/w2eKGr1anSk?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p><strong>2) The performance bottleneck</strong></p>
<p>The engine is based on the <em>CCMutableTexture</em> class. Basically, a <em>CCMutableTexture</em> maintains an array of pixels value representing the texture. You can then quickly access and modify the pixels in this array. But once you&#8217;re done with the modifications, you have to apply them. The internal pixel array is then drawn on the actual texture. This step is the performance bottleneck of the destructible ground engine. Knowing this, all must be done to minimize the surface of the <em>CCMutableTexture</em> we draw on, and the number of times we call <em>apply</em> on the <em>CCMutableTexture</em>.</p>
<p><strong>3) Minimizing the surface of the CCMutableTextures</strong></p>
<p>This is achieved in 2 steps</p>
<ol>
<li>1 pixel on the texture will be rendered as a 2&#215;2 square on the screen. In other words the displayed <em>CCSprite</em> associated to the texture is scaled by a factor of 2. The look is more pixelated but it&#8217;s still acceptable. For example, instead for applying our changes on a 320&#215;480 texture, we will apply them on a 160&#215;240 texture. This is 4 times less pixels to draw when we call <em>apply</em> on the <em>CCMutableTexture</em>.</li>
<li>If we use full screen textures, each time we move our finger on the screen to dig the ground, the full screen <em>CCMutableTexture</em> is modified and we must call <em>apply</em> on it. That&#8217;s a pity because only a small part of the screen is affected by our finger. To prevent this, the ground is splited in zones. In the project provided, we&#8217;ve splited the ground in 4 stripes (from top to bottom). When we dig the ground, only the affected zones are redrawn (you can see the affected grounds colorized in red while digging).</li>
</ol>
<table border="0">
<tbody>
<tr>
<td>
<p><div id="attachment_2163" class="wp-caption alignnone" style="width: 330px"><a href="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2012/12/destructibleground1zone.png"><img class="size-full wp-image-2163" src="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2012/12/destructibleground1zone.png" alt="Destructible ground, 1 zone affected" width="320" height="480" /></a><p class="wp-caption-text">Finger digging in the middle of a ground zone, only 1 zone affected.</p></div></td>
<td>
<p><div id="attachment_2162" class="wp-caption alignnone" style="width: 330px"><a href="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2012/12/destructibleground2zones.png"><img class="size-full wp-image-2162" src="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2012/12/destructibleground2zones.png" alt="Destructible grouns, 2 zones affected" width="320" height="480" /></a><p class="wp-caption-text">Finger digging at the border of 2 zones, 2 zones affected.</p></div></td>
</tr>
</tbody>
</table>
<p><strong>4) Minimizing the calls to <em>apply</em></strong></p>
<p><em>ccTouchesMoved</em>, which is the method invoked when the user moves his finger on the screen, can be called at very high frequency. We can&#8217;t afford to call <em>apply</em> on the textures on every move. We solve this problem by introducing a minimum delay (<em>0.5 seconds</em>) to pass before taking into account a move of the finger. Illustrated with this peace of code in <em>ccTouchesMoved</em> :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>now<span style="color: #002200;">-</span>lastDigTime&gt;0.05f<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
    <span style="color: #11740a; font-style: italic;">// determine affected zones ...</span>
    <span style="color: #11740a; font-style: italic;">// draw lines ...</span>
    <span style="color: #11740a; font-style: italic;">// apply changes ...</span>
    lastDigTime<span style="color: #002200;">=</span>now;
<span style="color: #002200;">&#125;</span></pre></td></tr></table></div>

<p><span id="more-2113"></span><br />
<strong>5) Digging and polygons</strong></p>
<p>The awesome <em>CCMutableTexture</em> class was modified mainly to add polygon drawing capabilities.</p>
<div id="attachment_2128" class="wp-caption alignnone" style="width: 665px"><a href="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2012/11/illustrationmm0.png"><img class="size-full wp-image-2128" src="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2012/11/illustrationmm0.png" alt="Drawing a line with rounded extremities via convex polygon filling" width="655" height="436" /></a><p class="wp-caption-text">Drawing a line with rounded extremities via convex polygon filling</p></div>

<div class="wp_syntax"><table><tr><td class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">// This method fills a convex polygon with a given color</span>
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> fillConvexPolygon<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CGPoint<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>p <span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">int</span><span style="color: #002200;">&#41;</span>n withColor<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>ccColor4B<span style="color: #002200;">&#41;</span>c;
&nbsp;
<span style="color: #11740a; font-style: italic;">// This method draws a solid line (with line width parameter) by building a polygon to be used in fillConvexPolygon</span>
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> drawLineFrom<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CGPoint<span style="color: #002200;">&#41;</span>p0 to<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CGPoint<span style="color: #002200;">&#41;</span>p1 withLineWidth<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">float</span><span style="color: #002200;">&#41;</span>w andColor<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>ccColor4B<span style="color: #002200;">&#41;</span> c;</pre></td></tr></table></div>

<p>So here is what happens when you move your finger on the screen to dig in the ground :</p>
<ul>
<li>We call <em>drawLineFrom:A to:B withLineWidth: andColor:</em> , <em>A</em> and <em>B</em> being respectively the coordinates of the finger before the move and after the move.</li>
<li>The method build a 10 points polygon to draw a rounded line from <em>A</em> to <em>B</em> (4 points to draw the rectangle and 3 points for each rounded extremities)</li>
<li>We call <em>fillConvexPolygon: : withColor:</em> with the calculated polygon.</li>
<li>Before drawing, the points of the polygon are ordered from bottom to top.</li>
<li>The polygon is filled from bottom to top by drawing horizontal lines.</li>
<li>On each step of the drawing loop, we follow the left and right edges of the polygon to determine the coordinates of the horizontal line to be drawn.</li>
</ul>
<p><strong>6) Drawing on different zones</strong></p>
<p>Most of the time, your finger on the screen will affect only one zone of ground. But when the finger cross a zones border, it hits 2 zones at the same time. When this happens, we draw the polygon on each textures. That means our polygon filling algorithm is run twice instead of once. That&#8217;s the price to pay for splitting the ground in zones, but it&#8217;s insignificant compared to the cost of not splitting the grouns in zones (see <strong>2)</strong> and <strong>3)</strong>).</p>
<p><strong>7) Collisions</strong></p>
<p>I&#8217;ve added some basic tiny miners in the demo project to show how to handle collisions. They will fall if you dig the ground under their feet.</p>
<p>For collision checking, we consider a miner to be 1 pixel. First we determine which ground zone contains the collision pixel. Then, by calling <em>getPixelAt</em> in the <em>CCMutableTexture</em> associated to the zone, we determine if the collision pixel is in a hole (<em>alpha=0</em>) or not.</p>
<p><strong>8) Go further</strong></p>
<ul>
<li>Create a class to handle the multi-zone destructible ground, that will handle polygon drawing and zone detection.</li>
<li>Create a class to handle the characters (miners, lemmings, whatever&#8230;), make them walk, jump, &#8230;</li>
<li>Manage the scrolling of the ground, dynamically create new ground zones when needed.</li>
<li>Split the ground in smaller zones, vertical AND horizontal splitting managed with a 2-dimensional array. Necessary for large maps in both width and height.</li>
</ul>
<p>Thank you for reading. Let&#8217;s keep in touch on twitter <a title="@jpsarda on twitter" href="http://twitter.com/jpsarda">@jpsarda</a>.</p>
<div><a title="Micro Miners on the appstore" href="https://itunes.apple.com/app/micro-miners/id413240207"><img class="alignleft size-full wp-image-2157" src="http://www.cocos2d-iphone.org/blog/wp-content/uploads/2012/12/microminers.png" alt="Micro Miners" width="64" height="64" /></a><strong>Download <a title="Micro Miners iOS game" href="http://microminers.com/">Micro Miners</a> on the AppStore : <a title="Micro Miners on the AppStore" href="https://itunes.apple.com/app/micro-miners/id413240207">iTunes link</a>.</strong></div>
<p>Micro Miners gameplay video below</p>
<p><iframe width="500" height="375" src="http://www.youtube.com/embed/5yPURv6E0wQ?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cocos2d-iphone.org/archives/2113/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
