<?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>scriptNode &#187; games</title>
	<atom:link href="http://scriptnode.com/tag/games/feed/" rel="self" type="application/rss+xml" />
	<link>http://scriptnode.com</link>
	<description>Tips and tricks for web developers.</description>
	<lastBuildDate>Tue, 01 Sep 2009 18:46:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Spacius! Source Code</title>
		<link>http://scriptnode.com/article/spacius-source-code/</link>
		<comments>http://scriptnode.com/article/spacius-source-code/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 05:52:23 +0000</pubDate>
		<dc:creator>Matt Hackett</dc:creator>
				<category><![CDATA[Advanced]]></category>
		<category><![CDATA[code-style]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[just-for-fun]]></category>
		<category><![CDATA[lab]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://scriptnode.com/?p=278</guid>
		<description><![CDATA[
I&#8217;ve been meaning to &#8220;release&#8221; this for quite some time now, but I wanted to do it in small doses, with in-depth explanations of the code. Making a game can be somewhat overwhelming, but it&#8217;s just like any other large task: if you break it up into smaller pieces, it becomes much easier to manage.


But [...]]]></description>
			<content:encoded><![CDATA[<p>
I&#8217;ve been meaning to &#8220;release&#8221; this for quite some time now, but I wanted to do it in small doses, with in-depth explanations of the code. Making a game can be somewhat overwhelming, but it&#8217;s just like any other large task: if you break it up into smaller pieces, it becomes much easier to manage.
</p>
<p>
But time is a commodity nowadays. I&#8217;ve got way less time to write, and when I do, I&#8217;d rather be writing <em>code</em> than tutorials (or honestly, <a href="http://raptr.com/richtaur"><em>playing</em> video games</a>). Sorry about that, but I hope the (well-commented!) source will help those of you out there who&#8217;d like to contribute to the <a href="http://games.nihilogic.dk/">slowly growing world of DHTML games</a>.
</p>
<p>
You&#8217;ll notice that this code is <a href="/article/spacius-a-space-adventure/">over 6 months old</a>. And I&#8217;m the kind of developer who constantly updates his <a href="/tag/code-style/">style, methods and patterns</a>. Given that, there may very well be many mistakes or bad practices in here, some of which I may have improved upon by now, but others maybe not. Either way, feel free to comment on them, and I&#8217;ll answer any questions as well.
</p>
<p>
Thanks for checking it out, and please be good to it. I&#8217;d love to know about any projects created with this source as a basis, and would appreciate links back here. Also please don&#8217;t claim it as your own, that&#8217;s not cool.
</p>
<div class="section">
For now I am hosting the source code with <a href="http://github.com/richtaur/spacius-/tree/master">GitHub</a>.
</div>
<p>
Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://scriptnode.com/article/spacius-source-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shark!</title>
		<link>http://scriptnode.com/article/shark/</link>
		<comments>http://scriptnode.com/article/shark/#comments</comments>
		<pubDate>Sun, 03 Aug 2008 10:56:42 +0000</pubDate>
		<dc:creator>Matt Hackett</dc:creator>
				<category><![CDATA[Advanced]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[just-for-fun]]></category>
		<category><![CDATA[lab]]></category>
		<category><![CDATA[script-sunday]]></category>
		<category><![CDATA[yui]]></category>

		<guid isPermaLink="false">http://scriptnode.com/?p=48</guid>
		<description><![CDATA[
Well, this year&#8217;s Shark Week is over. In its memory, I offer up a script that makes sharks swim around on the screen. You should see a few sharks swimming about right now! Here&#8217;s the source code:


/**
 * Global Shark constructor
 * Options for ops: dir, speed, url, x, y, zIndex
 * @constructor
 * @public
 [...]]]></description>
			<content:encoded><![CDATA[<p>
Well, this year&#8217;s <a href="http://discovery.com/sharkweek/">Shark Week</a> is over. In its memory, I offer up a script that makes sharks swim around on the screen. You should see a few sharks swimming about right now! Here&#8217;s the source code:
</p>
<p><textarea class="javascript" cols="50" name="code" rows="10"><br />
/**<br />
 * Global Shark constructor<br />
 * Options for ops: dir, speed, url, x, y, zIndex<br />
 * @constructor<br />
 * @public<br />
 */<br />
Shark = function(ops) {</p>
<p>	var Y = YAHOO.util,<br />
		DEFAULT_SPEED = 2,<br />
		DEFAULT_ZINDEX = 1000,<br />
		DELAY = 25,<br />
		LEFT = &#8216;l&#8217;,<br />
		RIGHT = &#8216;r&#8217;,<br />
		SCREEN_WIDTH = Y.Dom.getViewportWidth(),<br />
		SCREEN_HEIGHT = Y.Dom.getViewportHeight(),<br />
		SHARK_WIDTH = 242,<br />
		SHARK_HEIGHT = 82;</p>
<p>	var interval,<br />
		that = this;</p>
<p>	that.active = true;<br />
	that.dir = LEFT;<br />
	that.el = {};<br />
	that.onOutLeft = function(){};<br />
	that.onOutRight = function(){};<br />
	that.x = 0;<br />
	that.y = 0;</p>
<p>	/**<br />
	 * Initializes the shark variables<br />
	 * @private<br />
	 */<br />
	var init = function() {</p>
<p>		ops = ops || {};<br />
		ops.speed = ops.speed || rand(DEFAULT_SPEED, (DEFAULT_SPEED * 2));<br />
		ops.url = ops.url || &#8216;./&#8217;;<br />
		ops.zIndex = ops.zIndex || DEFAULT_ZINDEX;</p>
<p>		if (ops.dir) {<br />
			that.dir = ops.dir;<br />
		} else {<br />
			that.dir = [LEFT, RIGHT][rand(0, 1)];<br />
		}</p>
<p>		if (ops.x === undefined) {<br />
			if (that.dir == LEFT) {<br />
				that.x = (SCREEN_WIDTH &#8211; 1);<br />
			} else {<br />
				that.x = -SHARK_WIDTH;<br />
			}<br />
		} else {<br />
			that.x = ops.x;<br />
		}</p>
<p>		that.el = document.createElement(&#8217;div&#8217;);<br />
		that.el.className = &#8217;shark&#8217;; // Doesn&#8217;t do anything. Just in case you want to use it<br />
		that.el.style.position = &#8216;absolute&#8217;;<br />
		that.el.style.height = SHARK_HEIGHT + &#8216;px&#8217;;<br />
		that.el.style.zIndex = ops.zIndex;</p>
<p>		Y.Event.addListener(that.el, &#8216;click&#8217;, onclick);</p>
<p>		document.body.appendChild(that.el);<br />
		reset();</p>
<p>		if (ops.y !== undefined) {<br />
			that.y = ops.y<br />
			plot();<br />
		}</p>
<p>		that.start();</p>
<p>	};</p>
<p>	/**<br />
	 * Kills the shark<br />
	 * @param {Boolean} fade Whether to fade the shark in or not<br />
	 */<br />
	that.kill = function(fade) {</p>
<p>		that.active = false;</p>
<p>		var done = function() {<br />
			document.body.removeChild(that.el);<br />
			stop();<br />
		};</p>
<p>		if (fade) {</p>
<p>			var anim = new Y.Anim(that.el, {opacity : {to : 0}}, 0.5);</p>
<p>			anim.onComplete.subscribe(done);<br />
			anim.animate();</p>
<p>		} else {<br />
			done();<br />
		}</p>
<p>	};</p>
<p>	/**<br />
	 * Move the shark<br />
	 */<br />
	var move = function() {</p>
<p>		if (!that.active) {<br />
			return;<br />
		}</p>
<p>		if (that.dir == LEFT) {</p>
<p>			that.x -= ops.speed;</p>
<p>			if (that.x &lt; -SHARK_WIDTH) {<br />
				that.dir = RIGHT;<br />
				that.onOutLeft();<br />
				reset();<br />
			}</p>
<p>		} else {</p>
<p>			that.x += ops.speed;</p>
<p>			if (that.x &gt; (SCREEN_WIDTH &#8211; 1)) {<br />
				that.dir = LEFT;<br />
				that.x = (SCREEN_WIDTH &#8211; 1);<br />
				that.onOutRight();<br />
				reset();<br />
			}</p>
<p>		}</p>
<p>		if (that.x &gt; (SCREEN_WIDTH &#8211; SHARK_WIDTH)) {<br />
			that.el.style.width = (SHARK_WIDTH &#8211; (that.x &#8211; (SCREEN_WIDTH &#8211; SHARK_WIDTH))) + &#8216;px&#8217;;<br />
		} else {<br />
			that.el.style.width = SHARK_WIDTH + &#8216;px&#8217;;<br />
		}</p>
<p>		plot();</p>
<p>	};</p>
<p>	/**<br />
	 * Kills the shark. Note: intended to be overwritten<br />
	 */<br />
	var onclick = function() {<br />
		that.onclick();<br />
	};</p>
<p>	/**<br />
	 * Default onclick behavior<br />
	 */<br />
	that.onclick = function() {<br />
		that.kill(true);<br />
	};</p>
<p>	/**<br />
	 * Moves the shark element to the XY coordinates<br />
	 */<br />
	var plot = function() {<br />
		that.el.style.left = that.x + &#8216;px&#8217;;<br />
		that.el.style.top = that.y + &#8216;px&#8217;;<br />
	};</p>
<p>	/**<br />
	 * Returns a random number<br />
	 * @param {Number} from The starting point<br />
	 * @param {Number} to The stopping point<br />
	 * @return {Number} A random number within the range<br />
	 */<br />
	var rand = function(from, to) {<br />
		return (from + Math.floor((to &#8211; from + 1) * Math.random()));<br />
	}; </p>
<p>	/**<br />
	 * Sets the background based on direction and randomizes the Y position<br />
	 */<br />
	var reset = function() {</p>
<p>		that.el.style.background = &#8216;url(&#8217; + ops.url + &#8217;shark_&#8217; + that.dir + &#8216;.gif)&#8217;;<br />
		that.y = rand(0, (SCREEN_HEIGHT &#8211; SHARK_HEIGHT &#8211; 1));</p>
<p>		plot();</p>
<p>	};</p>
<p>	/**<br />
	 * Starts the move interval<br />
	 */<br />
	that.start = function() {</p>
<p>		if (interval) {<br />
			return;<br />
		}</p>
<p>		interval = setInterval(move, DELAY);</p>
<p>	};</p>
<p>	/**<br />
	 * Stops the move interval<br />
	 */<br />
	that.stop = function() {<br />
		if (interval) {<br />
			clearInterval(interval);<br />
			interval = false;<br />
		}<br />
	};</p>
<p>	init();</p>
<p>};<br />
</textarea></p>
<p>
You can create new sharks like this:
</p>
<p><textarea class="javascript" cols="50" name="code" rows="10"><br />
var myShark = new Shark();</p>
<p>// Or setup some basics, like having him swim to the left<br />
var anotherShark = new Shark({dir : &#8216;l&#8217;});<br />
anotherShark.onclick = function() {<br />
alert(&#8221;I&#8217;m a shaaaaaaark!&#8221;);<br />
myShark.kill(true); // Kill it with a fade<br />
};</p>
<p>// You may also want to host the shark images yourself:<br />
var hostedShark = new Shark({url : &#8216;http://mydomain.com/shark/&#8217;});<br />
</textarea></p>
<p>
The last example above shows setting a custom <acronym title="Uniform Resource Locator">URL</acronym> for the shark images. You can download those here:
</p>
<p>
<a href="/lab/shark/shark_l.gif"><img alt="Shark!" src="/lab/shark/shark_l.gif"/></a><br />
<a href="/lab/shark/shark_r.gif"><img alt="Shark!" src="/lab/shark/shark_r.gif"/></a>
</p>
<p>
<a class="after" href="/lab/shark/"><img alt="Shark!" src="/assets/img/shark_thumbnail.jpg"/></a><br />
There are a few different events you can subscribe to including <code>onclick</code>, <code>onOutLeft</code> and <code>onOutRight</code>, which I think are pretty self-explanatory.<br />
Using these events, I put together <a href="http://scriptnode.com/lab/shark/">a very simple game</a> involving sharks, clicking and hopelessly trying to save a doomed diver. The ocean graphics came from one of my <a href="http://csszengarden.com/?cssfile=http://www.css-praxis.de/cssocean/zenocean.css">favorite CSS Zen Garden examples</a>.
</p>
<p>
The shark script requires <a href="http://developer.yahoo.com/yui/">YUI</a> (Animation, DOM and Event). I&#8217;ve included it in the third download option below:
</p>
<ul>
<li><a href="/assets/js/shark/shark.js">[Download shark.js]</a> (3,747 bytes)</li>
<li><a href="/assets/js/shark/shark-min.js">[Download shark-min.js]</a> (1,550 bytes; compressed)</li>
<li><a href="/assets/js/shark/shark-min-yui.js">[Download shark-min-yui.js]</a> (46k; compressed with YUI)</li>
</ul>
<p>
I&#8217;d love to see if anybody else has cool ideas of what to do with the shark script!
</p>
<p><script src="/assets/js/shark/shark-min-yui.js" type="text/javascript"></script><br />
<script type="text/javascript">
(function() {
new Shark({url : '/lab/shark/'});
new Shark({url : '/lab/shark/'});
})();
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://scriptnode.com/article/shark/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Weekly Round-up (Week of 7/13/08)</title>
		<link>http://scriptnode.com/article/weekly-round-up-week-of-71308/</link>
		<comments>http://scriptnode.com/article/weekly-round-up-week-of-71308/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 07:43:30 +0000</pubDate>
		<dc:creator>Matt Hackett</dc:creator>
				<category><![CDATA[Advanced]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[just-for-fun]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[weekly-roundup]]></category>

		<guid isPermaLink="false">http://scriptnode.com/?p=41</guid>
		<description><![CDATA[
Last week was an amazing week for web development. If you haven&#8217;t heard about these cool new projects, here&#8217;s what you&#8217;ve been missing out on:



The first thing I saw last week was Scott Schiller&#8217;s amazing Experimental dynamic XBM test, favicon &#8220;VU meter&#8221;. He put his very useful Sound Manager 2 flash API to interesting use: [...]]]></description>
			<content:encoded><![CDATA[<p>
Last week was an <strong>amazing</strong> week for web development. If you haven&#8217;t heard about these cool new projects, here&#8217;s what you&#8217;ve been missing out on:
</p>
<p>
<a href="http://schillmania.com/projects/soundmanager2/demo/page-player/xbm-test.html"><img alt="VU meter" class="after" src="/assets/img/2008_7_13_favicon_vu.gif"/></a><br />
The first thing I saw last week was <a href="http://www.schillmania.com/">Scott Schiller&#8217;s</a> amazing <a href="http://schillmania.com/projects/soundmanager2/demo/page-player/xbm-test.html">Experimental dynamic XBM test, favicon &#8220;VU meter&#8221;</a>. He put his <a href="http://scriptnode.com/lab/spacius/">very useful</a> <a href="http://schillmania.com/projects/soundmanager2/">Sound Manager 2</a> flash API to interesting use: the <a href="http://en.wikipedia.org/wiki/Favicon">favicon</a> displayed in many browsers&#8217; tabs and other places is a VU meter of the current song playing. Awesome! So, using that cool premise, what other neat things could be done…
</p>
<p>
<a href="http://www.p01.org/releases/DHTML_contests/files/DEFENDER_of_the_favicon/"><img alt="DEFENDER of the favicon" class="before" src="/assets/img/defender_of_the_favicon.gif"/></a><br />
Enter <a href="http://www.p01.org/">Mathieu &#8216;p01&#8242; Henri&#8217;s</a> super cool <a href="http://www.p01.org/releases/DHTML_contests/files/DEFENDER_of_the_favicon/">DEFENDER of the favicon</a>! This unbelievable game is confined in a tiny <strong>16&#215;16</strong> box, just big enough for your favicon! You can also hit <code>Enter</code> to transfer the game into a <code>canvas</code> element on the page. So creative, so retro, so cool! I&#8217;ve already spent way too much time playing this game, much to the misfortune of my poor squinting eyes.
</p>
<p>
<a href="http://blog.nihilogic.dk/2008/07/house-of-canvas-radiohead-meets.html"><img alt="Radiohead" class="after" src="/assets/img/radiohead_canvas.gif"/></a><br />
Last but never least is the always impressive <a href="http://blog.nihilogic.dk/">Jacob Seidelin</a> with another mind-blowing demo of what <a href="/tag/javascript/">JavaScript</a> is capable of in the right hands. I&#8217;m sorry if it&#8217;s tiring that I keep reposting what Jacob is up to, but as long as he&#8217;s doing incredible things like this, it&#8217;s not gonna stop.
</p>
<p>
You may have already heard about <a href="http://www.radiohead.com/">Radiohead&#8217;s</a> new <a href="http://code.google.com/creative/radiohead/">video hosted on Google Code</a>. If not, here&#8217;s the gist of it:
</p>
<blockquote><p>
No cameras or lights were used.  Instead two technologies were used to capture 3D images: <a href="http://www.geometricinformatics.com/">Geometric Informatics</a> and <a href="http://www.velodyne.com/lidar/">Velodyne LIDAR</a>.  Geometric Informatics scanning systems produce structured light to capture 3D images at close proximity, while a Velodyne Lidar system that uses multiple lasers is used to capture large environments such as landscapes.  In this video, 64 lasers rotating and shooting in a 360 degree radius 900 times per minute produced all the exterior scenes.
</p>
</blockquote>
<p>
Awesome right? Well Jacob saw this as a challenge from Radiohead and did what he does: <a href="http://blog.nihilogic.dk/2008/07/house-of-canvas-radiohead-meets.html">implemented it in JavaScript and canvas</a>. As usual, super cool stuff.
</p>
<p>
Well, this week&#8217;s almost over, so here&#8217;s to hoping that <strong>next</strong> is half as cool as last week was!</p>
]]></content:encoded>
			<wfw:commentRss>http://scriptnode.com/article/weekly-round-up-week-of-71308/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>If You Liked Spacius!&#8230;</title>
		<link>http://scriptnode.com/article/if-you-liked-spacius/</link>
		<comments>http://scriptnode.com/article/if-you-liked-spacius/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 20:15:27 +0000</pubDate>
		<dc:creator>Matt Hackett</dc:creator>
				<category><![CDATA[Novice]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[links]]></category>

		<guid isPermaLink="false">http://scriptnode.com/?p=40</guid>
		<description><![CDATA[
Spacius! has gotten a lot of attention.
Thanks everyone! To answer many questions at once: yes, eventually I will be providing tutorials on how to make the game.
Rather than providing a large (1,331 lines) file with minimal comments, I wanted to hold off and explain in great detail how to build the game from the ground [...]]]></description>
			<content:encoded><![CDATA[<p>
<a href="http://scriptnode.com/article/spacius-a-space-adventure/">Spacius!</a> has gotten a lot of attention.<br />
Thanks everyone! To answer many questions at once: yes, eventually I will be providing tutorials on how to make the game.<br />
Rather than providing a large (1,331 lines) file with minimal comments, I wanted to hold off and explain in great detail how to build the game from the ground up, piece by piece.
</p>
<p>
In the meantime, many kind folks throughout the Interwebz have pointed out some other similar projects. Those links, in addition to some perusing of my own have come up<br />
with some really interesting stuff. And here they are, in random order:
</p>
<h3><a href="http://blog.nihilogic.dk/2008/05/8-kilobytes-of-mario.html">8 kilobytes of Mario</a></h3>
<p>
I&#8217;ve said before that <a href="http://blog.nihilogic.dk/">Jacob Seidelin</a> is a genius. This was the first article he wrote that did it for me.<br />
This game was engineered in a cool enough way to be <a href="http://ejohn.org/blog/embedding-and-encoding-in-javascript/">covered by engineering superstar John Resig</a>.
</p>
<h3><a href="http://www.schillmania.com/arkanoid/">DHTML Arkanoid</a></h3>
<p>
Written by the very creative <a href="http://www.schillmania.com/">Scott Schiller</a>, this is V1.2B. It&#8217;s got music, sound effects and slick graphics.
</p>
<h3><a href="http://www.wolf5k.com/">Wolfenstein 5k</a></h3>
<p>
Wolfenstein 5K was written for the 5k contest (looks like it&#8217;s gone now), which challenges entrants to create a web page in under 5,120 bytes.<br />
Kind of breaks in more recent browsers, but still very cool.<br />
I&#8217;ve found that it <a href="http://www.wolf5k.com/wolf5k.html">plays</a> best in Internet Explorer 6 (unfortunately), which is easy to get with<br />
<a href="http://tredosoft.com/Multiple_IE">Multiple IEs</a>.
</p>
<h3><a href="http://www.abrahamjoffe.com.au/ben/canvascape/">Canvascape &#8211; 3d walker</a></h3>
<p>
This is an oldie but a goodie. Still blows my mind. I&#8217;ve made ray-casting engines before (someday I&#8217;ll post about that), but never one with such fine-tuned math.
</p>
<h3><a href="http://worldofsolitaire.com/">World of Solitaire</a></h3>
<p>
This is a <strong>very impressive</strong>, very dynamic game written by Robert Schultz and built on <a href="http://developer.yahoo.com/yui/">YUI</a>.
</p>
<h3><a href="http://www.def-logic.com/_dhtml/darkage/index.html">Dark Age</a></h3>
<p>
This one&#8217;s really just my favorite among the numerous <a href="http://www.def-logic.com/games.html">Def-Logic games</a>.<br />
The controls unfortunately use the <code>ijkl</code> keys to move, which kind of kills most of the games for me. But they&#8217;re still visually stunning and amazingly well done.
</p>
<h3><a href="http://www.vokamis.com/products/cword/app/enterGame.php?ns=/a/a&amp;or=V&amp;h=128&amp;pub=2&amp;ex=http://www.softwaresecretweapons.com/jspwiki/Wiki.jsp?page=GangOfFourSoftwareDesignPatternsJavaScriptCrossword">GoF Software Design Patterns Crossword</a></h3>
<p>
Careful! This one&#8217;s really addictive.
</p>
<h3><a href="http://homepage.ntlworld.com/paul.wallin/projects/space/game.htm">Space Invaders</a></h3>
<p>
This is one of many projects by <a href="http://www.lukewallin.co.uk/">Luke Wallin</a>, including his<br />
<a href="http://www.lukewallin.co.uk/index.php?go=engine">Javascript 2D Game Engine</a>.<br />
I haven&#8217;t looked into it much, but it appears that the script is <a href="http://yuiblog.com/blog/2006/06/01/global-domination/">unfortunately built on globals</a> and procedural code.<br />
Please don&#8217;t look to it as an example of how to program games.
</p>
<h3><a href="http://www.3dtomb2.com/">3D TOMB II</a></h3>
<p>
This is one of the many interesting projects over at <a href="http://www.p01.org/releases/Demoscene/#productions_in_web_browsers">Mathieu Henri&#8217;s</a> website.<br />
Good stuff!
</p>
<h3>What Else?</h3>
<p>
There&#8217;s also the <a href="http://ajaxian.com/by/topic/games">Ajaxian games topic</a>, which as of this writing has over 50 posts.<br />
If you&#8217;re looking for a framework upon which to build JavaScript games, there&#8217;s the<br />
<a href="http://www.sean.co.uk/a/webdesign/javascript_gamelib/javascript_gamelib.shtm">Javascript Gamelib</a> games programming library<br />
(now featured on <a href="http://code.google.com/p/javascriptgamelib/">Google Code</a>).
</p>
<p>
I&#8217;m aware that many of these are rather old projects, but they&#8217;re new to <em>me</em> so I thought others might be interested.<br />
Do you know of any others? I know they&#8217;re out there somewhere! Please share them with us in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://scriptnode.com/article/if-you-liked-spacius/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Spacius! A Space Adventure</title>
		<link>http://scriptnode.com/article/spacius-a-space-adventure/</link>
		<comments>http://scriptnode.com/article/spacius-a-space-adventure/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 19:19:43 +0000</pubDate>
		<dc:creator>Matt Hackett</dc:creator>
				<category><![CDATA[Advanced]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[just-for-fun]]></category>
		<category><![CDATA[lab]]></category>

		<guid isPermaLink="false">http://scriptnode.com/?p=38</guid>
		<description><![CDATA[



I must have been feeling nostalgic, missing my wasted hours playing old Nintendo games as a kid, because last weekend I put together Spacius! A Space Adventure. My goal was to make a fun, simple game using only JavaScript that would work in any browser. That&#8217;s right folks, this game was made using just div [...]]]></description>
			<content:encoded><![CDATA[<p>
<a href="/lab/spacius/"><img alt="Spacius! A Space Adventure" src="/assets/img/spacius-a-space-adventure/title.gif"/></a>
</p>
<p>
I must have been feeling nostalgic, missing my wasted hours playing <a href="http://gradius.classicgaming.gamespy.com/">old Nintendo games</a> as a kid, because last weekend I put together <a href="/lab/spacius/">Spacius! A Space Adventure</a>. My goal was to make a fun, simple game using only JavaScript that would work in any browser. That&#8217;s right folks, this game was made using just <code>div</code> elements! Really, there&#8217;s nothing hardcore in here that would require <code>canvas</code>, so I guess that shouldn&#8217;t blow any minds. But this game has been tested and works in IE6, IE7, FireFox 2/3, Opera 9.5 and Safari 3.
</p>
<p>
My one cop-out was falling back on flash for the audio, but until all browsers support HTML5 (or some <a href="http://blog.nihilogic.dk/">mad genius</a> makes a JavaScript-only audio player), this is the best I could do. Spacius! uses <a href="http://www.schillmania.com/">Scott Schiller&#8217;s</a> <em>fantastic</em> <a href="http://www.schillmania.com/projects/soundmanager2/">Sound Manager 2</a> to enable sound. There&#8217;s a little latency, but it otherwise works like a charm.
</p>
<p>
<a href="/lab/spacius/"><img alt="Spacius! A Space Adventure" src="/assets/img/spacius-a-space-adventure/screenshot.gif"/></a>
</p>
<p>
One really cool thing about the way Spacius! works is that it takes the shape of its containing element. So it was really trivial to make an <a href="/lab/spacius/?width=800&amp;height=600">800&#215;600 pixel version</a>.
</p>
<p>
<strong>Here&#8217;s how to play:</strong> Press the <strong>space bar</strong> to begin the game. Use the <strong>arrow keys</strong> to move the ship. Once playing, use the <strong>space bar</strong> to shoot balls of excitement. The <strong>S</strong> key toggles sound on/off.
</p>
<p>
There are <strong>six waves</strong> in Spacius!. The last one begins at <strong>10,000 points</strong>, and it&#8217;s <em>really hard</em> so only total badasses will be able to get super high scores (yes, that&#8217;s a challenge).
</p>
<p>
Here are the <acronym title="Unidentified Flying Object">UFO</acronym> scores:
</p>
<p>
<img alt="Bomber" src="/lab/spacius/ufo_bomber.gif"/><br />
<strong>Bomber:</strong> 15 points
</p>
<p>
<img alt="Bogey" src="/lab/spacius/ufo_bogey.gif"/><br />
<strong>Bogey:</strong> 20 points
</p>
<p>
<img alt="Meteor" src="/lab/spacius/ufo_meteor.gif"/><br />
<strong>Meteor:</strong> 50 points
</p>
<p>
<img alt="Death Star" src="/lab/spacius/ufo_ds.gif"/><br />
<strong>&#8220;Death Star&#8221;:</strong> 25 points
</p>
<p>
So what&#8217;re you waiting for?? <a href="/lab/spacius/">PLAY NOW!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://scriptnode.com/article/spacius-a-space-adventure/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
	</channel>
</rss>
