<?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>selene tan &#187; debugging</title>
	<atom:link href="http://selenetan.com/tag/debugging/feed/" rel="self" type="application/rss+xml" />
	<link>http://selenetan.com</link>
	<description>reaching for the moon and sky</description>
	<lastBuildDate>Wed, 16 Feb 2011 06:22:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Fixed bugs in SEEK*TOR</title>
		<link>http://selenetan.com/2009/12/fixed-bugs-in-seektor/</link>
		<comments>http://selenetan.com/2009/12/fixed-bugs-in-seektor/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 04:57:00 +0000</pubDate>
		<dc:creator>selene</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[seektor]]></category>

		<guid isPermaLink="false">http://selenetan.com/?p=59</guid>
		<description><![CDATA[I finally tracked down the bug in SEEK*TOR that sometimes makes the red enemy square (and some of the ally turrets) unclickable. While I was at it, I squashed a few more bugs I found along the way.Play SEEK*TOR v 1.2 Changes in this version: Fixes bug where the upper-left turret is unclickable Fixes bug [...]]]></description>
			<content:encoded><![CDATA[<p><span>I <b>finally</b> tracked down the bug in SEEK*TOR that sometimes makes the red  enemy square (and some of the ally turrets) unclickable. While I was at it, I squashed a few more bugs I found along the way.</span><br /><span><br /></span><br /><span><a href="http://selenetan.com/games/seektor/bugfix20091219/">Play SEEK*TOR v 1.2</a></span></p>
<p><span>Changes in this version:</span>
<ol>
<li>Fixes bug where the upper-left turret is unclickable</li>
<li>Fixes bug where sometimes the red enemy square is unclickable</li>
<li>Fixes bug where on very high levels, the level never starts</li>
<li>Turns off debug flag so turret layouts are randomized between 4  choices instead of just one</li>
<li>Background music now loops</li>
</ol>
<p>So what caused the unclickable-things bug, and how did I track it down?</p>
<p>With the help of debug output, I discovered that when a turret or enemy was unclickable, it was because something else on the screen &#8220;stole&#8221; the click event. In the unclickable upper-left turret bug, the click event was going to the flare display in the upper-left. In the unclickable enemy square bug, the click event was going to an object with a name like SpriteXXX. XXX was a number that was larger the later in the game the bug appeared.</p>
<p>The object name was my biggest clue. The number meant that it was a sprite that was created every level. The turrets are created anew every level, but they show up as TurretXXX. So I combed through the code until I found a sprite that was being created every level.</p>
<p>The sprite I found was the little explosion graphic that shows when you click on the enemy turret. In my competition-driven haste, I&#8217;d written code that created a new sprite every time the explosion went off, and didn&#8217;t bother to make it unclickable, or remove it from the stage afterward.&nbsp; To fix the bug, I modified the code so that it created the explosion sprite only once and reused it every level, and I made sure the sprite was unclickable. That fixed the bug.</p>
]]></content:encoded>
			<wfw:commentRss>http://selenetan.com/2009/12/fixed-bugs-in-seektor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

