<?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>Lapegna.com</title>
	<atom:link href="http://www.lapegna.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lapegna.com</link>
	<description>UX, Design &#38; Development of games, iOS apps, touch screen kiosks and web applications</description>
	<lastBuildDate>Wed, 11 Aug 2010 11:04:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The Allure of Game Design</title>
		<link>http://www.lapegna.com/2010/08/the-allure-of-game-design/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=the-allure-of-game-design</link>
		<comments>http://www.lapegna.com/2010/08/the-allure-of-game-design/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 11:04:27 +0000</pubDate>
		<dc:creator>joey</dc:creator>
				<category><![CDATA[Game Design]]></category>

		<guid isPermaLink="false">http://www.lapegna.com/?p=77</guid>
		<description><![CDATA[
			
				
			
		
The terms interactive and user experience design can be used to describe applications, websites, user interfaces or games. But each of them can be very different beasts to design, requiring varying levels of balance in user experience to be successful.
When designing a tool like a word processor, the key is to enhance usability. While the [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.lapegna.com%2F2010%2F08%2Fthe-allure-of-game-design%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.lapegna.com%2F2010%2F08%2Fthe-allure-of-game-design%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>The terms interactive and user experience design can be used to describe applications, websites, user interfaces or games. But each of them can be very different beasts to design, requiring varying levels of balance in user experience to be successful.</p>
<p>When designing a tool like a word processor, the key is to enhance usability. While the user experience is important, the success of the product rides on whether the tool does the task it is meant to efficiently.</p>
<p>In game design we are able to shed the usability requirement and exchange it for &#8216;playability&#8217;. But the importance of a games playability is overshadowed if the user does not have a great experience.</p>
<p>That is the allure of game design over any other type interactive design. The success of your game is completely dependent on the user having a satisfying experience. The user (your customer/client) is<br />
spending their hard earned dollars trusting that your game can allow them to have such an experience. If your game does not deliver on this front, you won&#8217;t be delivering a successful product. And remember, your game is not the experience, it only allows the player to have the experience.</p>
<p>So how do we ensure a positive experience for our players? That is a much longer post, and the essence of game design. A good place to start is many iterations and much testing.</p>
<p>I find many similarities between game design and cooking. I get the same excitement from watching someone play with a game or mechanic I made that I do when I cook them a meal. I love to see that look of enjoyment on people&#8217;s faces when biting into a delicious meal. And if it&#8217;s not perfect, I can&#8217;t wait to pick apart the reasons why and how the recipe can be improved.</p>
<p>What is it about game design that keeps you coming back for more?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lapegna.com/2010/08/the-allure-of-game-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to be Happy In Business Desktop Wallpaper</title>
		<link>http://www.lapegna.com/2010/07/how-to-be-happy-in-business-desktop-wallpaper/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=how-to-be-happy-in-business-desktop-wallpaper</link>
		<comments>http://www.lapegna.com/2010/07/how-to-be-happy-in-business-desktop-wallpaper/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 13:03:41 +0000</pubDate>
		<dc:creator>joey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.lapegna.com/?p=55</guid>
		<description><![CDATA[
			
				
			
		
Budd Caddell&#8217;s &#8220;How to be Happy in Business&#8221; venn diagram is accurate, insightful and motivational. That&#8217;s why I&#8217;ve created a quick desktop wallpaper to remind me to strive for &#8220;HOORAY!&#8221;.
Thanks Budd!
Download 1920&#215;1200
Doanload 1280&#215;800
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.lapegna.com%2F2010%2F07%2Fhow-to-be-happy-in-business-desktop-wallpaper%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.lapegna.com%2F2010%2F07%2Fhow-to-be-happy-in-business-desktop-wallpaper%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://whatconsumesme.com/2009/posts-ive-written/how-to-be-happy-in-business-venn-diagram/">Budd Caddell&#8217;s &#8220;How to be Happy in Business&#8221;</a> venn diagram is accurate, insightful and motivational. That&#8217;s why I&#8217;ve created a quick desktop wallpaper to remind me to strive for &#8220;HOORAY!&#8221;.</p>
<p>Thanks Budd!</p>
<p><a href="http://www.lapegna.com/wp-content/uploads/2010/07/how-to-be-happy-in-business-1920x1200.png" target="_blank">Download 1920&#215;1200</a></p>
<p><a href="http://www.lapegna.com/wp-content/uploads/2010/07/how-to-be-happy-in-business-1280x800.png">Doanload 1280&#215;800</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lapegna.com/2010/07/how-to-be-happy-in-business-desktop-wallpaper/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Seting up a Virtual Host in Apache 2.2</title>
		<link>http://www.lapegna.com/2010/07/seting-up-a-virtual-host-in-apache-2-2/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=seting-up-a-virtual-host-in-apache-2-2</link>
		<comments>http://www.lapegna.com/2010/07/seting-up-a-virtual-host-in-apache-2-2/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 18:35:24 +0000</pubDate>
		<dc:creator>joey</dc:creator>
				<category><![CDATA[Geeky]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://www.lapegna.com/?p=47</guid>
		<description><![CDATA[
			
				
			
		
The following steps will help you setup a virtual domain on apache 2.2 on Windows. Steps are very similar for OS X, only the location of the files will change.
In these steps I&#8217;ve used cowabunga.localhost as a test. The .localhost TLD is reserved for testing, so you can be guaranteed it won&#8217;t interfere with any [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.lapegna.com%2F2010%2F07%2Fseting-up-a-virtual-host-in-apache-2-2%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.lapegna.com%2F2010%2F07%2Fseting-up-a-virtual-host-in-apache-2-2%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>The following steps will help you setup a virtual domain on apache 2.2 on Windows. Steps are very similar for OS X, only the location of the files will change.</p>
<p>In these steps I&#8217;ve used cowabunga.localhost as a test. The .localhost <acronym title="Top-Level-Domain">TLD is reserved</acronym> for testing, so you can be guaranteed it won&#8217;t interfere with any real websites. This is the best practice to follow, if you create a virtual host of cowabunga.com, you will not be able to reach the real version of that site.</p>
<ol>
<li>Edit httpd.conf</li>
<li>Uncomment the line Include conf/extra/httpd-vhosts.conf. Right after # Virtual hosts</li>
<li>Add the following above # Virtual hosts (replace C:\www with the path to your web root). Close and save it when done.</li>
</ol>
<pre>&lt;Directory "C:/www"&gt;
 Order Deny,Allow
 Allow from all
&lt;/Directory&gt; 
</pre>
<ol>
<li>We&#8217;ll setup the follow virtual host site.
<ol>
<li>cowabunga (C:\www\cowabunga). We&#8217;ll access this in the browser as cowabunga.localhost.</li>
</ol>
</li>
<li>Edit httpd-vhosts.conf (located in apache root/conf/etc/)</li>
<li>Add the following to the bottom of httpd-vhosts.conf. Close and save it when done.</li>
</ol>
<pre>&lt;VirtualHost *:80&gt;
DocumentRoot "C:/www/cowabunga"
ServerName cowagunga.localhost
&lt;/VirtualHost&gt;

&lt;VirtualHost *:80&gt;
DocumentRoot "C:/www/"
ServerName localhost
&lt;/VirtualHost&gt;
</pre>
<ol>
<li>That&#8217;s it for apache configuration. It&#8217;s now ready to host the virtual domain. We just need to tell Windows to go to our virtual host, rather than looking up the DNS.</li>
<li>Edit your <a href="http://en.wikipedia.org/wiki/Hosts_(file)">&#8220;hosts&#8221;</a> file. Available in one of the following places
<ol>
<li>Windows 95, 98, ME: Windows directory</li>
<li>NT, 2000, XP, 2003, Vista, 7: Windows folder\system32\drivers\etc\</li>
<li>Mac OS X, iOS: /private/etc/hosts or /etc/hosts</li>
</ol>
</li>
<li>Add the following line to the end of hosts. Close and save it when done.</li>
</ol>
<pre>127.0.0.1    burgess.localhost
127.0.0.1    localhost
</pre>
<ol>
<li>Restart apache from the GUI or the command prompt using:</li>
</ol>
<pre>apache -w -n "Apache" -k restart</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.lapegna.com/2010/07/seting-up-a-virtual-host-in-apache-2-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Animated scroll to internal links in JavaScript</title>
		<link>http://www.lapegna.com/2010/07/animated-scroll-to-internal-links-in-javascript/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=animated-scroll-to-internal-links-in-javascript</link>
		<comments>http://www.lapegna.com/2010/07/animated-scroll-to-internal-links-in-javascript/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 19:34:03 +0000</pubDate>
		<dc:creator>joey</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://www.lapegna.com/?p=42</guid>
		<description><![CDATA[
			
				
			
		
Usually, I&#8217;m a big fan of UI libraries like jQuery and YUI. Don&#8217;t really like to re-invent the wheel. This is a function that&#8217;s quite easy to do in either of those libraries.
Unfortunately, I&#8217;m working on a project right now with very strict guidelines on it&#8217;s code, so it turns out I am unable to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.lapegna.com%2F2010%2F07%2Fanimated-scroll-to-internal-links-in-javascript%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.lapegna.com%2F2010%2F07%2Fanimated-scroll-to-internal-links-in-javascript%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Usually, I&#8217;m a big fan of UI libraries like jQuery and YUI. Don&#8217;t really like to re-invent the wheel. This is a function that&#8217;s quite easy to do in either of those libraries.</p>
<p>Unfortunately, I&#8217;m working on a project right now with very strict guidelines on it&#8217;s code, so it turns out I am unable to use any JavaScript UI Libraries. So, I set forth on putting this together.</p>
<p>There were a few resources I used that came in handy to create this, and I&#8217;ve given credit to those folk at the end of this post.</p>
<h2>Part one: setInternalLinks</h2>
<p>Run this function on page load. I use Simon Willison&#8217;s <a href="http://simonwillison.net/2004/May/26/addLoadEvent/" target="_blank">addLoadEvent</a> to do this. It will search for all internal links on your page, and add a click listener to the animation function scrollToYOffset.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">/**
* setInternalLinks
* Searches the page for any internal links and converts them to animated automatic scrolls
*/</span>
<span style="color: #003366; font-weight: bold;">function</span> setInternalLinks<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// grab all anchor links on the page</span>
	<span style="color: #003366; font-weight: bold;">var</span> anchors <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> anchors.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> a <span style="color: #339933;">=</span> anchors<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>a.<span style="color: #660066;">href</span> <span style="color: #339933;">&amp;&amp;</span> a.<span style="color: #660066;">href</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span>  <span style="color: #006600; font-style: italic;">// href has #</span>
		   <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>a.<span style="color: #660066;">pathname</span> <span style="color: #339933;">==</span> location.<span style="color: #660066;">pathname</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'/'</span> <span style="color: #339933;">+</span> a.<span style="color: #660066;">pathname</span> <span style="color: #339933;">==</span> location.<span style="color: #660066;">pathname</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">// path name of url is same as current</span>
		   <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span>a.<span style="color: #660066;">search</span> <span style="color: #339933;">==</span> location.<span style="color: #660066;">search</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// query string of url is same as current</span>
			<span style="color: #003366; font-weight: bold;">var</span> aName <span style="color: #339933;">=</span> a.<span style="color: #660066;">href</span>.<span style="color: #660066;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> a.<span style="color: #660066;">href</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			a.<span style="color: #660066;">onclick</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #006600; font-style: italic;">// checks if the caller event e exists and grabs the target (mozilla + webkit). Grabs the IE equivalent if not.</span>
				<span style="color: #003366; font-weight: bold;">var</span> target <span style="color: #339933;">=</span> e <span style="color: #339933;">?</span> e.<span style="color: #660066;">target</span> <span style="color: #339933;">:</span> event.<span style="color: #660066;">srcElement</span><span style="color: #339933;">;</span>
				<span style="color: #006600; font-style: italic;">// the anchor name</span>
				<span style="color: #003366; font-weight: bold;">var</span> anchorName <span style="color: #339933;">=</span> target.<span style="color: #660066;">hash</span><span style="color: #339933;">;</span>
				<span style="color: #006600; font-style: italic;">// cut out the hash mark</span>
				anchorName <span style="color: #339933;">=</span> anchorName.<span style="color: #660066;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> anchorName.<span style="color: #660066;">length</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #006600; font-style: italic;">// grab all the anchors on the page again</span>
				anchors <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
				<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> j <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> j <span style="color: #339933;">&lt;</span> anchors.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> j<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>anchors<span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span>.<span style="color: #000066;">name</span> <span style="color: #339933;">==</span> anchorName<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						<span style="color: #006600; font-style: italic;">// found the right anchor. scroll to it!</span>
						scrollToYOffset<span style="color: #009900;">&#40;</span>anchors<span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">offsetTop</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h2>Part two: scrollToYOffset</h2>
<p>The method below is called by an onclick handler added by the setInternalLinks method. It&#8217;s a time-based animation with sinusoidal easing. Smooth and quick.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">/**
* scrollToOffset
*
* @param yOffset	The vertical offset to scroll to
*/</span>
<span style="color: #003366; font-weight: bold;">function</span> scrollToYOffset<span style="color: #009900;">&#40;</span>iTargetY<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// if the target is negative set it to 0</span>
	iTargetY <span style="color: #339933;">=</span> iTargetY <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">0</span> <span style="color: #339933;">?</span> <span style="color: #CC0000;">0</span> <span style="color: #339933;">:</span> iTargetY<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #003366; font-weight: bold;">var</span> frameInterval <span style="color: #339933;">=</span> <span style="color: #CC0000;">20</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 20 milliseconds per frame</span>
&nbsp;
	<span style="color: #003366; font-weight: bold;">var</span> totalTime <span style="color: #339933;">=</span> <span style="color: #CC0000;">750</span><span style="color: #339933;">;</span>
	<span style="color: #006600; font-style: italic;">// current scroll position: checks if window.pageYOffset exists (webkit + mozilla). If not, set's it to the IE equivalent</span>
	<span style="color: #003366; font-weight: bold;">var</span> startY <span style="color: #339933;">=</span> window.<span style="color: #660066;">pageYOffset</span> <span style="color: #339933;">?</span> window.<span style="color: #660066;">pageYOffset</span> <span style="color: #339933;">:</span> window.<span style="color: #660066;">document</span>.<span style="color: #660066;">body</span>.<span style="color: #660066;">scrollTop</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #003366; font-weight: bold;">var</span> d <span style="color: #339933;">=</span> iTargetY <span style="color: #339933;">-</span> startY<span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// total distance to scroll</span>
	<span style="color: #003366; font-weight: bold;">var</span> freq <span style="color: #339933;">=</span> Math.<span style="color: #660066;">PI</span> <span style="color: #339933;">/</span> <span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span> <span style="color: #339933;">*</span> totalTime<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// frequency</span>
	<span style="color: #003366; font-weight: bold;">var</span> startTime <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #003366; font-weight: bold;">var</span> tmr <span style="color: #339933;">=</span> setInterval<span style="color: #009900;">&#40;</span>
		<span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #006600; font-style: italic;">// check the time that has passed from the last frame</span>
			<span style="color: #003366; font-weight: bold;">var</span> elapsedTime <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> startTime<span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>elapsedTime <span style="color: #339933;">&lt;</span> totalTime<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// are we there yet?</span>
				<span style="color: #003366; font-weight: bold;">var</span> f <span style="color: #339933;">=</span> Math.<span style="color: #660066;">abs</span><span style="color: #009900;">&#40;</span>Math.<span style="color: #660066;">sin</span><span style="color: #009900;">&#40;</span>elapsedTime <span style="color: #339933;">*</span> freq<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				window.<span style="color: #660066;">scrollTo</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> Math.<span style="color: #660066;">round</span><span style="color: #009900;">&#40;</span>f<span style="color: #339933;">*</span>d<span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> startY<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
				clearInterval<span style="color: #009900;">&#40;</span>tmr<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				window.<span style="color: #660066;">scrollTo</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> iTargetY<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #339933;">,</span> frameInterval<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Above code has been tested in Firefox 3.6.6, Safari 5 and IE 7.</p>
<p>Credit for some help: <a href="http://articles.sitepoint.com/article/scroll-smoothly-javascript" target="_blank">Sitepoint: Make Internal Links Scroll Smothly with JavaScript</a> and <a href="http://cross-browser.com/x/examples/animation_tech.php" target="_blank">Cross-Browser.com: Animation Techniques</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lapegna.com/2010/07/animated-scroll-to-internal-links-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ip3 Forum today</title>
		<link>http://www.lapegna.com/2010/06/ip3-forum-today/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=ip3-forum-today</link>
		<comments>http://www.lapegna.com/2010/06/ip3-forum-today/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 11:35:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.lapegna.com/?p=34</guid>
		<description><![CDATA[
			
				
			
		
On my way to the ip3 Forum today. First event of it&#8217;s kind in Toronto.
http://www.interactiveontario.com/ip3
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.lapegna.com%2F2010%2F06%2Fip3-forum-today%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.lapegna.com%2F2010%2F06%2Fip3-forum-today%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>On my way to the ip3 Forum today. First event of it&#8217;s kind in Toronto.</p>
<p><a href="http://www.interactiveontario.com/ip3">http://www.interactiveontario.com/ip3</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lapegna.com/2010/06/ip3-forum-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert WAV to CAF using terminal</title>
		<link>http://www.lapegna.com/2010/06/convert-wav-to-caf-using-terminal/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=convert-wav-to-caf-using-terminal</link>
		<comments>http://www.lapegna.com/2010/06/convert-wav-to-caf-using-terminal/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 05:50:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone Dev]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://www.lapegna.com/?p=23</guid>
		<description><![CDATA[
			
				
			
		
Looking for a quick way to convert your audio files for use on iPhone or iPad development? This is right from the Apple developer docs, but I am always looking it up, so here it is:

/usr/bin/afconvert -f caff -d LEI16 inputFilename outputFilename

]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.lapegna.com%2F2010%2F06%2Fconvert-wav-to-caf-using-terminal%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.lapegna.com%2F2010%2F06%2Fconvert-wav-to-caf-using-terminal%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Looking for a quick way to convert your audio files for use on iPhone or iPad development? This is right from the Apple developer docs, but I am always looking it up, so here it is:</p>

<div class="wp_syntax"><div class="code"><pre class="unix" style="font-family:monospace;">/usr/bin/afconvert -f caff -d LEI16 inputFilename outputFilename</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.lapegna.com/2010/06/convert-wav-to-caf-using-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple accelerometer movement with Cocos2d and Chipmunk</title>
		<link>http://www.lapegna.com/2010/06/simple-accelerometer-movement-with-cocos2d-and-chipmunk/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=simple-accelerometer-movement-with-cocos2d-and-chipmunk</link>
		<comments>http://www.lapegna.com/2010/06/simple-accelerometer-movement-with-cocos2d-and-chipmunk/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 05:24:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone Dev]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[sdk]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.lapegna.com/?p=14</guid>
		<description><![CDATA[
			
				
			
		
We all need a quick and easy way to move a body based on accelerometer movement. This method allows quick execution and testing. In this post I&#8217;ll be detailing how to move a cpBody on screen using the accelerometer.
I&#8217;m assuming you&#8217;ll make all the connections between your sprite and the cpBody and understand how to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.lapegna.com%2F2010%2F06%2Fsimple-accelerometer-movement-with-cocos2d-and-chipmunk%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.lapegna.com%2F2010%2F06%2Fsimple-accelerometer-movement-with-cocos2d-and-chipmunk%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>We all need a quick and easy way to move a body based on accelerometer movement. This method allows quick execution and testing. In this post I&#8217;ll be detailing how to move a cpBody on screen using the accelerometer.</p>
<p>I&#8217;m assuming you&#8217;ll make all the connections between your sprite and the cpBody and understand how to set up a cocos2D and Chipmunk project. If you need help with this check out Alexandre Gomes&#8217; excellent tutorial &#8220;<a href="http://www.alexandre-gomes.com/articles/chipmunk/">An introduction to game physics with Chipmunk</a>&#8220;. Much of the code below is not directly related to the acceleration, while I am not including all the methods required for the class, I like to provide complete methods, so you can see how things will interact.</p>
<p>In this case we&#8217;ll just move a body based on the x (left and right) movement.</p>
<p>1) enable accelerometer in the init method and initialize the acceleration at 0.</p>

<div class="wp_syntax"><div class="code"><pre class="objective-c" style="font-family:monospace;">-(id) init
{
    if( (self=[super init]) ) {
        self.isAccelerometerEnabled = YES;
        accellX = 0; // float defined in header
&nbsp;
        // setup chipmunk
        [self setupChipmunk];
&nbsp;
        // setup your cpShapes, cpBodies and CCSprites here
        // I'll be using spriteBody to these
    }
}</pre></div></div>

<p>2) Setup Chipmunk</p>

<div class="wp_syntax"><div class="code"><pre class="objective-c" style="font-family:monospace;">- (void) setupChipmunk
{
    // start chipmunk
    cpInitChipmunk();
&nbsp;
    // create space object
    space = cpSpaceNew();
&nbsp;
    // define gravity vector - zero gravity here - change the vector to apply gravity
    space-&gt;gravity = cpv(0, -0);
&nbsp;
    // Add some elastic effects to the simulation
    space-&gt;elasticIterations = 20;
&nbsp;
    // Create an update schedule
    [self schedule:@selector(step:)];
}</pre></div></div>

<p>3) Update the current acceleration when an update is received</p>

<div class="wp_syntax"><div class="code"><pre class="objective-c" style="font-family:monospace;">- (void) accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration
{
    // set current acceleration to 10x the current acceleration of the device.
    // change 10 to any number that works for your implementation speed.
    accellX = acceleration.x * 10;
}</pre></div></div>

<p>4) The step function we referred to in #2. This move the cpBody based on the current acceleration as defined in #3. Remember, right now this is x only, I&#8217;ll let you make the connections to get y working.</p>

<div class="wp_syntax"><div class="code"><pre class="objective-c" style="font-family:monospace;">-(void) step: (ccTime) dt
{
    cpSpaceStep(space, dt);
&nbsp;
    // get new x position based on acceleration
    // spriteBody is a cpBody defined in the header file and setup with a shape and sprite in the init
    float newX = spriteBody-&gt;p.x + accellX;
&nbsp;
    // move the sprite body to the new x position
    spriteBody-&gt;p = cpv(newX, spriteBody-&gt;p.y);
&nbsp;
    // call our function for each shape
    cpSpaceHashEach(space-&gt;activeShapes, &amp;amp;updateShape, nil);
}</pre></div></div>

<p>5) Just for completion&#8217;s sake, I&#8217;ll include the method to update the shapes called in the last line of the previous code. None of this effects the acceleration at all&#8230; simply moves the sprite to the position of the shape.</p>

<div class="wp_syntax"><div class="code"><pre class="objective-c" style="font-family:monospace;">void updateShape(void *ptr, void* unused)
{
    cpShape *shape = (cpShape *)ptr; // the shape
    CCSprite *sprite = shape-&gt;data; // the sprite
&nbsp;
    // set the sprite position to the shapes body position
    [sprite setPosition: shape-&gt;body-&gt;p];
}</pre></div></div>

<p>And that&#8217;s it, your body should be moving based on the accelerometer input.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lapegna.com/2010/06/simple-accelerometer-movement-with-cocos2d-and-chipmunk/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Xcode &#8211; Base SDK Missing</title>
		<link>http://www.lapegna.com/2010/06/xcode-base-sdk-missing/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=xcode-base-sdk-missing</link>
		<comments>http://www.lapegna.com/2010/06/xcode-base-sdk-missing/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 02:52:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone Dev]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[sdk]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.lapegna.com/?p=7</guid>
		<description><![CDATA[
			
				
			
		
Just upgraded to iOS SDK 4 GM release along with Xcode 3.2, so I can test some of my projects on my device.
When I opened up the first old project (built for OS 3.2 on XCode 3.1), I received a &#8220;Base SDK Missing&#8221; error in the Device &#124; Debug drop down menu.
Clicking the info icon [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.lapegna.com%2F2010%2F06%2Fxcode-base-sdk-missing%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.lapegna.com%2F2010%2F06%2Fxcode-base-sdk-missing%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Just upgraded to iOS SDK 4 GM release along with Xcode 3.2, so I can test some of my projects on my device.</p>
<p>When I opened up the first old project (built for OS 3.2 on XCode 3.1), I received a &#8220;Base SDK Missing&#8221; error in the Device | Debug drop down menu.</p>
<p>Clicking the info icon in the tool bar of the open project allows you to select the &#8220;Base SDK for All Configurations&#8221; drop down. Select your new SDK and voila! You can also change the &#8220;Project Format&#8221; here as well, might be a good idea to select your current Xcode version.</p>
<p>Pretty simple problem and solution, but it seems like developers (like me) are experiencing this every day.</p>
<p>Update 1: Tom has pointed out in the comments, that you can retain compatibility with 3.0 devices if you set the base SDK as 4.0, but set the deployment target as 3.0. Thanks Tom!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lapegna.com/2010/06/xcode-base-sdk-missing/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>blog&#8230; take three</title>
		<link>http://www.lapegna.com/2010/06/blog-take-three/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=blog-take-three</link>
		<comments>http://www.lapegna.com/2010/06/blog-take-three/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 20:34:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Journal]]></category>
		<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://www.lapegna.com/?p=4</guid>
		<description><![CDATA[
			
				
			
		
Let&#8217;s try this again&#8230; with a new attitude!
I&#8217;ve dumped all my old, sporadically posted blog entries&#8230; going to give this journal/blog thing another try. Although, I may recover some of the old technical posts to keep a hold of them
This mostly stems from the realization that during my work I solve many problems&#8230; then when [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.lapegna.com%2F2010%2F06%2Fblog-take-three%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.lapegna.com%2F2010%2F06%2Fblog-take-three%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Let&#8217;s try this again&#8230; with a new attitude!</p>
<p>I&#8217;ve dumped all my old, sporadically posted blog entries&#8230; going to give this journal/blog thing another try. Although, I may recover some of the old technical posts to keep a hold of them</p>
<p>This mostly stems from the realization that during my work I solve many problems&#8230; then when the problem arises again, I forgot how I solved it previously.</p>
<p>I&#8217;m hoping that by keeping notes on these solutions and ideas I&#8217;ll be able to keep track of them for future use, and maybe be of some help to someone else out there in the world.</p>
<p>Most of the posts will be centered around my current focus, as broad as it may be:</p>
<ul>
<li>iOS (iPhone, iPad, iPod) game development</li>
<li>Flash and AS3 development for web and touch screen</li>
<li>HTML + CSS + PHP + MySQL</li>
</ul>
<p>Some of the topics I cover will include some basic topics and some more advanced. I&#8217;m much more proficient in AS3 than MySQL, so I you&#8217;ll get a different level of complexity.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lapegna.com/2010/06/blog-take-three/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
