<?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>Frozax Games Dev Blog</title>
	<atom:link href="http://www.frozax.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.frozax.com/blog</link>
	<description>Game Dev, Casual Gaming, Programming and more</description>
	<lastBuildDate>Thu, 02 Feb 2012 22:53:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>New Year, New Logo, New Projects</title>
		<link>http://www.frozax.com/blog/2012/01/year-logo-projects/</link>
		<comments>http://www.frozax.com/blog/2012/01/year-logo-projects/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 20:55:41 +0000</pubDate>
		<dc:creator>Frozax</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[logo]]></category>
		<category><![CDATA[new year]]></category>

		<guid isPermaLink="false">http://www.frozax.com/blog/?p=973</guid>
		<description><![CDATA[Happy new year 2012! As you can this on the top left of this page, I now have a new logo. I hope you&#8217;ll like it! It was made by Amaury Bündgen. You can see his portfolio here. In 2012, I plan to release games on new targets: iOS and Android. I guess you already [...]]]></description>
			<content:encoded><![CDATA[<p>Happy new year 2012!</p>
<p>As you can this on the top left of this page, I now have a new logo. I hope you&#8217;ll like it!</p>
<p>It was made by Amaury Bündgen. You can see his portfolio <a href="http://www.planetexenoid.fr">here</a>.</p>
<p>In 2012, I plan to release games on new targets: iOS and Android. I guess you already knew that according to the recent blog posts. I would like to release at least 3 games on mobile this year. The first two games will be modified ports of <a href="http://www.frozax.com/games/spring-up-harmony">Spring Up Harmony</a> and <a href="http://www.frozax.com/games/dont-feed-the-trolls">Don&#8217;t Feed the Trolls</a>.</p>
<p>Get the latest information about these games with <a href="http://www.facebook.com/frozax">facebook</a>, <a href="http://twitter.com/Frozax">twitter</a> or <a href="http://plus.google.com/117773429877335932919">google+</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.frozax.com/blog/2012/01/year-logo-projects/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Why and how to pack your textures for iOS/Android</title>
		<link>http://www.frozax.com/blog/2011/12/why-how-pack-textures-ios-android/</link>
		<comments>http://www.frozax.com/blog/2011/12/why-how-pack-textures-ios-android/#comments</comments>
		<pubDate>Sat, 03 Dec 2011 23:57:59 +0000</pubDate>
		<dc:creator>Frozax</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Don't Feed the Trolls]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[pack]]></category>
		<category><![CDATA[texturepacker]]></category>

		<guid isPermaLink="false">http://www.frozax.com/blog/?p=879</guid>
		<description><![CDATA[Introduction When I developed Don&#8217;t Feed the Trolls on X360 (using XNA), I did not optimize the textures files of the game : the game was very simple, the final hardware (X360) is very fast, so it was not necessary. I arranged the sprites so that I could get their coordinates in-game very easily. Every [...]]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<p>When I developed <a href="http://www.frozax.com/games/dont-feed-the-trolls">Don&#8217;t Feed the Trolls</a> on X360 (using XNA), I did not optimize the textures files of the game : the game was very simple, the final hardware (X360) is very fast, so it was not necessary. I arranged the sprites so that I could get their coordinates in-game very easily. Every &#8220;troll&#8221; sprite for instance is the same size, so most of them are filled with transparent pixels. A lot of space is wasted. Have a look at the sprite sheet for the characters that I use on X360.</p>
<p><img class="aligncenter size-full wp-image-954" title="X360 Don't Feed the Trolls Characters Sprite Sheet" src="http://www.frozax.com/blog/wp-content/uploads/2011/12/ss.png" alt="X360 Don't Feed the Trolls Characters Sprite Sheet" width="400" height="200" /></p>
<p>The characters texture on X360 is 2048&#215;1024. I could easily have it into a 1024&#215;1024 but it was a lot easier if I could have all the sprites of the same kind in a row (for example, all the bear heads are on the top row). I also made a few other sprites sheets for UI, birds, tutorial for instance.</p>
<p>For the first draft of my Android port, I first concentrated on the gameplay and integrate this sprite sheet as is. Of course, I quickly realized I had to spend some time to optimize as obviously, constraints on mobile and X360 are different.</p>
<h3>Why packing your textures?</h3>
<p>Why is proper texture packing important for games, especially on mobile? Packed textures use less pixels, and from this simple fact, the game is greatly improved in many ways:</p>
<h4>Memory</h4>
<p>Less pixels takes less memory. Mobile have big memory constraints and saving memory from the ressource is great. Texture ressources are often the biggest ressources.</p>
<h4>Loading</h4>
<p>There are less files to open, and less pixels to read, this will therefore be faster to load.</p>
<h4>Runtime performance</h4>
<p>When packing your textures in atlases, more sprites will share the same texture. In runtime, the GPU will then have less textures changes to make and this will therefore speed up your game. This will improve performance if you draw the sprites using the same texture in a row.</p>
<p>It will allow you to reduce your texture sizes. Some Android devices are performing very slowly with 2048 pixels-wide textures.</p>
<h4>Game size</h4>
<p>The downloadable package size will be smaller too. This is great, especially for people using 3G or with limited bandwidth that won&#8217;t download big games.</p>
<h3>How to pack?</h3>
<p>I first thought of packing my sprites manually but quickly searched for a tool to assist me in that tedious task. There are a few tools available to automatically pack your sprites, and I am currently using <a href="http://www.texturepacker.com/">TexturePacker</a>, and I&#8217;m very happy with it (<em>please note that I got a free copy of TexturePacker from the developer</em>). It&#8217;s easy to use and has a lot of functionnalities, such as:</p>
<ul>
<li>Auto-refreshes the packed texture in the tool when I add images to my folders</li>
<li>Export in one click</li>
<li>Support cocos2d and therefore cocos2d-x which I am using (and many more formats).</li>
<li>Removes useless transparent pixels around sprites</li>
<li>Efficient packing</li>
</ul>
<p>All the features are listed <a href="http://www.texturepacker.com/features/">here</a>.</p>
<p>Here is a sample of a packed sprite sheet for the Android version of Don&#8217;t Feed the Trolls made with TexturePacker:</p>
<p><img class="aligncenter size-full wp-image-955" title="Packed sprite sheet for Don't Feed the Trolls Android/iOS" src="http://www.frozax.com/blog/wp-content/uploads/2011/12/charsbgitf.png" alt="Packed sprite sheet for Don't Feed the Trolls Android/iOS" width="200" height="200" />Instead of 2048&#215;1024, this is just 1024&#215;1024, and most importantly, I have all my characters, the UI elements, and some background elements in the same, smallest texture!</p>
<h4>Generic code</h4>
<p>I did some code so that resource loading does not have to deal with packs or single sprites. That way, I can send a version without packs to the artist and he can test his ressource live. In cocos2d-x, this is very easy. You first need to load your pack(s) with <em>CCSpriteFrameCache ::addSpriteFramesWithFile( file_name )</em>. And then, read the ressource from the file if it&#8217;s not found in the packs. I did it like this:</p>
<blockquote>
<pre>CCSprite *GetSprite(const char *file_name )
{
<span style="white-space: pre;"> </span>CCSprite *psprite = new CCSprite( );
<span style="white-space: pre;"> </span>psprite-&gt;autorelease();
<span style="white-space: pre;"> </span>// Search in the cache, first
<span style="white-space: pre;"> </span>CCSpriteFrameCache *sfc = CCSpriteFrameCache::sharedSpriteFrameCache();
<span style="white-space: pre;"> </span>CCSpriteFrame *psf = sfc-&gt;spriteFrameByName( file_name );
<span style="white-space: pre;"> </span>if( psf != NULL )
<span style="white-space: pre;"> </span>{
<span style="white-space: pre;"> </span><span style="white-space: pre;"> </span>psprite-&gt;initWithSpriteFrame( psf );
<span style="white-space: pre;"> </span><span style="white-space: pre;"> </span>return psprite;
<span style="white-space: pre;"> </span>}
<span style="white-space: pre;"> </span>CCLog("WARNING : %s not in a PACK!", file_name );
<span style="white-space: pre;"> </span>psprite-&gt;initWithFile( file_name );
<span style="white-space: pre;"> </span>return psprite;
<span style="white-space: pre;"> </span>}</pre>
</blockquote>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1051px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>sprite-&gt;autorelease();</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1051px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>// quite ugly wait to skip dlg/img directory</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1051px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>if( file_name[3] == &#8216;/&#8217; )</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1051px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1051px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>CCSpriteFrame *psf = CCSpriteFrameCache::sharedSpriteFrameCache()-&gt;spriteFrameByName( &amp;file_name[4] );</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1051px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>if( psf != NULL )</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1051px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1051px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>psprite-&gt;initWithSpriteFrame( psf );</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1051px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>return psprite;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1051px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>}</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1051px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>}</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1051px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>fgLog(&#8221;FROZAX : %s not in a PACK&#8221;, file_name );</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1051px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>psprite-&gt;initWithFile( file_name );</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1051px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>return psprite;</div>
<h3>Conclusion</h3>
<p>Packing your textures is very important on mobile platform, but hopefully, great tools make that task very easy and straighforward.</p>
<p>Do you pack your ressources? Do you do it by hand? Which tool do you use?</p>
<p>Follow me on <a href="http://twitter.com/Frozax">twitter</a>, <a href="http://www.facebook.com/frozax">facebook</a> or <a href="https://plus.google.com/117773429877335932919">google+</a> for more game development information.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.frozax.com/blog/2011/12/why-how-pack-textures-ios-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android Game Development : from Java to C++ (with cocos2d-x)</title>
		<link>http://www.frozax.com/blog/2011/11/android-game-development-java-c-cocos2d-x/</link>
		<comments>http://www.frozax.com/blog/2011/11/android-game-development-java-c-cocos2d-x/#comments</comments>
		<pubDate>Sat, 12 Nov 2011 16:30:25 +0000</pubDate>
		<dc:creator>Frozax</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Don't Feed the Trolls]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[cocos2d-x]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jni]]></category>
		<category><![CDATA[libgdx]]></category>

		<guid isPermaLink="false">http://www.frozax.com/blog/?p=915</guid>
		<description><![CDATA[Introduction In a previous post (here), I was talking about my progress with libgdx, a Java library for Android (and other platforms). Shortly after writing this article, I realized that there is a big disadvantage that I forgot to talk about. It&#8217;s so big that it made me stop using libgdx : It is not [...]]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<p>In a previous post (<a href="http://www.frozax.com/blog/2011/09/android-game-development-libgdx/">here</a>), I was talking about my progress with libgdx, a Java library for Android (and other platforms). Shortly after writing this article, I realized that there is a big disadvantage that I forgot to talk about. It&#8217;s so big that it made me stop using libgdx : <strong>It is not portable on iOS</strong>. I knew this from the beginning but didn&#8217;t really think about using anything else than Java. I finally realized that while porting from one language to another is easy, it can take a lot of time.</p>
<h3>Cocos2d-x</h3>
<p>I searched for multiplatform libraries (Android and iOS). As the game I&#8217;m porting (<a href="http://www.frozax.com/games/dont-feed-the-trolls">Don&#8217;t Feed the Trolls</a>) was developed with XNA, I looked at C# solutions. There is at least <a href="http://xamarin.com/">one but it&#8217;s too expensive</a>. I&#8217;ve been doing C++ indie/casual games in the past and I develop in C++ in my day job, so this is the obvious choice. I like the efficiency of languages such as C# or Java (easy to write and debug), but if I want to avoid porting the game another time for the iPhone, I should to use C++. There are quite some libraries in C++ (such as <a href="http://www.madewithmarmalade.com/marmalade">Marmalade</a>). I finally decided to use <a href="http://www.cocos2d-x.org/">cocos2d-x</a>. This is a C++ port of the famous <a href="http://www.cocos2d-iphone.org/">cocos2d library for iPhone</a> which is in Objective C. Cocos2d-x has an active community, some multiplatform games have been released already, it&#8217;s free and open source. All good stuff!</p>
<h3>C++ on Android</h3>
<p>I am mostly working using the Windows build of the library but I also did some work on Android. Mixing C++ and Java (using <a href="http://developer.android.com/guide/practices/design/jni.html">JNI : Java Native Interface</a>) is doable, but really not user friendly. Debugging is terrible, building is slow, you have to install tools such as cygwin, use makefiles (how old school!), and so on. It really does not seem the right solution at first. However, once everything is set up correctly, it&#8217;s working fine. Cocos2d-x has good tutorials about this. I develop with Visual C++ 2010 Express on the Windows build, I have all the great tools to debug generic problems. The only real troubles are when you have android-specific bugs in the C++ code but it&#8217;s really not frequent. And there are a few ways to debug it with gdb and gdb-server (I never had to use it yet). When you have a crash, there is a very useful tool in the NDK called addr2line (<a href="http://stackoverflow.com/questions/5314036/how-to-use-addr2line-in-android">here&#8217;s how to use it</a>) that allows you to get the callstack. It&#8217;s usually enough to understand and fix the bug. You also can still use old-school debugging techniques such as logging to the output <img src='http://www.frozax.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Hopefully, most of my bugs are multiplatform, or in Java code, so I can fix them easily.</p>
<h3>Java is still needed</h3>
<p>To develop Android-specific code, you still need Java. For example, I use Java for AdMob integration, In-App Purchases or the Facebook SDK for instance. Setting up Java functions called from C++ is not very intuitive, so I opted for a very simple and centralized way: I have one Java function that can be called from C++ with two String parameters. In the Java code, I read these parameters that contains all I need to know to call the specific Java code.</p>
<h3>Conclusion</h3>
<p>Even though libgdx is really a great lib, after a few weeks working on C++, I&#8217;m confident that I made the right choice with cocos2d-x. I did not start developing on iPhone already but it should be quite fast compared to porting Java to C++ (or worse, Objective-C!). I have a working Android version of my game and the performances seems good.</p>
<p>Which language do you use to build your multiplatform mobile games? Do you know other good C++ solutions? Feel free to comment!</p>
<p>Follow me on <a href="http://twitter.com/Frozax">twitter</a>, <a href="http://www.facebook.com/frozax">facebook</a> or <a href="https://plus.google.com/117773429877335932919">google+</a> for more game development information.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.frozax.com/blog/2011/11/android-game-development-java-c-cocos2d-x/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t Feed the Trolls Sales Stats (Xbox Live Indie Game)</title>
		<link>http://www.frozax.com/blog/2011/10/feed-trolls-sales-stats-xbox-live-indie-game/</link>
		<comments>http://www.frozax.com/blog/2011/10/feed-trolls-sales-stats-xbox-live-indie-game/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 16:10:06 +0000</pubDate>
		<dc:creator>Frozax</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.frozax.com/blog/?p=884</guid>
		<description><![CDATA[Don&#8217;t Feed the Trolls (try it!) was released on September, 23rd, it&#8217;s now time to look at the sales numbers. As of today, I sold 207 copies of the game. The sales are better than my first XBL Indie Game (Spring Up Harmony, stats here). However, Spring Up Harmony was initially sold 240 MS Points, [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;"><a href="http://www.frozax.com/games/dont-feed-the-trolls">Don&#8217;t Feed the Trolls</a> (<a href="http://marketplace.xbox.com/Product/Dont-Feed-the-Trolls/66acd000-77fe-1000-9115-d8025855097a">try it!</a>) was released on September, 23rd, it&#8217;s now time to look at the sales numbers. As of today, I sold <strong><em>207</em></strong> copies of the game.</p>
<p style="text-align: left;"><img class="size-full wp-image-893   aligncenter" title="don't feed the trolls sales per day" src="http://www.frozax.com/blog/wp-content/uploads/2011/10/dftt_spd.png" alt="don't feed the trolls sales per day" width="421" height="271" /></p>
<p style="text-align: left;">The sales are better than my first XBL Indie Game (<a href="http://www.frozax.com/games/spring-up-harmony">Spring Up Harmony</a>, <a href="http://www.frozax.com/blog/2010/08/spring-harmony-postmortem/">stats here</a>). However, Spring Up Harmony was initially sold 240 MS Points, and Don&#8217;t Feed the Trolls is sold 80 MS Points. Don&#8217;t Feed the Trolls was also faster to develop, but art costs were similar to Spring Up Harmony ($500). I need about 750 sales to recover all my costs. I don&#8217;t think I will reach this threshold.</p>
<p style="text-align: left;"><img class="aligncenter size-full wp-image-894" title="Don't feed the trolls Sales per Country" src="http://www.frozax.com/blog/wp-content/uploads/2011/10/dftt_spc.png" alt="Don't feed the trolls Sales per Country" width="422" height="269" /></p>
<p>I could recover Spring Up Harmony&#8217;s costs with the PC version of the game (especially with the <a href="http://www.frozax.com/blog/2011/07/5-5-bundle-spring-up-harmony-statistics/">5 For $5 Bundle</a>). I hope to do the same with Don&#8217;t Feed the Trolls, and I&#8217;m porting it right now on Android (and probably iPhone later). I think the game is too simple to be sold of PC, but mobile phones are great for this kind of game.</p>
<p>As commonly reported by indie developers, I also don&#8217;t find the XBLIG platform very lucrative (<a href="http://www.joystiq.com/2011/08/11/fortresscraft-makes-a-million-on-xblig/">but it can be</a>).</p>
<p>Feel free to comment about the game the sales statistics or your own experience. You can also find out more about us on <a href="http://twitter.com/frozax">twitter</a>, <a href="http://www.facebook.com/frozax">facebook</a> or <a href="http://plus.google.com/115825125240096966280">g+</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.frozax.com/blog/2011/10/feed-trolls-sales-stats-xbox-live-indie-game/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android Game Development with libGDX</title>
		<link>http://www.frozax.com/blog/2011/09/android-game-development-libgdx/</link>
		<comments>http://www.frozax.com/blog/2011/09/android-game-development-libgdx/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 19:52:00 +0000</pubDate>
		<dc:creator>Frozax</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Don't Feed the Trolls]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[libgdx]]></category>
		<category><![CDATA[porting]]></category>

		<guid isPermaLink="false">http://www.frozax.com/blog/?p=816</guid>
		<description><![CDATA[After selling games on PC, Mac and Xbox 360, I want to develop games on mobile plaforms, and I will start with Android. I chose Android instead of iPhone for two reasons: It&#8217;s cheaper: my Mac is a PowerPC and you need a Mac Intel for iPhone development. Also Android phones are cheaper than iPhones. [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-841  alignright" title="android" src="http://www.frozax.com/blog/wp-content/uploads/2011/09/android_small.png" alt="android" width="72" height="84" />After selling games on <a href="http://www.frozax.com/pc_games.php">PC</a>, <a href="http://www.frozax.com/mac_games.php">Mac</a> and <a href="http://www.frozax.com/x360">Xbox 360</a>, I want to develop games on mobile plaforms, and I will start with Android. I chose Android instead of iPhone for two reasons:</p>
<ul>
<li>It&#8217;s cheaper: my Mac is a PowerPC and you need a Mac Intel for iPhone development. Also Android phones are cheaper than iPhones.</li>
<li>Java is similar to C# : I have C# games ready to be ported to mobile. As Android uses Java, it&#8217;s a great platform for me to port those games.</li>
</ul>
<p>My last X360 game, <a href="http://www.frozax.com/games/dont-feed-the-trolls">Don&#8217;t Feed the Trolls</a> is a great fit for mobile: quick gameplay sessions and not requiring too much processing power or memory. I therefore decided to port it to Android.</p>
<p><img class="alignright size-full wp-image-844" title="libgdx" src="http://www.frozax.com/blog/wp-content/uploads/2011/09/libgdx.png" alt="libgdx" width="235" height="51" />I started to look for available 2D game libraries on Android and after hesitating between <a href="http://www.andengine.org/">AndEngine</a> and <a href="http://code.google.com/p/libgdx/">libGDX</a>, I chose libGDX. I will describe here some features and my thoughts about this library.</p>
<h2>What I like</h2>
<h3>Complete API</h3>
<p>It&#8217;s a <a href="http://libgdx.l33tlabs.org/docs/api/overview-summary.html">simple but complete API</a>. We often see libraries with only rendering support, but with libGDX, you can do rendering (2D and 3D), audio, file management and input (touchscreens). There are also a few useful utility classes and tools (more on this below).</p>
<h3>Box2D</h3>
<p><img class="alignright size-full wp-image-869" title="box2d" src="http://www.frozax.com/blog/wp-content/uploads/2011/09/box2d.gif" alt="box2d" width="86" height="76" />There is also a port of <a href="http://www.box2d.org">Box2D</a>, the physics library used in <a href="http://www.frozax.com/games/spring-up-harmony">Spring Up Harmony (PC, X360)</a>. If I ever want to port Spring Up Harmony to Android (probably), the physics part should be easily portable.</p>
<h3>Open Source</h3>
<p>I like to have access to the source code of libraries I use. I find it reassuring and when debugging, it&#8217;s good to be able to step into libraries source code.</p>
<h3>Activity</h3>
<p><img class="alignright size-full wp-image-854" title="activity" src="http://www.frozax.com/blog/wp-content/uploads/2011/09/activity.png" alt="activity" width="106" height="20" />There is currently quite <a href="http://www.ohloh.net/p/libgdx">a lot of updates</a> and bug fixes, by the creator of the lib (<a href="http://www.badlogicgames.com/wordpress/?page_id=2">Mario Zechner</a>) and by community.</p>
<h3>Bitmap Fonts</h3>
<p><img class="alignright size-full wp-image-857" title="font_small_crop" src="http://www.frozax.com/blog/wp-content/uploads/2011/09/font_small_crop.png" alt="font_small_crop" width="82" height="53" />There is a tool available to create bitmap fonts. This is very similar to the tool I used on XNA (<a href="http://www.nubik.com/SpriteFont/">SpriteFont2 Texture Tool</a>) so porting my existing code was very easy.</p>
<h3>Desktop Version</h3>
<p>If you ever used the <a href="http://developer.android.com/guide/developing/tools/emulator.html">Android Emulator</a> of the SDK, you are probably aware that it&#8217;s terribly slow and not really usable. I didn&#8217;t buy my Android Device yet, but can still work on the game and test it properly because libgdx also compiles for desktop java.</p>
<div id="attachment_848" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.frozax.com/blog/wp-content/uploads/2011/09/dftt_android.png"><img class="size-medium wp-image-848" title="Don't Feed the Trolls for Android running with the Desktop version in libGDX" src="http://www.frozax.com/blog/wp-content/uploads/2011/09/dftt_android-300x188.png" alt="Don't Feed the Trolls for Android running with the Desktop version in libGDX" width="300" height="188" /></a><p class="wp-caption-text">Don&#39;t Feed the Trolls for Android running with the Desktop version of libGDX</p></div>
<h3>Texture Packer</h3>
<p>This is another great tool, used to pack many textures in one. I usually don&#8217;t care much about texture size and texture memory waste when developing on X360 but this is important on mobile devices due to their limitations. Some features of this tool:</p>
<ul>
<li>Grouping small textures in textures pages (power of two).</li>
<li>Strip transparent pixels on the borders of textures. This required quite some tweaks and update in my own fgDrawSprite class and rendering functions to manage properly, but this is really a great way to save memory and disk space.</li>
<li>Has an incremental option to avoid generating everything when updating only some resources.</li>
<li>Can be called from the game itself in the desktop version. A good practice is to automatically call the packer in the desktop version, and use the generated assets in both Desktop and Android.</li>
</ul>
<p>This is really a time saver tool.</p>
<h2>What I don&#8217;t like</h2>
<h3>Lack of documentation</h3>
<p>There is no good and centralized documentation. You need to look for information on the forums, in the source code and/or on blog articles. Due to the activity of the library, I sometimes find out that I&#8217;m using old stuff that is not supposed to be used, because it&#8217;s deprecated and has been replaced by something else. The parameters of some API functions are not always properly documented too. For instance, I had trouble using a rendering function and found out that the <em>rotation </em>parameter was an angle in degrees (it&#8217;s usually in radians in the libraries I used before).</p>
<h3>Reverted Y-Axis</h3>
<p><img class="alignright size-full wp-image-863" title="coords" src="http://www.frozax.com/blog/wp-content/uploads/2011/09/coords.png" alt="coords" width="108" height="99" />I found this very strange but in all the 2D APIs I used, the coordinate system used the point (0,0) as the top-left corner, with X going right and Y going down. In libgdx, the Y axis is going up, and the 0,0 is bottom-left. I had to change some rendering functions to take this into account.</p>
<h3>Android Specific</h3>
<p>Doing Android specific code is not very clean because the lib is supposed to work on desktop and Android. I guess this is also because of Java, and I wished we could have some preprocessing to condition Android specific code. There are many workarounds, because the Android application overloads the Desktop application. So you can create empty methods on Desktop that are overloaded only in the Android project with Android specific code. I hope this won&#8217;t get too messy when I&#8217;ll work on very specific and touchy stuff such as <a href="http://developer.android.com/guide/market/billing/billing_overview.html">in-app purchases</a>.</p>
<h2>What I don&#8217;t know</h2>
<h3>Performance</h3>
<p>I don&#8217;t own an Android device yet and did not test other API, so I can&#8217;t really talk about the performance of the API. According to users, it is faster than most other APIs.</p>
<h2>Conclusion</h2>
<p>Using libGDX is a good and easy way to start developing Android games. For now, I&#8217;m happy with this library and you can see on the screenshot above that development is going well. I will probably release a few games with it.</p>
<p>If you tested different Android libs or have anything to add, feel free to comment about it.</p>
<p>You can find out more about Frozax Games or me on <a href="http://twitter.com/frozax">twitter</a>, <a href="http://www.facebook.com/frozax">facebook</a> or <a href="http://plus.google.com/115825125240096966280">g+</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.frozax.com/blog/2011/09/android-game-development-libgdx/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t Feed the Trolls available on Xbox Live Indie Games!</title>
		<link>http://www.frozax.com/blog/2011/09/dont-feed-the-trolls-available-xbox-live-indie-games/</link>
		<comments>http://www.frozax.com/blog/2011/09/dont-feed-the-trolls-available-xbox-live-indie-games/#comments</comments>
		<pubDate>Fri, 23 Sep 2011 21:22:59 +0000</pubDate>
		<dc:creator>Frozax</dc:creator>
				<category><![CDATA[Don't Feed the Trolls]]></category>
		<category><![CDATA[Screenshots / Videos]]></category>
		<category><![CDATA[XNA]]></category>
		<category><![CDATA[Xbox 360]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[trailer]]></category>
		<category><![CDATA[xbox]]></category>

		<guid isPermaLink="false">http://www.frozax.com/blog/?p=827</guid>
		<description><![CDATA[I am proud to tell you that my last game Don&#8217;t Feed the Trolls is now live on the XBLIG market. Here is the trailer: Please download the game on the marketplace and tell me what you think about it! As usual, I&#8217;ll post sales figures in a few weeks/months for the curious. Have fun [...]]]></description>
			<content:encoded><![CDATA[<p>I am proud to tell you that my last game <a href="http://www.frozax.com/games/dont-feed-the-trolls">Don&#8217;t Feed the Trolls</a> is now live on the XBLIG market. Here is the trailer:<br />
<iframe frameborder="0" height="360" src="http://www.youtube.com/embed/P8l5claEudg?rel=0" width="640"></iframe></p>
<p>Please download the game <a href="http://marketplace.xbox.com/Product/Dont-Feed-the-Trolls/66acd000-77fe-1000-9115-d8025855097a">on the marketplace</a> and tell me what you think about it!</p>
<p>As usual, I&#8217;ll post sales figures in a few weeks/months for the curious.</p>
<p>Have fun slapping trolls!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.frozax.com/blog/2011/09/dont-feed-the-trolls-available-xbox-live-indie-games/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>5 for $5 Bundle and Spring Up Harmony Statistics</title>
		<link>http://www.frozax.com/blog/2011/07/5-5-bundle-spring-up-harmony-statistics/</link>
		<comments>http://www.frozax.com/blog/2011/07/5-5-bundle-spring-up-harmony-statistics/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 21:30:43 +0000</pubDate>
		<dc:creator>Frozax</dc:creator>
				<category><![CDATA[postmortem]]></category>
		<category><![CDATA[sales statistics]]></category>
		<category><![CDATA[spring up harmony]]></category>
		<category><![CDATA[bundle]]></category>
		<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://www.frozax.com/blog/?p=787</guid>
		<description><![CDATA[As you probably know, Spring Up Harmony was in the 5 For $5 Bundle (also called buygamesnotsocks). You can read a full postmortem of the bundle on Jorge Rodriguez&#8217; blog. With data gathered from my leaderboards, I made a few statistics (I love stats ). Though the bundle sold 3,642 copies, I have (only) 1,139 &#8220;bundle [...]]]></description>
			<content:encoded><![CDATA[<p>As you probably know, <a href="http://www.frozax.com/games/spring-up-harmony">Spring Up Harmony</a> was in the <a href="http://buygamesnotsocks.com">5 For $5 Bundle</a> (also called buygamesnotsocks). You can read a <a href="http://bsvino.tumblr.com/post/7222387915/5-for-5-bundle-postmortem">full postmortem of the bundle on Jorge Rodriguez&#8217; blog</a>. With data gathered from my <a href="http://www.frozax.com/games/spring-up-harmony/hiscores">leaderboards</a>, I made a few statistics (<a href="http://www.frozax.com/blog/2011/06/achievements-rewards-statistics-spring-up-harmony/">I love stats</a> <img src='http://www.frozax.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ). Though the bundle sold 3,642 copies, I have (only) 1,139 &#8220;bundle players&#8221; on the leaderboards, but new bundle players are still appearing every day.</p>
<p>I will show you four graphs.</p>
<h3>Levels completed per day</h3>
<p>The first graph is showing the <strong>levels completed per day</strong>. Note that the bundle went out on June, 22th, and ended on July, 3rd.</p>
<p><a href="http://www.frozax.com/blog/wp-content/uploads/2011/07/graph1.png"><img class="aligncenter size-full wp-image-789" title="graph1" src="http://www.frozax.com/blog/wp-content/uploads/2011/07/graph1.png" alt="graph1" width="558" height="313" /></a></p>
<p>The days are based on GMT, therefore, on the graph the bundle went live at 6pm. The first full day is June, 23rd. Today, I still have about 4 to 5 times more players than before the bundle.</p>
<h3>Activity of the game depending on the time of day</h3>
<p>The second graph shows the <strong>activity of the game depending on the time of day</strong>.</p>
<p><a href="http://www.frozax.com/blog/wp-content/uploads/2011/07/graph2.png"><img class="aligncenter size-full wp-image-790" title="graph2" src="http://www.frozax.com/blog/wp-content/uploads/2011/07/graph2.png" alt="graph2" width="564" height="328" /></a></p>
<p>This time, I converted the graph to be based on Pacific Standard Time (USA West Coast). I didn&#8217;t put numbers on the vertical axis because it&#8217;s just meant to show variation of players throughout the day.</p>
<h3>Nationality of the players</h3>
<p>The third graph shows the <strong>nationality of the players</strong>.</p>
<p><a href="http://www.frozax.com/blog/wp-content/uploads/2011/07/graph3.png"><img class="aligncenter size-full wp-image-791" title="graph3" src="http://www.frozax.com/blog/wp-content/uploads/2011/07/graph3.png" alt="graph3" width="466" height="303" /></a></p>
<p>The results are not really a surprise, especially since the bundle was in English and news sites writing about the bundle were mostly all american websites. There are players from <strong>47 different countries</strong>.</p>
<h3>Number of levels completed per player</h3>
<p>This fourth graph shows the <strong>number of levels completed per player</strong>. The game has 35 levels.</p>
<p><a href="http://www.frozax.com/blog/wp-content/uploads/2011/07/graph41.png"><img class="aligncenter size-full wp-image-802" title="graph4" src="http://www.frozax.com/blog/wp-content/uploads/2011/07/graph41.png" alt="graph4" width="540" height="334" /></a></p>
<p>I&#8217;m happy that many players completed the game. I tried to find a reason to the spike of players doing 9 levels but could not find any. I don&#8217;t think the 10th level is that terrible <img src='http://www.frozax.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<h3>Conclusion</h3>
<p>I am really happy that this bundle gave the opportunity to people to play Spring Up Harmony. Many players would never have heard of it without the bundle. And I also think some players bought the bundle because of some other games but took the time to try them all.</p>
<p>I&#8217;ll use this article to thank to all the great developers involved in the bundle, and especially Jorge who organized it very well!</p>
<p>Feel free to comment, and follow me on <a href="twitter.com/Frozax">twitter</a>, <a href="http://www.facebook.com/pages/Frozax-Games/93984111894">facebook</a> or <a href="gplus.to/francoisguibert">google+</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.frozax.com/blog/2011/07/5-5-bundle-spring-up-harmony-statistics/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>5 For $5 Bundle is LIVE!</title>
		<link>http://www.frozax.com/blog/2011/06/5-for-5-bundle-is-live/</link>
		<comments>http://www.frozax.com/blog/2011/06/5-for-5-bundle-is-live/#comments</comments>
		<pubDate>Wed, 22 Jun 2011 18:32:38 +0000</pubDate>
		<dc:creator>Frozax</dc:creator>
				<category><![CDATA[Marketing]]></category>
		<category><![CDATA[spring up harmony]]></category>
		<category><![CDATA[5 for 5 bundle]]></category>
		<category><![CDATA[bundle]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.frozax.com/blog/?p=757</guid>
		<description><![CDATA[Today, four indie game developers and Frozax Games launched a new bundle : 5 Games for $5, check out the trailer: The games are: Delve Deeper by Lunar Giant Digitanks by Lunar Workshop Mactabilis by Blazing Bit Games Spring Up Harmony by Frozax Games Steel Storm : Burning Retribution by Kot-In-Action These are all great [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.buygamesnotsocks.com/"><img style="display: block; margin-left: auto; margin-right: auto; border: 0px initial initial;" title="logo" src="http://www.frozax.com/blog/wp-content/uploads/2011/06/logo.png" alt="logo" width="479" height="235" /></a></p>
<p>Today, four indie game developers and Frozax Games launched a new bundle : <a href="http://www.buygamesnotsocks.com/">5 Games for $5</a>, check out the trailer:</p>
<p><object width="640" height="390"><param name="movie" value="http://www.youtube.com/v/bcNAT_V1fmA?version=3&amp;hl=fr_FR&amp;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/bcNAT_V1fmA?version=3&amp;hl=fr_FR&amp;rel=0" type="application/x-shockwave-flash" width="640" height="390" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>The games are:</p>
<ul>
<li><a href="http://delve-deeper.com/">Delve Deeper</a> by <em>Lunar Giant</em></li>
<li><a href="http://www.digitanks.com/">Digitanks</a> by <em>Lunar Workshop</em></li>
<li><a href="http://www.blazingbitgames.com/en/mactabilis/">Mactabilis</a> by <em>Blazing Bit Games</em></li>
<li><a href="http://www.frozax.com/games/spring-up-harmony">Spring Up Harmony</a> by <em>Frozax Games</em></li>
<li><a href="http://www.steel-storm.com/">Steel Storm : Burning Retribution</a> by <em>Kot-In-Action</em></li>
</ul>
<p>These are all great games, try them now and support indie developers! The website is <a href="http://www.buygamesnotsocks.com/">here</a> and you can <a href="https://sites.fastspring.com/lunarworkshop/instant/5gamesbundle">buy a bundle here</a>!</p>
<p>Please spread the great news on <a href="http://twitter.com/home?status=Check%20out%20this%205%20for%20$5%20Indie%20Games%20Bundle!%20http://www.buygamesnotsocks.com%20%235games">twitter</a> and <a href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.buygamesnotsocks.com">facebook</a>!</p>
<p><a href="http://www.frozax.com/blog/wp-content/uploads/2011/06/logo.png"></a></p>
<div><span style="color: #0000ee; -webkit-text-decorations-in-effect: underline;"><br />
</span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.frozax.com/blog/2011/06/5-for-5-bundle-is-live/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Achievements/Rewards statistics for Spring Up Harmony</title>
		<link>http://www.frozax.com/blog/2011/06/achievements-rewards-statistics-spring-up-harmony/</link>
		<comments>http://www.frozax.com/blog/2011/06/achievements-rewards-statistics-spring-up-harmony/#comments</comments>
		<pubDate>Sun, 12 Jun 2011 18:21:51 +0000</pubDate>
		<dc:creator>Frozax</dc:creator>
				<category><![CDATA[Game Design]]></category>
		<category><![CDATA[postmortem]]></category>
		<category><![CDATA[spring up harmony]]></category>
		<category><![CDATA[achievements]]></category>
		<category><![CDATA[rewards]]></category>
		<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://www.frozax.com/blog/?p=702</guid>
		<description><![CDATA[Spring Up Harmony PC was released a few months ago, it&#8217;s now a good time to study statistics of the rewards (or achievements) of the game. Rewards are a good way to see what the players are really doing in the game. These are the stats of online players that played the full version of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.frozax.com/games/spring-up-harmony">Spring Up Harmony PC</a> was released a few months ago, it&#8217;s now a good time to study statistics of the rewards (or achievements) of the game. Rewards are a good way to see what the players are really doing in the game.</p>
<p>These are the stats of <em>online</em> players that played the<em> full version</em> of the game. To have more data, I also used data from <a href="http://www.frozax.com/blog/2011/03/piracy-stats-spring-up-harmony-pc-game/"><em>pirate players</em></a>. Pirate players do not appear in the <a href="http://www.frozax.com/games/spring-up-harmony/hiscores">leaderboards</a>, but I still log their achievements. I consider a player has the full version (legally or not) when he has played a level not included in the demo.</p>
<p>I sorted the achievements according to the percentage of players having it.</p>
<div class="achimg"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach1.png" alt="beginning" width="64" height="64" /></div>
<div class="achtextholder">
<div class="achfill"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar.png" alt="" width="550px" height="60px" /><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar_empty.png" alt="" width="0px" height="60px" /></div>
<div class="achtxt">
<h4>Beginning</h4>
<h5>Complete the first level of the game.</h5>
</div>
<div class="achpct">100%</div>
</div>
<div class="achimg"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach2.png" alt="beginning" width="64" height="64" /></div>
<div class="achtextholder">
<div class="achfill"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar.png" alt="" width="550px" height="60px" /><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar_empty.png" alt="" width="0px" height="60px" /></div>
<div class="achtxt">
<h4>Two in One</h4>
<h5>You hit two Harmony objects in one shot.</h5>
</div>
<div class="achpct">100%</div>
</div>
<div class="achimg"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach3.png" alt="" width="64" height="64" /></div>
<div class="achtextholder">
<div class="achfill"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar.png" alt="" width="548px" height="60px" /><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar_empty.png" alt="" width="2px" height="60px" /></div>
<div class="achtxt">
<h4>Five</h4>
<h5>You completed five levels.</h5>
</div>
<div class="achpct">99.8%</div>
</div>
<div class="achimg"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach4.png" alt="" width="64" height="64" /></div>
<div class="achtextholder">
<div class="achfill"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar.png" alt="" width="457px" height="60px" /><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar_empty.png" alt="" width="93px" height="60px" /></div>
<div class="achtxt">
<h4>All Clean</h4>
<h5>You removed all the objects of a level.</h5>
</div>
<div class="achpct">83.0%</div>
</div>
<div class="achimg"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach5.png" alt="" width="64" height="64" /></div>
<div class="achtextholder">
<div class="achfill"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar.png" alt="" width="454px" height="60px" /><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar_empty.png" alt="" width="96px" height="60px" /></div>
<div class="achtxt">
<h4>Bronze Medal</h4>
<h5>Your global score is 500,000 points.</h5>
</div>
<div class="achpct">82.6%</div>
</div>
<div class="achimg"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach6.png" alt="" width="64" height="64" /></div>
<div class="achtextholder">
<div class="achfill"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar.png" alt="" width="358px" height="60px" /><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar_empty.png" alt="" width="192px" height="60px" /></div>
<div class="achtxt">
<h4>Just in Time</h4>
<h5>You completed a level with less than ten seconds left.</h5>
</div>
<div class="achpct">65.1%</div>
</div>
<div class="achimg"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach7.png" alt="" width="64" height="64" /></div>
<div class="achtextholder">
<div class="achfill"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar.png" alt="" width="305px" height="60px" /><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar_empty.png" alt="" width="245px" height="60px" /></div>
<div class="achtxt">
<h4>Catcher</h4>
<h5>You caught 500 objects with the bucket.</h5>
</div>
<div class="achpct">55.4%</div>
</div>
<div class="achimg"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach8.png" alt="" width="64" height="64" /></div>
<div class="achtextholder">
<div class="achfill"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar.png" alt="" width="261px" height="60px" /><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar_empty.png" alt="" width="289px" height="60px" /></div>
<div class="achtxt">
<h4>Silver Medal</h4>
<h5>Your global score is 1 million points.</h5>
</div>
<div class="achpct">47.5%</div>
</div>
<div class="achimg"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach9.png" alt="" width="64" height="64" /></div>
<div class="achtextholder">
<div class="achfill"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar.png" alt="" width="209px" height="60px" /><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar_empty.png" alt="" width="341px" height="60px" /></div>
<div class="achtxt">
<h4>Fast</h4>
<h5>You completed a level with seven shots or less.</h5>
</div>
<div class="achpct">38.0%</div>
</div>
<div class="achimg"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach10.png" alt="" width="64" height="64" /></div>
<div class="achtextholder">
<div class="achfill"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar.png" alt="" width="194px" height="60px" /><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar_empty.png" alt="" width="356px" height="60px" /></div>
<div class="achtxt">
<h4>Shooter</h4>
<h5>You shot 500 balls.</h5>
</div>
<div class="achpct">35.4%</div>
</div>
<div class="achimg"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach11.png" alt="" width="64" height="64" /></div>
<div class="achtextholder">
<div class="achfill"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar.png" alt="" width="109px" height="60px" /><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar_empty.png" alt="" width="441px" height="60px" /></div>
<div class="achtxt">
<h4>The End</h4>
<h5>You completed all the single player levels.</h5>
</div>
<div class="achpct">19.9%</div>
</div>
<div class="achimg"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach12.png" alt="" width="64" height="64" /></div>
<div class="achtextholder">
<div class="achfill"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar.png" alt="" width="99px" height="60px" /><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar_empty.png" alt="" width="451px" height="60px" /></div>
<div class="achtxt">
<h4>Gold Medal</h4>
<h5>Your global score is 2 million points.</h5>
</div>
<div class="achpct">17.9%</div>
</div>
<div class="achimg"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach13.png" alt="" width="64" height="64" /></div>
<div class="achtextholder">
<div class="achfill"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar.png" alt="" width="91px" height="60px" /><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar_empty.png" alt="" width="459px" height="60px" /></div>
<div class="achtxt">
<h4>Top Scorer</h4>
<h5>You scored 200,000 points in one level.</h5>
</div>
<div class="achpct">16.5%</div>
</div>
<div class="achimg"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach14.png" alt="" width="64" height="64" /></div>
<div class="achtextholder">
<div class="achfill"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar.png" alt="" width="16px" height="60px" /><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar_empty.png" alt="" width="534px" height="60px" /></div>
<div class="achtxt">
<h4>Addict</h4>
<h5>You played for 5 hours.</h5>
</div>
<div class="achpct">2.9%</div>
</div>
<div class="achimg"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach15.png" alt="" width="64" height="64" /></div>
<div class="achtextholder">
<div class="achfill"><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar.png" alt="" width="7px" height="60px" /><img src="http://www.frozax.com/blog/wp-content/uploads/2011/06/ach_bar_empty.png" alt="" width="543px" height="60px" /></div>
<div class="achtxt">
<h4>Multiplayer</h4>
<h5>You played ten multiplayer games.</h5>
</div>
<div class="achpct">1.2%</div>
</div>
<p>Another stat not shown above is that no player have all achievements.</p>
<p>The main thing to learn from these stats is that I probably spent to much time implementing the multi-player mode. It was not that long to develop but more levels would have been better. It&#8217;s probably because it&#8217;s only multi-player on the same screen and not online. The achievement &#8220;Two In One&#8221; seems too easy. Maybe it should have been &#8220;Three in One&#8221;.</p>
<p>Players, do you like achievements?<br />
Developers, do you also log the achievements of your players?</p>
<p>Feel free to comment and follow me on <a href="http://twitter.com/Frozax">twitter</a> and <a href="http://www.facebook.com/pages/Frozax-Games/93984111894">facebook</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.frozax.com/blog/2011/06/achievements-rewards-statistics-spring-up-harmony/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Useful C# and Visual Studio tips you might not know</title>
		<link>http://www.frozax.com/blog/2011/05/useful-c-visual-studio-tips/</link>
		<comments>http://www.frozax.com/blog/2011/05/useful-c-visual-studio-tips/#comments</comments>
		<pubDate>Tue, 31 May 2011 20:36:51 +0000</pubDate>
		<dc:creator>Frozax</dc:creator>
				<category><![CDATA[XNA]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[??]]></category>
		<category><![CDATA[add as link]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tostring]]></category>
		<category><![CDATA[visual]]></category>
		<category><![CDATA[[] operator]]></category>

		<guid isPermaLink="false">http://www.frozax.com/blog/?p=222</guid>
		<description><![CDATA[While working on my next game, I tried to keep notes of interesting tips I used. They are related to C# and Visual Studio. Overriding ToString() When debugging or prototyping, you often need to display complex objects on the screen on in the debugger output. A handy way to do this when dealing with complex [...]]]></description>
			<content:encoded><![CDATA[<p>While working on my next game, I tried to keep notes of interesting tips I used. They are related to C# and Visual Studio.</p>
<h3>Overriding ToString()</h3>
<p>When debugging or prototyping, you often need to display complex objects on the screen on in the debugger output. A handy way to do this when dealing with complex classes is to override the <a href="http://msdn.microsoft.com/en-us/library/system.object.tostring.aspx">ToString() member</a>. Here is an example:</p>
<blockquote>
<pre>class ComplexClass
{
   int _number = 0;
<span style="white-space: pre;">   </span>string _string = "My String";

   public ComplexClass( int n, string s )
   {
<span style="white-space: pre;">      </span>_number = n;
<span style="white-space: pre;">      </span>_string = s;
   }

   public override string ToString()
   {
<span style="white-space: pre;">      </span>return String.Format( "{0} / {1}", _number, _string );
   }
}</pre>
</blockquote>
<p>ToString() is also used by the debugger in the Watch dialog.</p>
<h3>?? operator</h3>
<p>I discovered the <a href="http://msdn.microsoft.com/en-us/library/ms173224.aspx">?? operator</a> a few months ago. I don&#8217;t use it much but could be useful in some cases. It allows you to replace the following code:</p>
<blockquote>
<pre>if( a != null )
   b = a;
else
   b = c;</pre>
</blockquote>
<p>by</p>
<blockquote>
<pre>b = a ?? c;</pre>
</blockquote>
<h3>New class template</h3>
<p>When you create a new class (using the right-click on the project, Add, New Item&#8230;), the file created is not empty but already has a template and a few <em>using</em> statements. You can edit this template easily. For instance, I added a &#8220;<em>using fg;</em>&#8221; with my own game library to this template. The template is found in the Visual Studio directory: <strong>{Program Files}\Microsoft Visual Studio 10.0\Common7\IDE\VCSExpress\ItemTemplatesCache\1033\class.zip</strong>. There are templates for anything and you will probably want to edit a few of them.</p>
<h3>new does not always allocates</h3>
<p>In C#, even when using the new operator, you might not allocate memory. For instance, the following line:</p>
<blockquote>
<pre>Vector2 point = new Vector2( 10, 20 );</pre>
</blockquote>
<p>does not allocate memory, because <em>Vector2 </em>is not a class, but a structure. The rule is as simple as that: a class allocates memory (and returns a pointer) and a struct does not allocate memory. It&#8217;s simple, but often misunderstood, especially if you come from C++.</p>
<h3>Add As Link source file</h3>
<p>Recently, I re-used source files from a previous project for a new one. I used the <em>Add Existing Item</em> option but Visual C# creates a copy of the source file in the current project directory instead of referencing the old file. I want to reference the old file so that it can be modified in both projects. To avoid that, you must select the hidden <em>Add As Link</em> option, by clicking the small arrow next to the <em>Add</em> button of the dialog box.</p>
<p><a href="http://www.frozax.com/blog/wp-content/uploads/2011/05/add_as_link.png"><img class="size-full wp-image-678   alignnone" title="add_as_link" src="http://www.frozax.com/blog/wp-content/uploads/2011/05/add_as_link.png" alt="add_as_link" width="138" height="88" /></a></p>
<h3>Overloading the [] operator</h3>
<p>I often have objects containing a list of items. For instance, in <a href="http://www.frozax.com/games/spring-up-harmony">Spring Up Harmony</a>, I have a <em>Ball</em> Manager used to manage and draw the balls. I found it very handy to overload the <em>[] operator</em> to access elements of the list inside the manager from the outside directly.</p>
<blockquote>
<pre>List&lt;Ball&gt; _balls = new List&lt;Ball&gt;();
public int Count { get { return _balls.Count; } }
public Ball this[int i] { get { return _balls[i]; } }</pre>
</blockquote>
<h3>That&#8217;s it!</h3>
<p>I hope you found some of the tips useful!</p>
<p>Feel free to share more tips in the comments!</p>
<p>Follow me on <a href="http://twitter.com/Frozax">twitter</a> or <a href="http://www.facebook.com/pages/Frozax-Games/93984111894">facebook</a> to get notified of new posts.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.frozax.com/blog/2011/05/useful-c-visual-studio-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
