<?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/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>GamesTopica.Net &#187; Coding</title>
	<atom:link href="http://www.gamestopica.net/tag/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gamestopica.net</link>
	<description>Topics and Ideas for all sort of Game Creations</description>
	<lastBuildDate>Sat, 19 Mar 2011 18:58:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Stanford&#8217;s Programming Lecture</title>
		<link>http://www.gamestopica.net/2009/06/stanfords-programming-lecture/</link>
		<comments>http://www.gamestopica.net/2009/06/stanfords-programming-lecture/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 14:30:01 +0000</pubDate>
		<dc:creator>extrakun</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Computer Games Development]]></category>
		<category><![CDATA[Games Implementation]]></category>

		<guid isPermaLink="false">http://www.gamestopica.net/?p=1051</guid>
		<description><![CDATA[<p>A lot of game developers are afraid of the big P word &#8211; &#8220;programming&#8221;, and so I find this a good introduction to programming. This is a series of lectures from the Stanford University, course CS106A, programming methodology. The emphasis is more on writing good code, understanding the basics of programming more than haxor ugly code. The lecturer is dynamic and humourous too. Take a look if you are stumped on programming, or wish you have a much better programming lecturer.</p>
<a href="http://www.gamestopica.net/2009/06/stanfords-programming-lecture/"><p><em>Click here to view the embedded video.</em></p></a>
<div style="display:block"><small><em>by Extrakun <br />&copy;2012 <a href="http://www.gamestopica.net">GamesTopica.Net</a>. All Rights Reserved.from <a href="http://www.gamestopica.net">GamesTopica.Net</a></em></small></div>]]></description>
			<content:encoded><![CDATA[<p>A lot of game developers are afraid of the big P word &#8211; &#8220;programming&#8221;, and so I find this a good introduction to programming. This is a series of lectures from the Stanford University, course CS106A, programming methodology. The emphasis is more on writing good code, understanding the basics of programming more than haxor ugly code. The lecturer is dynamic and humourous too. Take a look if you are stumped on programming, or wish you have a much better programming lecturer.</p>
<a href="http://www.gamestopica.net/2009/06/stanfords-programming-lecture/"><p><em>Click here to view the embedded video.</em></p></a>
]]></content:encoded>
			<wfw:commentRss>http://www.gamestopica.net/2009/06/stanfords-programming-lecture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detecting the end of a movie clip in AS3</title>
		<link>http://www.gamestopica.net/2009/04/detecting-the-end-of-a-movie-clip-in-as3/</link>
		<comments>http://www.gamestopica.net/2009/04/detecting-the-end-of-a-movie-clip-in-as3/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 08:21:41 +0000</pubDate>
		<dc:creator>extrakun</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Computer Games Development]]></category>
		<category><![CDATA[Games Implementation]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://www.gamestopica.net/?p=773</guid>
		<description><![CDATA[<p>Sometimes you want to play a sequence of animation using movie-clips &#8211; this implies that you need to detect when is the end of the clip in question. You can place a variable inside the movie clip inside, but with ActionScript 3 there is another solution &#8211; using the enter frame event of the movie clip to run a function, which then proceed to check if the movie clip has reached its final frame (or any frame, for that matter). <a href="http://www.flashandmath.com/intermediate/externalclips/ext_clip2.html" target="_blank">This solution is discussed at the lower half of the article at Flash&amp;Math.</a></p>
<p>With some work, one should be able to write an observer pattern for this.</p>
<div style="display:block"><small><em>by Extrakun <br />&copy;2012 <a href="http://www.gamestopica.net">GamesTopica.Net</a>. All Rights Reserved.from <a href="http://www.gamestopica.net">GamesTopica.Net</a></em></small></div>]]></description>
			<content:encoded><![CDATA[<p>Sometimes you want to play a sequence of animation using movie-clips &#8211; this implies that you need to detect when is the end of the clip in question. You can place a variable inside the movie clip inside, but with ActionScript 3 there is another solution &#8211; using the enter frame event of the movie clip to run a function, which then proceed to check if the movie clip has reached its final frame (or any frame, for that matter). <a href="http://www.flashandmath.com/intermediate/externalclips/ext_clip2.html" target="_blank">This solution is discussed at the lower half of the article at Flash&amp;Math.</a></p>
<p>With some work, one should be able to write an observer pattern for this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gamestopica.net/2009/04/detecting-the-end-of-a-movie-clip-in-as3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More Normal Distribution and Statistic Aids for C#</title>
		<link>http://www.gamestopica.net/2009/04/more-normal-distribution-and-statistic-aids-for-c/</link>
		<comments>http://www.gamestopica.net/2009/04/more-normal-distribution-and-statistic-aids-for-c/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 11:44:52 +0000</pubDate>
		<dc:creator>extrakun</dc:creator>
				<category><![CDATA[Computer Games Development]]></category>
		<category><![CDATA[Engines and Libraries]]></category>
		<category><![CDATA[Games Implementation]]></category>
		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.gamestopica.net/?p=703</guid>
		<description><![CDATA[<p>If you need a Math Library for C# which can do statistic calculations and plot values of various graphs and curves, there is the <a href="http://www.extremeoptimization.com/" target="_blank">Extreme Optimization Math Library</a> contains a full suite of function for those who wants something ready to go.</p>
<p>Meanwhile, over at the <a href="http://lostsouls.org/grimoire_diminishing_returns" target="_blank">LS Grimorie</a>, you can find a way to implement a simple yet effective diminishing return function.</p>
<div style="display:block"><small><em>by Extrakun <br />&copy;2012 <a href="http://www.gamestopica.net">GamesTopica.Net</a>. All Rights Reserved.from <a href="http://www.gamestopica.net">GamesTopica.Net</a></em></small></div>]]></description>
			<content:encoded><![CDATA[<p>If you need a Math Library for C# which can do statistic calculations and plot values of various graphs and curves, there is the <a href="http://www.extremeoptimization.com/" target="_blank">Extreme Optimization Math Library</a> contains a full suite of function for those who wants something ready to go.</p>
<p>Meanwhile, over at the <a href="http://lostsouls.org/grimoire_diminishing_returns" target="_blank">LS Grimorie</a>, you can find a way to implement a simple yet effective diminishing return function.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gamestopica.net/2009/04/more-normal-distribution-and-statistic-aids-for-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XNACommunity releases sources for their games</title>
		<link>http://www.gamestopica.net/2009/04/xnacommunity-releases-sources-for-their-games/</link>
		<comments>http://www.gamestopica.net/2009/04/xnacommunity-releases-sources-for-their-games/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 07:04:33 +0000</pubDate>
		<dc:creator>extrakun</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Computer Games Development]]></category>
		<category><![CDATA[Games Implementation]]></category>
		<category><![CDATA[Indie Games]]></category>

		<guid isPermaLink="false">http://www.gamestopica.net/?p=696</guid>
		<description><![CDATA[<p><a href="http://xnacommunity.codeplex.com/Wiki/View.aspx?title=Juegos&amp;referringTitle=Home" target="_blank">XNACommunity</a> has released the source code to a couple of full featured games, such as a 3D hack/slash style RPG known as Dungeon Sorrows, a 2d scrolling game, a Guitar Hero clone and more besides. Want to see how those games are done, and perhaps learn a few new techniques at the same time? Head over and find out then!</p>
<div id="attachment_697" class="wp-caption aligncenter" style="width: 212px"><a href="http://www.gamestopica.net/wordpress/wp-content/uploads/2009/04/mini_dungeonsorrows_screenshot3.jpg"><img class="size-full wp-image-697" title="Dungeon Sorrow" src="http://www.gamestopica.net/wordpress/wp-content/uploads/2009/04/mini_dungeonsorrows_screenshot3.jpg" alt="Dungeon Sorrow" width="202" height="158" /></a><p class="wp-caption-text">Dungeon Sorrow</p></div>
<div id="attachment_698" class="wp-caption aligncenter" style="width: 212px"><a href="http://www.gamestopica.net/wordpress/wp-content/uploads/2009/04/mini_xnarock_screenshot4.jpg"><img class="size-full wp-image-698" title="XNA_Rock" src="http://www.gamestopica.net/wordpress/wp-content/uploads/2009/04/mini_xnarock_screenshot4.jpg" alt="XNA Rock" width="202" height="158" /></a><p class="wp-caption-text">XNA Rock</p></div>
<div style="display:block"><small><em>by Extrakun <br />&copy;2012 <a href="http://www.gamestopica.net">GamesTopica.Net</a>. All Rights Reserved.from <a href="http://www.gamestopica.net">GamesTopica.Net</a></em></small></div>]]></description>
			<content:encoded><![CDATA[<p><a href="http://xnacommunity.codeplex.com/Wiki/View.aspx?title=Juegos&amp;referringTitle=Home" target="_blank">XNACommunity</a> has released the source code to a couple of full featured games, such as a 3D hack/slash style RPG known as Dungeon Sorrows, a 2d scrolling game, a Guitar Hero clone and more besides. Want to see how those games are done, and perhaps learn a few new techniques at the same time? Head over and find out then!</p>
<div id="attachment_697" class="wp-caption aligncenter" style="width: 212px"><a href="http://www.gamestopica.net/wordpress/wp-content/uploads/2009/04/mini_dungeonsorrows_screenshot3.jpg"><img class="size-full wp-image-697" title="Dungeon Sorrow" src="http://www.gamestopica.net/wordpress/wp-content/uploads/2009/04/mini_dungeonsorrows_screenshot3.jpg" alt="Dungeon Sorrow" width="202" height="158" /></a><p class="wp-caption-text">Dungeon Sorrow</p></div>
<div id="attachment_698" class="wp-caption aligncenter" style="width: 212px"><a href="http://www.gamestopica.net/wordpress/wp-content/uploads/2009/04/mini_xnarock_screenshot4.jpg"><img class="size-full wp-image-698" title="XNA_Rock" src="http://www.gamestopica.net/wordpress/wp-content/uploads/2009/04/mini_xnarock_screenshot4.jpg" alt="XNA Rock" width="202" height="158" /></a><p class="wp-caption-text">XNA Rock</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.gamestopica.net/2009/04/xnacommunity-releases-sources-for-their-games/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Normal Distribution Class for C#</title>
		<link>http://www.gamestopica.net/2009/04/normal-distribution-class-for-c/</link>
		<comments>http://www.gamestopica.net/2009/04/normal-distribution-class-for-c/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 18:45:07 +0000</pubDate>
		<dc:creator>extrakun</dc:creator>
				<category><![CDATA[Computer Games Development]]></category>
		<category><![CDATA[Engines and Libraries]]></category>
		<category><![CDATA[Games Implementation]]></category>
		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.gamestopica.net/?p=679</guid>
		<description><![CDATA[<p>If you are building a simulation game, chances are that you would need distribution graphs of all types &#8211; linear, diminishing returns, increasing returns and the good old normal distribution. Coding one would take some time and here&#8217;s a pretty good implementation over at <a href="http://www.centerspace.net/resources.php" target="_blank">CenterSpace</a>. It&#8217;s a simple class to use &#8212; check out the example included.</p>
<div style="display:block"><small><em>by Extrakun <br />&copy;2012 <a href="http://www.gamestopica.net">GamesTopica.Net</a>. All Rights Reserved.from <a href="http://www.gamestopica.net">GamesTopica.Net</a></em></small></div>]]></description>
			<content:encoded><![CDATA[<p>If you are building a simulation game, chances are that you would need distribution graphs of all types &#8211; linear, diminishing returns, increasing returns and the good old normal distribution. Coding one would take some time and here&#8217;s a pretty good implementation over at <a href="http://www.centerspace.net/resources.php" target="_blank">CenterSpace</a>. It&#8217;s a simple class to use &#8212; check out the example included.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gamestopica.net/2009/04/normal-distribution-class-for-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Visitor Pattern in C#</title>
		<link>http://www.gamestopica.net/2009/01/the-visitor-pattern-in-c/</link>
		<comments>http://www.gamestopica.net/2009/01/the-visitor-pattern-in-c/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 07:00:23 +0000</pubDate>
		<dc:creator>extrakun</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Games Implementation]]></category>
		<category><![CDATA[patterns]]></category>

		<guid isPermaLink="false">http://www.gamestopica.net/?p=280</guid>
		<description><![CDATA[<p>Sometimes in an arcade game where you have different types of entities, the most difficult part is to resolve the collision. Nope, the issue is not <em>detecting collision</em> (which is already one big headache by itself), but rather &#8211; &#8220;So something did collide; so what&#8217;s next?&#8221;<br />
<span id="more-280"></span></p>
<p>There are two questions to this:</p>
<ol>
<li>Who hit me?</li>
<li>Knowing who hit me, what do I do next?</li>
</ol>
<p>Of course, you could use RTTI to figure that out and resolve that (<a href="http://www.allegro.cc/forums/thread/226837" target="_blank">here&#8217;s an article on RTTI</a>). However, for those who prefer not to, you can use the visitor pattern as described in a <a href="http://www.gamestopica.net/2009/01/collision-handling-using-double-dispatch/" target="_blank">previous post on double dispatch</a> to implement this. Here is a C# sample which you can download to see how it works. There will be more coming later on how it works and some pitfalls to look out for.<a href="http://www.gamestopica.net/wordpress/wp-content/uploads/2009/01/visitortest.rar"> You can download the C# Sample of the Vistior Pattern from this link.</a></p>
<h2>Double Dispatch?</h2>
<p>Here&#8217;s the &#8220;un-computer science&#8221; explanation of double dispatch. C++ and C# are languages which support polymorphic functions (or virtual functions). This means that methods (or member functions, according to C++) are resolved at the run-time at object level. This is the basic premise of polymorphism (you can find more details at <a href="http://www.dotnetuncle.com/csharp/123_polymorphism.aspx" target="_blank">DotNetUncle</a>).</p>
<p>The issue is that there is no polymorphism at the function signature level; this means that suppose you have an abstract class called Entity. You have a whole hierarchy of objects, such as Missile, Asteriod and Ship. If you have a function which says have the signature CollideWith(Entity e), and the various variants &#8211; CollideWith(Asteriod a), CollideWith(Ship s) and CollideWith(Missile m), CollideWith(Entity e) would always be called if you do not cast the object to the child. (Sucky explanation, I know. I&#8217;ll try to come up with a detailed example).</p>
<h2>Other readings</h2>
<p>Other places on the Internet has grappled with resolving collision resolving in an OO manner too, such as <a href="http://www.gamedev.net/community/forums/topic.asp?topic_id=330048" target="_blank">this forum post on a GameDev.Net forum.</a></p>
<div style="display:block"><small><em>by Extrakun <br />&copy;2012 <a href="http://www.gamestopica.net">GamesTopica.Net</a>. All Rights Reserved.from <a href="http://www.gamestopica.net">GamesTopica.Net</a></em></small></div>]]></description>
			<content:encoded><![CDATA[<p>Sometimes in an arcade game where you have different types of entities, the most difficult part is to resolve the collision. Nope, the issue is not <em>detecting collision</em> (which is already one big headache by itself), but rather &#8211; &#8220;So something did collide; so what&#8217;s next?&#8221;<br />
<span id="more-280"></span></p>
<p>There are two questions to this:</p>
<ol>
<li>Who hit me?</li>
<li>Knowing who hit me, what do I do next?</li>
</ol>
<p>Of course, you could use RTTI to figure that out and resolve that (<a href="http://www.allegro.cc/forums/thread/226837" target="_blank">here&#8217;s an article on RTTI</a>). However, for those who prefer not to, you can use the visitor pattern as described in a <a href="http://www.gamestopica.net/2009/01/collision-handling-using-double-dispatch/" target="_blank">previous post on double dispatch</a> to implement this. Here is a C# sample which you can download to see how it works. There will be more coming later on how it works and some pitfalls to look out for.<a href="http://www.gamestopica.net/wordpress/wp-content/uploads/2009/01/visitortest.rar"> You can download the C# Sample of the Vistior Pattern from this link.</a></p>
<h2>Double Dispatch?</h2>
<p>Here&#8217;s the &#8220;un-computer science&#8221; explanation of double dispatch. C++ and C# are languages which support polymorphic functions (or virtual functions). This means that methods (or member functions, according to C++) are resolved at the run-time at object level. This is the basic premise of polymorphism (you can find more details at <a href="http://www.dotnetuncle.com/csharp/123_polymorphism.aspx" target="_blank">DotNetUncle</a>).</p>
<p>The issue is that there is no polymorphism at the function signature level; this means that suppose you have an abstract class called Entity. You have a whole hierarchy of objects, such as Missile, Asteriod and Ship. If you have a function which says have the signature CollideWith(Entity e), and the various variants &#8211; CollideWith(Asteriod a), CollideWith(Ship s) and CollideWith(Missile m), CollideWith(Entity e) would always be called if you do not cast the object to the child. (Sucky explanation, I know. I&#8217;ll try to come up with a detailed example).</p>
<h2>Other readings</h2>
<p>Other places on the Internet has grappled with resolving collision resolving in an OO manner too, such as <a href="http://www.gamedev.net/community/forums/topic.asp?topic_id=330048" target="_blank">this forum post on a GameDev.Net forum.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gamestopica.net/2009/01/the-visitor-pattern-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Collision Handling using Double Dispatch</title>
		<link>http://www.gamestopica.net/2009/01/collision-handling-using-double-dispatch/</link>
		<comments>http://www.gamestopica.net/2009/01/collision-handling-using-double-dispatch/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 06:48:05 +0000</pubDate>
		<dc:creator>extrakun</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Games Implementation]]></category>
		<category><![CDATA[patterns]]></category>

		<guid isPermaLink="false">http://gamestopica.net/?p=225</guid>
		<description><![CDATA[<p>A type-safe, object oriented method of resolving the aftermaths of a collision detection using <a href="http://wiki.ahnfelt.dk/DoubleDispatch.html" target="_blank">double-dispatch</a>.</p>
<div style="display:block"><small><em>by Extrakun <br />&copy;2012 <a href="http://www.gamestopica.net">GamesTopica.Net</a>. All Rights Reserved.from <a href="http://www.gamestopica.net">GamesTopica.Net</a></em></small></div>]]></description>
			<content:encoded><![CDATA[<p>A type-safe, object oriented method of resolving the aftermaths of a collision detection using <a href="http://wiki.ahnfelt.dk/DoubleDispatch.html" target="_blank">double-dispatch</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gamestopica.net/2009/01/collision-handling-using-double-dispatch/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Lengthy Discussion on Gravity</title>
		<link>http://www.gamestopica.net/2009/01/a-lengthy-discussion-on-gravity-and-flash/</link>
		<comments>http://www.gamestopica.net/2009/01/a-lengthy-discussion-on-gravity-and-flash/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 14:22:53 +0000</pubDate>
		<dc:creator>extrakun</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Games Implementation]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://gamestopica.net/?p=103</guid>
		<description><![CDATA[<p>Doing a platformer in Flash can become rather hairy if you consider the physics and gravity involved. Don&#8217;t lose hair over it without checking out this discussion on <a href="http://www.kirupa.com/forum/showthread.php?t=78538" target="_blank">Kirpua about programming platform games physics and gravity</a>.</p>
<div style="display:block"><small><em>by Extrakun <br />&copy;2012 <a href="http://www.gamestopica.net">GamesTopica.Net</a>. All Rights Reserved.from <a href="http://www.gamestopica.net">GamesTopica.Net</a></em></small></div>]]></description>
			<content:encoded><![CDATA[<p>Doing a platformer in Flash can become rather hairy if you consider the physics and gravity involved. Don&#8217;t lose hair over it without checking out this discussion on <a href="http://www.kirupa.com/forum/showthread.php?t=78538" target="_blank">Kirpua about programming platform games physics and gravity</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gamestopica.net/2009/01/a-lengthy-discussion-on-gravity-and-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

