<?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>nathandemick.com &#187; shmupp</title>
	<atom:link href="http://nathandemick.com/tags/shmupp/feed/" rel="self" type="application/rss+xml" />
	<link>http://nathandemick.com</link>
	<description></description>
	<lastBuildDate>Sat, 28 Aug 2010 00:13:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Gannroids</title>
		<link>http://nathandemick.com/2008/11/gannroids/</link>
		<comments>http://nathandemick.com/2008/11/gannroids/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 19:26:41 +0000</pubDate>
		<dc:creator>Tyler</dc:creator>
				<category><![CDATA[games]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[shmupp]]></category>

		<guid isPermaLink="false">http://www.bitter-gamer.com/?p=146</guid>
		<description><![CDATA[Ganndroids summary]]></description>
			<content:encoded><![CDATA[<p>In the breaks I have at work I downloaded and installed Adobe&#8217;s CS4 software and decided that I would make a quick little prototype game just to learn about ActionScript 3.0 and CS4.  I did what I usually do which is to make an Asteroids clone.  This time the theme would be one of my co-workers; I wanted to blow up his head, what can I say? *grin*  The collision is a little funky due to my sloppiness/laziness but I&#8217;m satisfied for the amount of time I put into it; which I would say perhaps 12 hours over a week and a half.  Most of the time was spent learning ActionScript idiosyncrasies.  Here is the result:</p>
<p>For some reason the transparent pixels wouldn&#8217;t save when I uploaded to WordPress, so you get square heads.</p>
<p><a title="Gannroids" href="http://www.bitter-gamer.com/wp-content/uploads/2008/11/jeffroids.swf" target="_blank">Gannroids</a></p>
<p>CS4 has some interesting features.  One can enter media objects onto the stage and bind them to a keyword and ActionScript file.  Its seems cool at first and really easy, however it only seems useful if you have one or a few instances of a class.  For the most part I just bound the stage to my game.as file and let game.as handle everything.  I created classes for Asteroids and Bullets to learn how to do class work in ActionScript and I ran into a few problems but for the most part everything was seamless.  (As seamless as it can be writing anything in a new language).</p>
<p>To look at some specific problems I encountered, continue reading.</p>
<p><span id="more-146"></span></p>
<p>Here are the problems some encountered in no specific order:</p>
<p>1 &#8211; Getting graphics objects to be included in the .swf.  I never really came up with a solution, my image for asteroids is externally loaded.  I&#8217;m sure there is a way to embed graphics in the .swf and call it programatically, similar to how you can bind a symbol to a keyword I&#8217;m sure you can bind an image to a keyword to access in the code.</p>
<p>2 &#8211; Keeping track of things in the DisplayList.  I spent a large portion of my time here trying to figure out how to cast things into the type of objects I needed them to be and figure out the correct depths of the DisplayList.  In the end I ended up just going through every object in the display list and checking its object type if I needed to modify an object that I was using.  In other programming languages I wrote my own draw functions so I would just have a Vector containing all my objects that I had created and draw that Vector.  The DisplayList is a very similar implementation however it seemed I had less control.  I probably just don&#8217;t know the ins and outs of the DisplayList class and that will come with time I&#8217;m sure.</p>
<p>3 &#8211; Collision detection.  I had all sorts of problems with positioning.  The default x and y properties inherent in a DisplayObject were acting strangely so I ended up adding my own properties for x and y, which in turn caused problems with display and later with the collision calculation.  If I were to go back I would make sure to use the default x and y property better.</p>
<p>4 &#8211; Image centering.  One can set a registration point on a symbol in CS4 and it will set the axis of rotation (center preferably)  I could not figure out how to do this programaticlly with a property so I created a Sprite container and put an image loader object inside it and offset x and y by -imageWidth/2 (thanks Nathan)  This was another thing causing collision issues, I had multiple objects using different x/y&#8217;s and then images that were rotating were offset and I would forget what was using what.  It was close enough in the end and I was too tired to track down what was wrong with it.  Next version of anything I do I will pay more attention upfront to draw/x/y coordinates.</p>
<p>Overall the experience was good, I feel comfortable enough with ActionScript now and delved a little into CS4.</p>
]]></content:encoded>
			<wfw:commentRss>http://nathandemick.com/2008/11/gannroids/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
