<?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>threeformed // a blog &#187; tetris</title>
	<atom:link href="http://threeformed.com/blog/tag/tetris/feed/" rel="self" type="application/rss+xml" />
	<link>http://threeformed.com/blog</link>
	<description></description>
	<lastBuildDate>Fri, 18 Feb 2011 20:00:24 +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>JavaScript Tetris</title>
		<link>http://threeformed.com/blog/javascript-tetris/</link>
		<comments>http://threeformed.com/blog/javascript-tetris/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 04:38:29 +0000</pubDate>
		<dc:creator>gordon</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[tetris]]></category>

		<guid isPermaLink="false">http://threeformed.com/blog/2008/08/08/javascript-tetris/</guid>
		<description><![CDATA[<p></p>
<h2>Why?</h2>
<p>I was finishing up some tedious work around midnight a few days ago and decided I needed to code something fun. I have&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://threeformed.com/blog/wp-content/uploads/2008/08/tetris1.gif" alt="Tetris" style="clear: both; float: none" /></p>
<h2>Why?</h2>
<p>I was finishing up some tedious work around midnight a few days ago and decided I needed to code something fun. I have a few projects I&#8217;m already working on so I figured I&#8217;d do something small and quick. Lately I&#8217;ve been getting interested in game programming so I wanted to do something along those lines. &#8220;But what sort of game can I make in a few hours?&#8221; I thought to myself. Then it hit me. <a href="http://threeformed.com/labs/Tetris/tetris.html" target="_blank">I was going to make Tetris</a>.<span id="more-11"></span></p>
<h2>The Process</h2>
<p>I&#8217;d never made anything like this before so I decided to implement in JavaScript since I&#8217;ve been doing a lot of  JavaScript coding lately. I grabbed a Coke from the fridge and got to work. It took a couple of hours to throw together the internals and another hour or so to style it (CSS is not my cup of tee). I used the sweet <a href="http://jquery.com" target="_blank">jQuery</a> library for all DOM manipulation and a few images I made so the blocks would look nice. It turned out pretty well and after one long night I had a nice little tetris game!</p>
<h2>Compatibility</h2>
<p>It works in Safari 3, Firefox 2, IE 6 &amp; 7, and Opera 9 (those are all the browsers I have installed) with the only caveat being that Opera doesn&#8217;t continuously fire the onkeydown event while a button is pressed, so dropping blocks quickly in Opera requires multiple taps on the down arrow.</p>
<h2>Source Code</h2>
<p>The code, styles, images, and markup <a href="http://threeformed.com/labs/Tetris/Tetris.zip" target="_blank">are available here</a> in case anyone wants to fix any bugs they find or use it as a studying tool (the code is commented, but it was late so the comments are not as detailed as they could be).</p>
<p>Well enough talk! <strong><a href="http://threeformed.com/labs/Tetris/tetris.html" target="_blank">Check it out!</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://threeformed.com/blog/javascript-tetris/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

