<?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>Infectious Entertainment</title>
	<atom:link href="http://www.infectentertainment.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.infectentertainment.com</link>
	<description>Android, Games &#38; More</description>
	<lastBuildDate>Thu, 22 Jul 2010 15:30:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Dead End Released!</title>
		<link>http://www.infectentertainment.com/2010/07/22/dead-end-released/</link>
		<comments>http://www.infectentertainment.com/2010/07/22/dead-end-released/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 13:21:16 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Dead End]]></category>

		<guid isPermaLink="false">http://www.infectentertainment.com/?p=48</guid>
		<description><![CDATA[I&#8217;m proud to announce the release of Infectious Entertainment&#8217;s first Android game, Dead End. Zombies have killed your family, eaten<a href="http://www.infectentertainment.com/2010/07/22/dead-end-released/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m proud to announce the release of Infectious Entertainment&#8217;s first Android game, Dead End.</p>
<p>Zombies have killed your family, eaten your neighbors and destroyed your city. Blinded by rage and seeking revenge, you go to the one place you know you&#8217;ll be able to find the undead&#8230;&#8230;the graveyard. Armed with only a pistol and several grenades, you quickly get yourself lost. Now you must fight your way out of the graveyard or risk meeting the same fate as everyone else.</p>
<p>Dead End is a top-down defense shooter. Defend your position against the oncoming hordes of undead.</p>
<p>The full game is $2.99 and features:<br />
- 20 Different Levels<br />
- 20+ Upgradable Weapons and Grenades<br />
- 9 Zombie Types<br />
- 90 Achievements and 20 Rewards<br />
- Endless Mode<br />
- No Ads</p>
<p>There&#8217;s also a lite version with 3 levels to try out.</p>
<p><img src="http://www.infectentertainment.com/deadend/screenshot3.png" alt="Screenshot 3" /></p>
<p><img src="http://www.infectentertainment.com/deadend/screenshot1.png" alt="Screenshot 1" /></p>
<p><img src="http://www.infectentertainment.com/deadend/screenshot2.png" alt="Screenshot 2" /></p>
<p>QR Code:</p>
<p><img src="http://www.infectentertainment.com/deadend/qrcode.png" alt="QR Code" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.infectentertainment.com/2010/07/22/dead-end-released/feed/</wfw:commentRss>
		<slash:comments>61</slash:comments>
		</item>
		<item>
		<title>Finished</title>
		<link>http://www.infectentertainment.com/2010/07/21/finished/</link>
		<comments>http://www.infectentertainment.com/2010/07/21/finished/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 13:31:47 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Dead End]]></category>

		<guid isPermaLink="false">http://www.infectentertainment.com/?p=45</guid>
		<description><![CDATA[Dead End is officially finished!!! Of course I&#8217;m sure a bug or two will pop up between now and release.<a href="http://www.infectentertainment.com/2010/07/21/finished/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>Dead End is officially finished!!! Of course I&#8217;m sure a bug or two will pop up between now and release. Next I have to get screenshots and other market stuff done but that won&#8217;t take too long.</p>
<p>Now I just have to decide when that release will be. Originally I was planning on next week because I will be out of town for a few days this weekend. Of course I still have 3 days until then and plenty of time to fix any bugs that come from the release. Plus, if the game doesn&#8217;t completely fail, it&#8217;ll make vacation all that much better. If the game does completely fail, then I can use vacation to get my mind off of it. Releasing today is looking like the better option. Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.infectentertainment.com/2010/07/21/finished/feed/</wfw:commentRss>
		<slash:comments>142</slash:comments>
		</item>
		<item>
		<title>Almost Done</title>
		<link>http://www.infectentertainment.com/2010/07/20/almost-done/</link>
		<comments>http://www.infectentertainment.com/2010/07/20/almost-done/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 17:52:44 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Dead End]]></category>

		<guid isPermaLink="false">http://www.infectentertainment.com/?p=43</guid>
		<description><![CDATA[Dead End is finally almost finished! The endless mode is working and bugs have been fixed. Only two things left<a href="http://www.infectentertainment.com/2010/07/20/almost-done/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>Dead End is finally almost finished! The endless mode is working and bugs have been fixed. Only two things left to do.</p>
<p>1. Randomly play music from a folder on the SD card. This is mainly to allow custom music to be played while playing the game.</p>
<p>2. Create a lite version. The lite version will have 2 levels and ads and links to buying the game.</p>
<p>I&#8217;ll probably test it a bunch while finished those two things up and then (hopefully!) release it next week.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.infectentertainment.com/2010/07/20/almost-done/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Chugging Along</title>
		<link>http://www.infectentertainment.com/2010/07/15/chugging-along/</link>
		<comments>http://www.infectentertainment.com/2010/07/15/chugging-along/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 20:13:19 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Dead End]]></category>

		<guid isPermaLink="false">http://www.infectentertainment.com/?p=39</guid>
		<description><![CDATA[I&#8217;ve gotten a big amount of work done since my last post. Achievements and stat tracking is completely done along<a href="http://www.infectentertainment.com/2010/07/15/chugging-along/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve gotten a big amount of work done since my last post. Achievements and stat tracking is completely done along with rewards for completing the achievements! It took me a lot longer than I thought it would to get it all working but that&#8217;s mostly from little bugs popping up here and there.</p>
<p>I&#8217;m also halfway done with adding enemies to the levels. Only ten more levels to go! I can see why game devs get sick of playing the games they created. I&#8217;ve gone through the levels so many times. It&#8217;s probably worse with mine since the levels are so repetitive. I do think it&#8217;s a fun game and a great time waster. I&#8217;m hoping that enough other people feel the same that it will make all the time I put into this game worthwhile. If not, I&#8217;m not sure if I&#8217;ll be able to convince myself to create something else.</p>
<p>Anyways, hoping I can get all the levels filled with enemies by the end of the week (tomorrow). Then I can get the Endless mode working, tie up some loose ends and I&#8217;ll be done! Well, all except for the lite version but that&#8217;ll be more about taking away features, not adding to gameplay.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.infectentertainment.com/2010/07/15/chugging-along/feed/</wfw:commentRss>
		<slash:comments>108</slash:comments>
		</item>
		<item>
		<title>End Of June</title>
		<link>http://www.infectentertainment.com/2010/06/30/end-of-june/</link>
		<comments>http://www.infectentertainment.com/2010/06/30/end-of-june/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 19:35:17 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Dead End]]></category>

		<guid isPermaLink="false">http://www.infectentertainment.com/?p=32</guid>
		<description><![CDATA[By the end of June, Dead End was supposed to be finished. It&#8217;s not. I did lose at least a<a href="http://www.infectentertainment.com/2010/06/30/end-of-june/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>By the end of June, Dead End was supposed to be finished. It&#8217;s not. I did lose at least a week due to a hard drive crash. So that means that I should be able to be finished in one more week. I&#8217;m not so sure that will happen. The majority of my to-do list is as follows:</p>
<ol>
<li>Make a list of achievements and make them obtainable.<br />
- I figure it&#8217;ll take me a day to make up the list and a generic way to award, save and load achievements. The longer part will probably be awarding them when specific events happen. That might take me another day. But of course it depends how long I get to work on it.</li>
<li>Record stats during level; accuracy, times healed, etc.<br />
I&#8217;ll probably do this before figuring out the awarding of achievements since a lot of that depends upon level stats.</li>
<li>Finish up adding level enemies and difficulty tweaking.<br />
This is what I&#8217;m doing now and it will probably take the longest. Getting all of the enemies in there so that it&#8217;s not too easy and not too hard is difficult.</li>
<li>Add an endless mode.<br />
This will start at easy level and progress through and never end.</li>
<li>Make a lite version.<br />
This will be when everything is finished. The lite version will have ads and only 2 levels.</li>
<li>Maybe a time attack mode.<br />
I haven&#8217;t decided if I want to add this now or in an update. I guess it depends how long everything else takes me but I want to release the game soon and adding this mode will only prolong things.</li>
</ol>
<p>That&#8217;s about it aside from bug fixes and minor additions. Maybe I&#8217;ll add another zombie type or something if I think of it.</p>
<p>Oh well, I know nobody reads this but writing all this out does help me focus better on what absolutely needs to be done.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.infectentertainment.com/2010/06/30/end-of-june/feed/</wfw:commentRss>
		<slash:comments>72</slash:comments>
		</item>
		<item>
		<title>Dead End Progress</title>
		<link>http://www.infectentertainment.com/2010/06/25/dead-end-progress/</link>
		<comments>http://www.infectentertainment.com/2010/06/25/dead-end-progress/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 15:11:54 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Dead End]]></category>

		<guid isPermaLink="false">http://www.infectentertainment.com/?p=30</guid>
		<description><![CDATA[I&#8217;m making progress with Dead End and think it might actually be finished in the near future. I still have<a href="http://www.infectentertainment.com/2010/06/25/dead-end-progress/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m making progress with Dead End and think it might actually be finished in the near future. I still have to add enemies to all the levels and increase the number of enemies, enemy damage and cash for the difficulties. Some other stuff needs to be done but that&#8217;s the main work left. I&#8217;m not sure how long it will actually take because it seems like some tweaking with weapon costs and enemy amounts will need to be done to make the difficulties work properly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.infectentertainment.com/2010/06/25/dead-end-progress/feed/</wfw:commentRss>
		<slash:comments>108</slash:comments>
		</item>
		<item>
		<title>Project Hosting</title>
		<link>http://www.infectentertainment.com/2010/06/13/project-hosting/</link>
		<comments>http://www.infectentertainment.com/2010/06/13/project-hosting/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 02:37:27 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Dead End]]></category>
		<category><![CDATA[Project Hosting]]></category>
		<category><![CDATA[Unfuddle]]></category>

		<guid isPermaLink="false">http://www.infectentertainment.com/?p=27</guid>
		<description><![CDATA[I just wanted to take a moment and mention how thankful I am for project hosting. I have Dead End&#8217;s<a href="http://www.infectentertainment.com/2010/06/13/project-hosting/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>I just wanted to take a moment and mention how thankful I am for project hosting. I have Dead End&#8217;s source privately hosted on Unfuddle. This allows me to use tickets to track work needing to be done and more importantly, they have all of the source code in a Subversion repository. </p>
<p>I didn&#8217;t find out how glad I was to be using Unfuddle until my hard drive crashed and I lost everything on it. Since I&#8217;m developing Dead End by myself I really don&#8217;t have a need for source control other than it helps me stay organized. I could just as easily stored the project locally but then it would all be gone.</p>
<p>If you&#8217;re starting out a solo project and storing it locally, either make frequent backups or consider using a project hosting service like Unfuddle. It&#8217;s free for the first project so there&#8217;s nothing to lose.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.infectentertainment.com/2010/06/13/project-hosting/feed/</wfw:commentRss>
		<slash:comments>53</slash:comments>
		</item>
		<item>
		<title>Accelerometer Player Control</title>
		<link>http://www.infectentertainment.com/2010/06/04/accelerometer-player-control/</link>
		<comments>http://www.infectentertainment.com/2010/06/04/accelerometer-player-control/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 13:50:55 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Dead End]]></category>
		<category><![CDATA[Accelerometer]]></category>

		<guid isPermaLink="false">http://www.infectentertainment.com/?p=21</guid>
		<description><![CDATA[If you&#8217;ve checked out the alpha release of Dead End, you will have noticed that the primary way of controlling<a href="http://www.infectentertainment.com/2010/06/04/accelerometer-player-control/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve checked out the alpha release of Dead End, you will have noticed that the primary way of controlling the player is through the use of the accelerometer.</p>
<p>The accelerometer measures the force of gravity on the phone&#8217;s X, Y and Z axes relative to its current orientation. On earth that would mean that value can be between +/- 9.8 (although my phone maxes out at +/- 10.5, I don&#8217;t know why). Take the Z axis for instance. The Z axis runs directly perpendicular to the screen of the phone. If you have the phone standing vertical with the screen facing you, the Z axis will be completely horizontal and the accelerometer will give a 0 value for that axis. If you tilt the screen forward until it&#8217;s facing the ground then you will get the max value on that axis.</p>
<p>In Dead End, I take the value the accelerometer gives me and I translate this into a rotation degree for that axis. Turning the phone all the way to the left should rotate the player 90 degrees to the left. So the max value of the accelerometer corresponds to 90 degrees and the angles in between can easily be interpolated.</p>
<p><code><br />
int mAccelMax = 10;<br />
float mAccelMult = 90 / mAccelMax;<br />
if(y > mAccelMax)<br />
&nbsp;&nbsp;y = mAccelMax;<br />
else if (j < -mAccelMax)<br />
&nbsp;&nbsp;y = -mAccelMax;<br />
</code><br />
<code><br />
rotate = y * mAccelMult;<br />
</code></p>
<p>Here, y is the accelerometer value for the y-axis. We define a value which is the accelerometer value at which the rotation should be 90 degrees. Here I made that 10, roughly the max value my phone reports. The multiplier is what interpolates the values in between. Since the max is 10 and we want to go a total of 90 degrees, each time we go up 1 on the accelerometer, we want to rotate 9 degrees. At 10, this will be 90 degrees.</p>
<p>If you want to make the tilt control more sensitive then all you have to do is lower the max value. This will cause mAccelMult to increase which increases the rotation each time we go up 1 on the accelerometer.</p>
<p>You can also redefine the center of rotation, the point where the accelerometer reports 0 and rotation is 0. This allows players to decide how the orientation that they hold the phone at rather than defining it for them. To do this, just subtract the accelerometer value of the point you want to be the center from the current reading.</p>
<p><code><br />
y -= mHorizontalCenter;<br />
</code><br />
<code><br />
int mAccelMax = 10;<br />
float mAccelMult = 90 / mAccelMax;<br />
if(y > mAccelMax)<br />
&nbsp;&nbsp;y = mAccelMax;<br />
else if (j < -mAccelMax)<br />
&nbsp;&nbsp;y = -mAccelMax;<br />
</code><br />
<code><br />
rotate = y * mAccelMult;<br />
</code></p>
<p>As you can see, this is the same code as before except for the very first line.</p>
<p>It's easy enough to use the options menu to allow the player to set tilt sensitivity and horizontal/vertical centers.</p>
<p>Next time I'll post about a problem I had with tilting the phone too much in one direction while having a custom centering point.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.infectentertainment.com/2010/06/04/accelerometer-player-control/feed/</wfw:commentRss>
		<slash:comments>173</slash:comments>
		</item>
		<item>
		<title>Android Garbage Collection</title>
		<link>http://www.infectentertainment.com/2010/05/28/android-garbage-collection/</link>
		<comments>http://www.infectentertainment.com/2010/05/28/android-garbage-collection/#comments</comments>
		<pubDate>Fri, 28 May 2010 14:55:15 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Garbage Collection]]></category>

		<guid isPermaLink="false">http://www.infectentertainment.com/?p=16</guid>
		<description><![CDATA[Coming from a C++ background, I never really had much experience with garbage collection before working with Android. Sure, I&#8217;ve<a href="http://www.infectentertainment.com/2010/05/28/android-garbage-collection/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>Coming from a C++ background, I never really had much experience with garbage collection before working with Android. Sure, I&#8217;ve used Java and Flash/Flex quite a bit but I never had to worry about it since I wasn&#8217;t working on performance critical code. Created objects would automatically get cleaned up and I didn&#8217;t care how.</p>
<p>In C++, every object that you create needs to be explicitly released. With Java, you don&#8217;t explicitly release objects. You just remove all references to an object you don&#8217;t need anymore and the garbage collector will eventually come along and release it for you.</p>
<p>This works fine when you don&#8217;t care about performance. However, when you&#8217;re creating a game on a mobile device, you need all the processing power it has and you&#8217;re definitely going to notice when the garbage collector is running. Throw in the fact that you have no idea when it&#8217;ll run and you have a problem. Depending upon how much memory is being released, you might see your program/game skip every few seconds or a few times per second.</p>
<p>How do you know the garbage collector is to blame for this problem? Simple. Watch the log output in the DDMS while your program is running. It will continually show lines like</p>
<p><code>GC freed 1307 objects / 88360 bytes in 159ms</code></p>
<p>every time it skips. Fixing this problem isn&#8217;t the hardest thing in the world. It&#8217;s more tedious than anything else.</p>
<p>The first thing you need to know, is what will cause the garbage collector to run. Since it works by releasing any unreferenced objects, the more objects you stop using, the more often it&#8217;s going to run. &#8220;Object&#8221; here mainly refers to a variable that at some point was assigned a value using the &#8220;new&#8221; command. This applies to basic arrays (new int[5]), class objects and also iterators for ArrayList and Map collections. It&#8217;s important to note that primitive types (int, float, double, etc.) DO NOT cause garbage collection. I&#8217;ve seen some places claim that they do and that completely screwed up some of my code in the very beginning. However, if you use a wrapper for a primitive type (Integer, Float, etc.), then unreferencing that WILL cause garbage collection.</p>
<p>Like I said before, fixing this is pretty easy but can be time consuming. Take the following code for example:<br />
<code><br />
for(int i = 0; i &lt; 10; i++) {<br />
&nbsp;&nbsp;Object obj = new Object();<br />
}<br />
</code></p>
<p>Every loop creates a new object while unreferencing the old one. Those unreferenced objects will eventually need to be cleaned up by the garbage collector. A better way to handle this would be:<br />
<code><br />
Object obj = new Object();<br />
for(int i = 0; i &lt; 10; i++) {<br />
&nbsp;&nbsp;obj.init();<br />
}<br />
</code></p>
<p>Rather than creating a new object every loop, just reinitialize the existing one.</p>
<p>Here&#8217;s another example that will eventually cause the garbage collector to run:<br />
<code><br />
public void createObject() {<br />
&nbsp;&nbsp;Object obj = new Object();<br />
}<br />
</code></p>
<p>Everytime this method runs, a new Object will be created. If you&#8217;re not holding onto that object somewhere, it&#8217;s going to get unreferenced and collected. A better way would be to do this:<br />
<code><br />
private Object mObj = new Object();<br />
public void createObject() {<br />
&nbsp;&nbsp;mObj.init();<br />
}<br />
</code></p>
<p>This way, the object is only created once and then reinitialized every time the method runs.</p>
<p>This can be applied to groups of objects as well. If you have multiple objects of the same type that can be created or destroyed at any point, then create an object pool. An object pool is just an array that holds objects that aren&#8217;t currently being used. When you need an object, check to see if the pool is has one. If so, reinitialize the object. If not, create a new object. Then when you&#8217;re done with an object, clean it up and stick it into the pool to be used later.</p>
<p>The last thing you need to know is how to find the problems. You could search through all of your code but if you&#8217;re not aware of this problem at the very beginning, that could take a very long time. The other option you have is using the Allocation Tracker in the standalone DDMS. You can find the DDMS in the Android tools folder that is installed with the SDK. Here&#8217;s the info on working the <a title="Allocation Tracker" href="http://developer.android.com/resources/articles/track-mem.html">Allocation Tracker</a>. This will show you exactly where objects are being allocated. If you see any excessive memory allocations (objects being created in a loop) that are unnecessary then you can use the previous tips on cleaning them up.</p>
<p>Hopefully this helps somebody out there. It&#8217;s a bit of a pain in the ass to explain properly so if you have any questions, just let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.infectentertainment.com/2010/05/28/android-garbage-collection/feed/</wfw:commentRss>
		<slash:comments>64</slash:comments>
		</item>
		<item>
		<title>Accelerometer Smoothing</title>
		<link>http://www.infectentertainment.com/2010/05/21/accelerometer-smoothing/</link>
		<comments>http://www.infectentertainment.com/2010/05/21/accelerometer-smoothing/#comments</comments>
		<pubDate>Fri, 21 May 2010 16:52:52 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Dead End]]></category>
		<category><![CDATA[Accelerometer]]></category>

		<guid isPermaLink="false">http://www.infectentertainment.com/?p=12</guid>
		<description><![CDATA[Some of the feedback for Dead End was mentioning that the tilt controls were too jerky. I&#8217;ve noticed this before<a href="http://www.infectentertainment.com/2010/05/21/accelerometer-smoothing/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>Some of the feedback for Dead End was mentioning that the tilt controls were too jerky. I&#8217;ve noticed this before and tried to fix it before but never did. It was especially noticeable when using the tilt aiming in a moving vehicle or while a little kid is jumping on the couch next to you.</p>
<p>Last time I tried to fix this, I googled for &#8220;Accelerometer Smoothing&#8221; and picked one way of handling it. The fix was way too complicated and didn&#8217;t work. Coming back to the problem, I did the same thing again and this time found a much, much simpler approach. I have no idea how I didn&#8217;t find this solution before but I&#8217;m glad I did because now the tilt movement is way smoother.</p>
<p>The solution is called a low-pass filter. It essentially filters out any drastic changes to the accelerometer values so that objects controlled by the accelerometer move at a more gradual pace.<br />
<code><br />
float accelFilter = 0.25f;<br />
x = x * accelFilter + lastX * (1 - accelFilter);<br />
...<br />
<em>Do something with accelerometer values</em><br />
...<br />
lastX = x;<br />
</code></p>
<p>That&#8217;s really all there was to it. Incredibly simple and yet for some reason it took me this long to find it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.infectentertainment.com/2010/05/21/accelerometer-smoothing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

