<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Jayc Santos</title>
	
	<link>http://jaycsantos.com</link>
	<description>Games, Development, Blog</description>
	<lastBuildDate>Wed, 21 Oct 2009 16:05:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/Jaycsantos" type="application/rss+xml" /><feedburner:emailServiceId>Jaycsantos</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FJaycsantos" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FJaycsantos" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2FJaycsantos" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/Jaycsantos" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FJaycsantos" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FJaycsantos" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FJaycsantos" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>JCustom Mod Details Page &amp; Sales Poll</title>
		<link>http://feedproxy.google.com/~r/Jaycsantos/~3/Ae0xfPeH2dI/</link>
		<comments>http://jaycsantos.com/news/jcustom-mod-details-page-sales-poll/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 16:05:25 +0000</pubDate>
		<dc:creator>Jayc Santos</dc:creator>
				<category><![CDATA[JCustom Mod]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[arcadem pro]]></category>
		<category><![CDATA[custom something]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[website news]]></category>

		<guid isPermaLink="false">http://jaycsantos.com/?p=527</guid>
		<description><![CDATA[Just finished it, the detailed pages of my arcadem pro mod jcustom mod are up and running with initial contents.
JCustom Mod details page


I&#8217;ll be writting more info about it soon especially filling up a proper documentation for other developers and will be updating it&#8217;s contents as progress goes by too. I also opened comments so [...]]]></description>
			<content:encoded><![CDATA[<p>Just finished it, the detailed pages of my arcadem pro mod jcustom mod are up and running with initial contents.</p>
<p><strong><a href="http://jaycsantos.com/jcustom-mod/">JCustom Mod details page<br />
</a></strong></p>
<p style="text-align: center;">
<div id="attachment_530" class="wp-caption aligncenter" style="width: 358px"><a href="http://jaycsantos.com/jcustom-mod/"><img class="size-full wp-image-530" title="Custom Car" src="http://jaycsantos.com/uploads/2009/10/custom_car.jpg" alt="We likez to muztomize yuor stufz" width="348" height="288" /></a><p class="wp-caption-text">We likez to muztomize yuor stufz</p></div>
<p>I&#8217;ll be writting more info about it soon especially filling up a proper documentation for other developers and will be updating it&#8217;s contents as progress goes by too. I also opened <a href="http://jaycsantos.com/jcustom-mod/#comments">comments</a> so feedbacks are very welcome.</p>
<p>Now the main question left are, is it for sale? for how much? My answer to that will arrive in a few moments, for now I have put up a poll so please vote of what you think. I&#8217;ll put up the price depending on poll results and especially people&#8217;s interest. <strong><a href="http://jaycsantos.com/jcustom-mod/#poll">Vote on the poll here</a></strong>.</p>
<div id="attachment_531" class="wp-caption aligncenter" style="width: 538px"><a href="http://jaycsantos.com/jcustom-mod/#poll"><img class="size-full wp-image-531" title="Penguin" src="http://jaycsantos.com/uploads/2009/10/penguin.jpg" alt="We need your opinion, what you say?" width="528" height="350" /></a><p class="wp-caption-text">We hear what you say</p></div>

<p><a href="http://feedads.g.doubleclick.net/~a/G75NIBnxk-5-XuIhcfEEXNEdc3E/0/da"><img src="http://feedads.g.doubleclick.net/~a/G75NIBnxk-5-XuIhcfEEXNEdc3E/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/G75NIBnxk-5-XuIhcfEEXNEdc3E/1/da"><img src="http://feedads.g.doubleclick.net/~a/G75NIBnxk-5-XuIhcfEEXNEdc3E/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=Ae0xfPeH2dI:K4HRlZSOcts:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?i=Ae0xfPeH2dI:K4HRlZSOcts:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=Ae0xfPeH2dI:K4HRlZSOcts:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=Ae0xfPeH2dI:K4HRlZSOcts:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?i=Ae0xfPeH2dI:K4HRlZSOcts:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=Ae0xfPeH2dI:K4HRlZSOcts:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?i=Ae0xfPeH2dI:K4HRlZSOcts:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://jaycsantos.com/news/jcustom-mod-details-page-sales-poll/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jaycsantos.com/news/jcustom-mod-details-page-sales-poll/</feedburner:origLink></item>
		<item>
		<title>Portfolio: Hidden Ninja Games</title>
		<link>http://feedproxy.google.com/~r/Jaycsantos/~3/oNglSVYUv1k/</link>
		<comments>http://jaycsantos.com/news/portfolio-hidden-ninja-games/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 17:00:49 +0000</pubDate>
		<dc:creator>Jayc Santos</dc:creator>
				<category><![CDATA[JCustom Mod]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[arcadem pro]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://jaycsantos.com/?p=488</guid>
		<description><![CDATA[Here is another website to be added to my portfolio, HiddenNinjaGames.com.
The website is owned by a friend and young flash game developer, Eric Smith. Running the website HiddenNinjaGames.com reflects that it is not just a ninja but is hidden and playing games or something of the like.
Basically the website is powered by Arcadem Pro but [...]]]></description>
			<content:encoded><![CDATA[<p>Here is another website to be added to my portfolio, <a href="http://hiddenninjagames.com/" target="_blank">HiddenNinjaGames.com</a>.</p>
<p>The website is owned by a friend and young flash game developer, Eric Smith. Running the website HiddenNinjaGames.com reflects that it is not just a ninja but is hidden and playing games or something of the like.</p>
<p>Basically the website is powered by <a rel="external nofollow" href="https://secure.agaresmedia.com/v6/products/arcade-script/" target="_blank">Arcadem Pro</a> but is now supported by the newly developed <a href="http://jaycsantos.com/category/web-dev/jcustom-mod/" target="_blank">JCustom Mod</a> that I made. Obviously it no longer looks like another generic arcadem template, now this site probably is the most unique design and probably has the most functionality (both according to me <img src='http://jaycsantos.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ) from other sites running the same script/cms engine.</p>
<div id="attachment_489" class="wp-caption aligncenter" style="width: 610px"><img class="size-full wp-image-489" title="Hidden Ninja Games" src="http://jaycsantos.com/uploads/2009/09/portfolio-hng-post.jpg" alt="The New HiddenNinjaGames.com brought to you by your friendly neighborhood developer" width="600" height="400" /><p class="wp-caption-text">The New HiddenNinjaGames.com brought to you by your friendly neighborhood developer</p></div>
<p>By running the mod system, the back end is easily managed and updated by the administrator even with out any knowledge of the scripting language (php). The user front end is also fantastically dynamic taking advantage of the newest technologies of Web 2.0. For developers, the mod system is also in efficient coding manner where as extending and plugging into already available features is like a feast of mixing drinks.</p>
<p>Take a peak into <a href="http://hiddenninjagames.com/" target="_blank">Hidden Ninja Games</a> we know you&#8217;ll like it. <img src='http://jaycsantos.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>

<p><a href="http://feedads.g.doubleclick.net/~a/vJ_HCUVVL1q6gmfypCaZHt7vh8M/0/da"><img src="http://feedads.g.doubleclick.net/~a/vJ_HCUVVL1q6gmfypCaZHt7vh8M/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/vJ_HCUVVL1q6gmfypCaZHt7vh8M/1/da"><img src="http://feedads.g.doubleclick.net/~a/vJ_HCUVVL1q6gmfypCaZHt7vh8M/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=oNglSVYUv1k:UlYYmlnlSEg:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?i=oNglSVYUv1k:UlYYmlnlSEg:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=oNglSVYUv1k:UlYYmlnlSEg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=oNglSVYUv1k:UlYYmlnlSEg:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?i=oNglSVYUv1k:UlYYmlnlSEg:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=oNglSVYUv1k:UlYYmlnlSEg:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?i=oNglSVYUv1k:UlYYmlnlSEg:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://jaycsantos.com/news/portfolio-hidden-ninja-games/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://jaycsantos.com/news/portfolio-hidden-ninja-games/</feedburner:origLink></item>
		<item>
		<title>Still Alive &amp; The Mod System for Arcade</title>
		<link>http://feedproxy.google.com/~r/Jaycsantos/~3/XBDnUaZeht8/</link>
		<comments>http://jaycsantos.com/news/still-alive-the-mod-system-for-arcade/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 07:26:23 +0000</pubDate>
		<dc:creator>Jayc Santos</dc:creator>
				<category><![CDATA[JCustom Mod]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[arcadem pro]]></category>
		<category><![CDATA[custom something]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://jaycsantos.com/?p=481</guid>
		<description><![CDATA[Hello all! Its been a long time, roughly 94 days since my last post (on my own site!). I&#8217;m breaking the silence now that I wasn&#8217;t just on vacation, sleeping all day or doing nothing. I am currently working on a Mod system, you heard it right, a modification and its a system.
I have a [...]]]></description>
			<content:encoded><![CDATA[<p>Hello all! Its been a long time, roughly 94 days since my last post (on my own site!). I&#8217;m breaking the silence now that I wasn&#8217;t just on vacation, sleeping all day or doing nothing. I am currently working on a Mod system, you heard it right, a modification and its a system.</p>
<div id="attachment_482" class="wp-caption alignright" style="width: 144px"><img class="size-full wp-image-482" title="JCustomMod Screen Shot" src="http://jaycsantos.com/uploads/2009/07/screen1.jpg" alt="Added Admin Menu" width="134" height="100" /><p class="wp-caption-text">Added Admin Menu</p></div>
<p>I have a friend who has a website (a game arcade site, and it&#8217;s powered by <a rel="external nofollow" href="https://secure.agaresmedia.com/v6/products/arcade-script/" target="_blank">Arcadem Pro</a>) who asked me to redesign his site. It is really tough to redesign something good especially great from their architecture (specifically coding structure, <em>no offense meant</em>), no wonder I can easily know which site uses the same arcade script just by looking at the generic layout design. Of course I wouldn&#8217;t want to dramatically edit all specific files on the site just to apply a single Mod, so I decided to make a subsystem for mods of my own (well I called it a &#8220;system&#8221; as I like it better than &#8220;subsystem&#8221;).</p>
<h3>JCustom Mod System</h3>
<p>It&#8217;s basically a bunch of files and folders that you add to your site. And by just opening a single page, you&#8217;ll be presented a user friendly way of installing it. After installation, a new menu will be available on the admin panel, yeah it&#8217;s that simple! It&#8217;s a mod that doesn&#8217;t ask you to modify your files manually. <img src='http://jaycsantos.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><span id="more-481"></span></p>
<p>The system is actually just complex container with quite a few built in improved features, all the power feature you would need will be from the <strong>plugins</strong>. Oh yeah, I&#8217;m developing the plugins myself and it&#8217;s all a natural for me to be excited about it. I really am learning a heck of cool stuffs with php and other web stuffs while developing all these. Plugins are installed without sweat, just upload and install from the admin panel.</p>
<h4>Plugins</h4>
<ol>
<li>Ajax Favorite &#8211; <em>add games into favorites without leaving/refreshing the page (ajax power)</em></li>
<li>Ajax Login -<em> log in and out without having to refresh the page</em></li>
<li>Game Meta &#8211; <em>store more information for your games</em></li>
<li>Game Publish Scheduler &#8211; <em>by schedule publish your games automatically</em></li>
<li>Game Ratings &#8211; <em>rate games, ajax way, in a whole new level</em></li>
<li>High Scores &#8211; <em>integrates <a rel="external nofollow" href="http://www.mochimedia.com/publishers/bridge.html" target="_blank">mochi bridge</a> beautifully ajax style; also backward compatible</em></li>
<li>More Comment &#8211; <em>not just have a single comment, have indefinite sub comment systems ajax style too</em></li>
<li>User Meta -<em> store more information for your users</em></li>
</ol>
<h4>Screen shots</h4>
<div style="overflow:hidden">
<div id="attachment_484" class="wp-caption alignleft" style="width: 150px"><a href="http://jaycsantos.com/uploads/2009/07/screen3.jpg"  onclick="return false"><img id="img_481_screen3_jpg" class="size-thumbnail wp-image-484" title="JCustomMod Screen Shot" src="http://jaycsantos.com/uploads/2009/07/screen3-140x105.jpg" alt="JCustomMod Screen Shot 1" width="140" height="105"onclick="enlarge(this)" longdesc="http://jaycsantos.com/uploads/2009/07/screen3.jpg" /></a><p class="wp-caption-text"> </p></div>
<div id="attachment_483" class="wp-caption alignleft" style="width: 150px"><a href="http://jaycsantos.com/uploads/2009/07/screen2.jpg"  onclick="return false"><img id="img_481_screen2_jpg" class="size-thumbnail wp-image-483" title="JCustomMod Screen Shot" src="http://jaycsantos.com/uploads/2009/07/screen2-140x105.jpg" alt="JCustomMod Screen Shot 2" width="140" height="105"onclick="enlarge(this)" longdesc="http://jaycsantos.com/uploads/2009/07/screen2.jpg" /></a><p class="wp-caption-text"> </p></div>
</div>
<p>This system is in consideration of being for sale in public or for commission only same with the plugins separately or bundled or whatever.</p>
<hr />Interested? Have your own arcadem arcade site you want to improve? Drop me a line and we can discuss things.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/HJaNshcAmnMGuekmFFLid80edvw/0/da"><img src="http://feedads.g.doubleclick.net/~a/HJaNshcAmnMGuekmFFLid80edvw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/HJaNshcAmnMGuekmFFLid80edvw/1/da"><img src="http://feedads.g.doubleclick.net/~a/HJaNshcAmnMGuekmFFLid80edvw/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=XBDnUaZeht8:-mp7wCF10bk:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?i=XBDnUaZeht8:-mp7wCF10bk:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=XBDnUaZeht8:-mp7wCF10bk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=XBDnUaZeht8:-mp7wCF10bk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?i=XBDnUaZeht8:-mp7wCF10bk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=XBDnUaZeht8:-mp7wCF10bk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?i=XBDnUaZeht8:-mp7wCF10bk:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://jaycsantos.com/news/still-alive-the-mod-system-for-arcade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jaycsantos.com/news/still-alive-the-mod-system-for-arcade/</feedburner:origLink></item>
		<item>
		<title>The Trick to Using SharedObject</title>
		<link>http://feedproxy.google.com/~r/Jaycsantos/~3/lZ1VERAIy2E/</link>
		<comments>http://jaycsantos.com/flash/the-trick-to-using-sharedobject/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 12:30:18 +0000</pubDate>
		<dc:creator>Jayc Santos</dc:creator>
				<category><![CDATA[Actionscript 2]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[as2]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[code bits]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://jaycsantos.com/?p=470</guid>
		<description><![CDATA[Having a SAVE feature in a project/game is one of the common things that could lead users to be more attracted and increase replay value for potentially recovering what was done in a previous visit. Using the SharedObject class in actionscript project/games is sometimes a requirement or at least a need, may it be AS1 [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_472" class="wp-caption alignleft" style="width: 210px"><img class="size-full wp-image-472" title="SharedObjects" src="http://jaycsantos.com/uploads/2009/04/sharedobject.gif" alt="Shared Objects ~= Browser Cookies" width="200" height="90" /><p class="wp-caption-text"> </p></div>
<p>Having a <em>SAVE</em> feature in a project/game is one of the common things that could lead users to be more attracted and increase replay value for potentially recovering what was done in a previous visit. Using the SharedObject class in actionscript project/games is sometimes a requirement or at least a need, may it be AS1 (FP6), 2 or 3. It can be used to store valuable data like progress, settings, statistics, achievements and a lot more without dedicating storage on the server. Basically, SO or shared objects are like the browser cookies for flash, it is used to store some amount of data on the user machine, therefore it also has some limitations on its use (for security purposes really).</p>
<p>By reading the documentations or the livedocs, either for <a rel="external nofollow" href="http://livedocs.adobe.com/flash/9.0/main/00002118.html" target="_blank">AS2</a> or <a rel="external nofollow" href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/SharedObject.html" target="_blank">AS3</a> (it&#8217;s really the same), you might have a gut start of what key points to remember.</p>
<ul>
<li>created shared objects can only be stored/retrieved on the same domain</li>
<li>shared objects cannot be shared across domains, meaning a shared objects from &#8220;examplesite.com&#8221; cannot read shared objects created by another domain &#8220;mywebsite.com&#8221;</li>
<li>users can disallow local storage per domain or opt-out globaly, then the object would not be saved locally</li>
<li>data size to be stored is limited by which the user sets it (none, 10kb, 100kb, 1mb, 10mb, unlimited), although a dialog box can request an increase in storage if what is set is exceeded</li>
<li>if the user sets a limit smaller than the shared object, the shared object would be deleted</li>
<li>shared objects are stored on the user&#8217;s local machine not on the server, something shared over another machine cannot be accessed by another machine</li>
</ul>
<p>The most essential part when using SharedObject is the <code>SharedObject.getLocal()</code> method, which is what we will be discussing more through out. Basically, AS1/2 and AS3 syntax haven&#8217;t really changed (although a few more rules were imposed in as3).</p>
<blockquote class="white"><p><strong><span style="color: #000080;">getLocal</span></strong>(name:<span style="color: #000080;">String</span>, localPath:<span style="color: #000080;">String </span>= null, secure:<span style="color: #000080;">Boolean </span>= false):<span style="color: #000080;">SharedObject</span><br />
[static] Returns a reference to a locally persistent shared object that is only available to the current client.</p></blockquote>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> mySo:<span style="color: #0066CC;">SharedObject</span> = <span style="color: #0066CC;">SharedObject</span>.<span style="color: #0066CC;">getLocal</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'mySaveName'</span>, localPath, secure <span style="color: #66cc66;">&#41;</span>;
mySo.<span style="color: #0066CC;">data</span>.<span style="color: #006600;">thingtoSave</span> = myVariable; <span style="color: #808080; font-style: italic;">// your variables</span>
mySo.<span style="color: #0066CC;">flush</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// stores data into disk</span></pre></div></div>

<hr />
<h3>Avoiding Known Issues</h3>
<p>It might seem that using shared objects could be the simplest when you are only storing a couple of variables and objects like statistics or even could be the more complex when saving a game progress/state together with the players preferences. The bigger the system, more likely, the more complex your variables/objects are (same for games), and this is where possible issues during saving/loading/handling the shared objects.<br />
<span id="more-470"></span></p>
<p>Some common things to remember when using shared objects with your games:</p>
<ol>
<li><a href="#tip1">Don&#8217;t use direct reference to objects and use the game&#8217;s data only not the actual game objects</a>.</li>
<li><a href="#tip2">Use a localPath param on the <code>getLocal()</code> method</a>.</li>
<li><a href="#tip3">Taking advantage of unique names for your shared object name</a>.</li>
<li><a href="#tip4">Prompt and request for shared object size limit increase when your game needs it</a>.</li>
</ol>
<blockquote><p>While I only have these that I can explain, you are free to share more if you have one or more. We can discuss and make the lives of other actionscript writers a little better.</p></blockquote>
<p><br id="tip1" /></p>
<hr />
<h3>Don&#8217;t use direct reference to objects and use the game&#8217;s data only not the actual game objects.</h3>
<p>Why do I say this? Basically it is fine to store various data types such as objects and arrays on SO (shared objects), same goes for strings, numbers (int/uint), booleans and bytearray (as3). If you store references to local game objects on your shared objects, one way or another, your in for a later problem.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> mySo:<span style="color: #0066CC;">SharedObject</span> = <span style="color: #0066CC;">SharedObject</span>.<span style="color: #0066CC;">getLocal</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;mySaveName&quot;</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">// world.gameObject contains further objects like settings, player, etc</span>
mySo.<span style="color: #0066CC;">data</span>.<span style="color: #006600;">gamedata</span> = world.<span style="color: #006600;">gameObject</span>;
mySo.<span style="color: #0066CC;">flush</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">// --</span></pre></div></div>

<p>When you do something like the above, instead of storing the needed values only, you are referencing the local game object (w/c also contains references to other local game objects) in which Flash defines this as a copy of the local object but is really just a reference. Any change through out the game values/data would <strong>update</strong> the local object (which the shared object references) and Flash Player would write that into the shared object file when <code>flush()</code> is called or as soon as the shared object session ends &#8211; that is then swf file is closed.</p>
<p>The worst case here is that when you clear, reset or even delete your local game objects, the shared object which references to it will be affected and updated (as session has ended).</p>
<p>Also, even if don&#8217;t experience the possibility of issues when you do the above there, a problem might still arise when you load the shared object in later time. This case might not be so common but is possible to experience if loading the shared object is sloppily made. You can have inconsistent object references where the object contained within loaded shared object is conflicting, a duplicate, or not referencing the correct object.</p>
<p>A better and safest way of using shared objects (something like):</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">mySo.<span style="color: #0066CC;">data</span>.<span style="color: #006600;">gamedata</span> = <span style="color: #66cc66;">&#123;</span>
  player:<span style="color: #66cc66;">&#123;</span>
    score: world.<span style="color: #006600;">gameObject</span>.<span style="color: #006600;">player</span>.<span style="color: #006600;">score</span>,
    health: world.<span style="color: #006600;">gameObject</span>.<span style="color: #006600;">player</span>.<span style="color: #006600;">health</span>,
    currentLevel: <span style="color: #66cc66;">&lt;</span>code<span style="color: #66cc66;">&gt;</span>world.<span style="color: #006600;">gameObject</span>.<span style="color: #006600;">player</span>.<span style="color: #006600;">currentLevel</span>
  <span style="color: #66cc66;">&#125;</span>,
  settings:<span style="color: #66cc66;">&#123;</span>
    mute: world.<span style="color: #006600;">gameObject</span>.<span style="color: #006600;">settings</span>.<span style="color: #006600;">mute</span>,
    <span style="color: #0066CC;">quality</span>: world.<span style="color: #006600;">gameObject</span>.<span style="color: #006600;">settings</span>.<span style="color: #0066CC;">quality</span>,
    particles: world.<span style="color: #006600;">gameObject</span>.<span style="color: #006600;">settings</span>.<span style="color: #006600;">particles</span>,
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
<span style="color: #808080; font-style: italic;">/* well this is just a shortcut on containing them into objects,
 * but the point here is that score, health, currentLevel, etc
 * are all basic data types like number/int/uint, string, bool, etc&lt;/code&gt;</span></pre></div></div>

<p>Now you see that we store each valuable data only. We now transfer only the value of the variable not it&#8217;s reference. So while it&#8217;s fine to use objects and arrays on your shared objects, keeping be wary of how you do it, be careful.</p>
<p>You probably wouldn&#8217;t want to directly store instances of display objects, bitmapdata, functions, etc on share objects.<br />
<br id="tip2" /></p>
<hr />
<h3>Use a localPath param on the <code>getLocal()</code> method</h3>
<p>While passing the localPath parameter upon calling<code> getLocal()</code> is optional, although I would have to recommend using it by this time. In the case where you are building an independent system, prototypes, does not consider expansion/addons and will never be a part of a larger system, you can probably opt-out the localPath and never mind it.</p>
<p>So whats the issue of using and not using the localPath? By default, if you leave localPath by it&#8217;s default (null), it would use the the full path of the swf file (w/c includes the swf file itself) to store your shared objects.</p>
<blockquote class="white"><p>#SharedObjects/<span style="color: #808000;">&lt;random code&gt;</span>/<span style="color: #808000;">&lt;domain&gt;</span>/<span style="color: #808000;">&lt;path&gt;</span>/<span style="color: #808000;">&lt;swf filename&gt;</span>.swf/<span style="color: #808000;">&lt;object name&gt;</span>.sol</p></blockquote>
<blockquote>
<ul>
<li><em>Windows XP and Vista:</em>
<ul>
<li>For Web sites: %APPDATA%\Macromedia\Flash Player\#SharedObjects\&lt;random code&gt;\&lt;domain&gt;\&lt;path&gt;\&lt;object name&gt;.sol</li>
<li>For AIR Applications, %APPDATA%\&lt;AIR Application Reverse Domain Name&gt;\Local Store\#SharedObjects\&lt;flash filename&gt;.swf\&lt;object name&gt;.sol</li>
</ul>
</li>
</ul>
<ul>
<li><em>Mac OS X:</em>
<ul>
<li>For Web sites, ~/Library/Preferences/Macromedia/Flash Player/#SharedObjects/&lt;random code&gt;/&lt;domain&gt;/&lt;path from webserver&gt;/&lt;object name&gt;.sol</li>
<li>For AIR Applications, ~/Library/Preferences/&lt;AIR Application Name&gt;/Local Store/#SharedObjects/&lt;flash filename&gt;.swf/&lt;object name&gt;.sol</li>
</ul>
</li>
<li><em>Linux/Unix:</em>
<ul>
<li>~/.macromedia/Flash_Player/#SharedObjects/&lt;random id&gt;/&lt;domain&gt;/&lt;path&gt;/&lt;flash filename&gt;.swf/&lt;object name&gt;.sol</li>
</ul>
</li>
</ul>
<p style="padding-left: 30px;"><em>-taken from <a rel="external nofollow" href="http://en.wikipedia.org/wiki/Local_Shared_Object#File_locations" target="_blank">wiki</a></em></p>
</blockquote>
<p>For example, I have a swf  at <code>http://example.com/games/uploads/supergame.swf</code>, and when it creates a shared object (<code>SharedObject.getLocal("supergameData");</code>), the SO can be found at <code>#SharedObjects/</code><span style="color: #808000;">&lt;random code&gt;</span><code>/example.com/games/uploads/supergame.swf/supergameData.sol</code>.</p>
<p>While it works well and fine without the localPath parameter, there are certain sites/APIs/services that change the game&#8217;s file name by using their automated uploads, feeds, etc as the file name is used in the path. When the developer tries to upload a bug fixed build (v1.0.1), the swf might have another file name hence a problem appears where the previous build&#8217;s (v1.0.0) shared object won&#8217;t be accessible from the new build due to security reasons.</p>
<p>Although your shared object would be secured against any another swf so it can&#8217;t read it, by setting a localPath parameter like &#8220;/games&#8221; or simply &#8220;/&#8221;, the shared object can now be read by another swf file within the same domain. Using &#8220;/games&#8221; would make the SO accessible for any swf within the game directory, while having &#8220;/&#8221; would make it accessible from any swf within the domain.</p>
<p>Again from the same example but using <code>SharedObject.getLocal("supergameData","/");</code>, makes the SO at <code>#SharedObjects/</code><span style="color: #808000;">&lt;random code&gt;</span><code>/example.com/supergameData.sol</code>. This would make it not dependant on the swf&#8217;s file name.</p>
<blockquote><p><strong>Note</strong>: If you set a localPath in which the path doesn&#8217;t physically exists as a (sub) directory of the domain the shared object won&#8217;t be stored. Luckily with AS3 you&#8217;ll be prompted with an Error #2134 when the SharedObject can&#8217;t be created, but for AS2, you have to be well aware of this.</p></blockquote>
<p><br id="tip3" /></p>
<hr />
<h3>Taking advantage of unique names for your shared object name</h3>
<p>This is one is something that I have just learned through experimentation and will soon incorporate on my next projects. While setting the localPath parameter to &#8220;/&#8221; makes the SO accessible to other swfs, there is also a risk that your SO name might be the same with another swf. We wouldn&#8217;t want another swf to mess up or overwrite our SO file just because it both uses general and/or generic SO names like &#8220;<em>saveData</em>&#8221; or &#8220;<em>gameData</em>&#8220;.</p>
<p><strong>The ultimate tip</strong>: Since the SO names allow certain special characters like / (slash), we take advantage of that! Together with the localPath &#8220;/&#8221;, what I recommend is do a standard setup for your SO names something like:</p>
<blockquote class="white"><p><span style="color: #808000;">&lt;company/developer name&gt;</span>/<span style="color: #808000;">&lt;game name&gt;</span>/<span style="color: #808000;">&lt;data name&gt;</span></p></blockquote>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> mySo:<span style="color: #0066CC;">SharedObject</span> = <span style="color: #0066CC;">SharedObject</span>.<span style="color: #0066CC;">getLocal</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;jaycsantos/neolithic/preferences&quot;</span>, <span style="color: #ff0000;">&quot;/&quot;</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">// -- and/or something else like</span>
<span style="color: #000000; font-weight: bold;">var</span> mySo:<span style="color: #0066CC;">SharedObject</span> = <span style="color: #0066CC;">SharedObject</span>.<span style="color: #0066CC;">getLocal</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;jaycsantos/neolithic/gameData1&quot;</span>, <span style="color: #ff0000;">&quot;/&quot;</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">// --</span></pre></div></div>

<p>&#8230;will store your SO at something like: <code>#SharedObjects/</code><span style="color: #808000;">&lt;random code&gt;</span><code>/</code><span style="color: #808000;">&lt;domain&gt;</span><code>/#jaycsantos/neolithic/gameData.sol</code></p>
<blockquote><p>Although I still have to confirm this with Mac OS and Linux machines. Drop me a line if you find it working with those.</p></blockquote>
<p>Now ain&#8217;t that a little more organized than having all SO on the &#8220;/&#8221; of the domain!<br />
<br id="tip4" /></p>
<hr />
<h3>Prompt and request for shared object size limit increase when your game needs it</h3>
<div id="attachment_471" class="wp-caption aligncenter" style="width: 240px"><img class="size-full wp-image-471" title="Local Storage" src="http://jaycsantos.com/uploads/2009/04/localstorage.gif" alt="Local Storage" width="230" height="150" /><p class="wp-caption-text"> </p></div>
<p>There are cases when your shared object has a lot of data in it and it could exceed the default 100kb limit of a user. If this happens, it may cause your shared objects to be written but not read. I have read quite a few times where issues of reading/writing of share objects were resolved by prompting a request to increase local storage limit. This is where the <code>flush() </code>method takes it stand.</p>
<blockquote class="white"><p>Immediately writes a locally persistent  shared object to a local file.<br />
<span style="color: #888888;"><em>AS3</em></span><span style="color: #000080;"><strong><br />
flush</strong></span>(<code>minDiskSpace</code>:<span style="color: #000080;">int</span> = 0):<span style="color: #000080;">String</span></p>
<div style="padding-left: 30px;"><code>minDiskSpace</code><code>:</code><span style="color: #000080;">int</span> (default = <code>0</code>) —  The minimum disk space, in bytes, that must be allotted for this object.</div>
<p><span style="color: #888888;"><em>AS2</em></span><br />
<span style="color: #000080;"><strong><span class="signatureLink">flush</span></strong></span><code>([minDiskSpace:</code><span style="color: #000080;">Number</span><code>])</code>:Object</p>
<div style="padding-left: 30px;"><code>minDiskSpace:</code><span style="color: #000080;">Number</span> [optional] &#8211; An integer specifying  the number of bytes that must be allotted for this object. The default value is  0.</div>
</blockquote>
<p>With AS3, the <code>flush()</code> method basically does the same thing as with AS2 including their parameters, the only difference made was their return values. AS3 returns a string constant but AS2 returns an object; still their purpose is the same, only the data types have changed.</p>
<div class="wp_syntax">
<div><span style="color: #888888;"><em>AS3</em></span>:<br />
<strong>Returns</strong></p>
<div style="padding-left: 30px;"><span style="color: #000080;">String </span>— Either of the following values:</div>
<ul>
<li><code>SharedObjectFlushStatus.PENDING</code>: The user has permitted local information storage for objects from this domain, but the amount of space allotted is not sufficient to store the object. Flash Player prompts the user to allow more space. To allow space for the shared object to grow when it is saved, thus avoiding a SharedObjectFlushStatus.PENDING return value, pass a value for minDiskSpace.</li>
<li><code>SharedObjectFlushStatus.FLUSHED</code>: The shared object has been successfully written to a file on the local disk.</li>
</ul>
<p><em><span style="color: #888888;">AS2</span></em>:<br />
<strong>Returns</strong></p>
<div style="padding-left: 30px;"><span style="color: #000080;">Object </span>- A Boolean value: <code>true </code>or <code>false</code>; or a string value of &#8220;<code>pending</code>&#8220;, as described in the following list:</div>
<ul>
<li>If the user has permitted local information storage for objects from this domain, and the amount of space allotted is sufficient to store the object, this method returns true. (If you have passed a value for <code>minimumDiskSpace</code>, the amount of space allotted must be at least equal to that value for <code>true </code>to be returned).</li>
<li>If the user has permitted local information storage for objects from this domain, but the amount of space allotted is not sufficient to store the object, this method returns &#8220;<code>pending</code>&#8220;.</li>
<li>If the user has permanently denied local information storage for objects from this domain, or if Flash cannot save the object for any reason, this method returns <code>false</code>.</li>
</ul>
<div style="padding-left: 30px;"><em>- taken from livedocs (<a rel="external nofollow" href="http://livedocs.adobe.com/flash/9.0/main/00002121.html" target="_blank">as2</a> &amp; <a rel="external nofollow" href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/SharedObject.html#flush()" target="_blank">as3</a>)<br />
</em></div>
</div>
</div>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> mySo:<span style="color: #0066CC;">SharedObject</span> = <span style="color: #0066CC;">SharedObject</span>.<span style="color: #0066CC;">getLocal</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'mySaveName'</span>, localPath, secure  <span style="color: #66cc66;">&#41;</span>;
mySo.<span style="color: #0066CC;">data</span>.<span style="color: #006600;">thingtoSave</span> = myVariable; <span style="color: #808080; font-style: italic;">// your variables</span>
<span style="color: #808080; font-style: italic;">/* stores data into disk and require 10kb of min space
 * if the allocated disk space for local storage is
 * less than 10bk which most probaly be 1kb, then it
 * would prompt a dialog box requesting for an increase
 */</span>
<span style="color: #000000; font-weight: bold;">var</span> fushResult:<span style="color: #0066CC;">Object</span> = mySo.<span style="color: #0066CC;">flush</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10000</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> fushResult <span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>So saying simply, if you know your game&#8217;s shared object will be greater than a few kbs, you should consider using <code>flush(minDiskSpace)</code> with as your expect maximum size for your data. Why maximum? &#8211; think of it as your allowance. Now don&#8217;t even consider 2mb or more as an allowance if it&#8217;ll never even reach it, play your game at it&#8217;s fullest and see what is the size of the shared object using the <code>getSize()</code> method (as2) and the property <code>size</code> (as3) then add around 5-10% of it&#8217;s size for an allowance.</p>
<h3>Conclusion</h3>
<p>After all I have read about using SharedObject is as simple as it could be, in reality it can be a whole lot more than spinning circles for all of what you would need. Well yes, storing a string and recovering it is a piece of icing but storing a complete game state/progress is a new kind of cake to bake. Basically what I have written here are tips and suggestions that I have experienced and with what I have experimented. Either it be accurate or I know not, using SharedObjects has its own work around and is not as simple as most people have said like building a chair, while yes it is not the most complicated but it could be a big question mark on the head for someone new or not familiar to its purpose. I might even consider making a SaveManager or the like but that would be when I get to it. Well, that&#8217;s it, this one is quite long but I know it&#8217;ll help!</p>

<p><a href="http://feedads.g.doubleclick.net/~a/Hm5uBIFc-156MJVH7QE7R7UsqpI/0/da"><img src="http://feedads.g.doubleclick.net/~a/Hm5uBIFc-156MJVH7QE7R7UsqpI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Hm5uBIFc-156MJVH7QE7R7UsqpI/1/da"><img src="http://feedads.g.doubleclick.net/~a/Hm5uBIFc-156MJVH7QE7R7UsqpI/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=lZ1VERAIy2E:EhZjPhdPGd0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?i=lZ1VERAIy2E:EhZjPhdPGd0:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=lZ1VERAIy2E:EhZjPhdPGd0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=lZ1VERAIy2E:EhZjPhdPGd0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?i=lZ1VERAIy2E:EhZjPhdPGd0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=lZ1VERAIy2E:EhZjPhdPGd0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?i=lZ1VERAIy2E:EhZjPhdPGd0:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://jaycsantos.com/flash/the-trick-to-using-sharedobject/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<feedburner:origLink>http://jaycsantos.com/flash/the-trick-to-using-sharedobject/</feedburner:origLink></item>
		<item>
		<title>Things to Initialize on your AS2 Game/Project</title>
		<link>http://feedproxy.google.com/~r/Jaycsantos/~3/Z7mmF_irh8M/</link>
		<comments>http://jaycsantos.com/flash/things-to-initialize-on-your-as2-gameproject/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 06:43:45 +0000</pubDate>
		<dc:creator>Jayc Santos</dc:creator>
				<category><![CDATA[Actionscript 2]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[as2]]></category>
		<category><![CDATA[cheat]]></category>
		<category><![CDATA[code bits]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://jaycsantos.com/?p=466</guid>
		<description><![CDATA[While transitioning to AS3 is a massive must as people have regarded, some developers (mostly new) just want to or is forced to get stuck with AS2. So if you&#8217;re working on a AS2 project or lower, here some common things you should consider checking at the start of your project.
Some common but usually neglected [...]]]></description>
			<content:encoded><![CDATA[<p>While transitioning to AS3 is a massive must as people have regarded, some developers (mostly new) just want to or is forced to get stuck with AS2. So if you&#8217;re working on a AS2 project or lower, here some common things you should consider checking at the start of your project.</p>
<p>Some common but usually neglected things you might not want but your game might have:</p>
<ul>
<li>The everlasting suggestion of &#8220;avoid directly referencing <code>_root</code>&#8220;.</li>
<li>Yellow boxes appear (on buttons/movieclips) when pressing <em>Tab</em>.</li>
<li>Cheating by pressing <em>Space</em> when the yellow boxes focus on buttons/movieclips.</li>
<li>Cheating by right clicking (shows the context menu, a cheat for some game genres).</li>
<li>Cheating/altering game play/screens by pressing forward, back, etc from the context menu.</li>
</ul>
<h3>_root or no _root</h3>
<div id="attachment_467" class="wp-caption alignleft" style="width: 210px"><img class="size-full wp-image-467" title="root" src="http://jaycsantos.com/uploads/2009/04/root.jpg" alt="_root?" width="200" height="180" /><p class="wp-caption-text">_root ?</p></div>
<p>As you might have read a dozen or countless times, it is highly recommended to not directly call <code>_root</code> within the project, although using <code>_root</code> is not necessarily wrong. These developers come to use <code>_root</code> as a hack way of referencing an absolute path to their objects. If you are building an independent system, prototypes, does not consider expansion/addons and will never be a part of a larger system then it would be fine to use <code>_root</code> as a hacky way. But if your work is part of a larger system or the like consider having to add in various (most of the time, 3rd party) extensions, plugins, services, APIs (application programming interfaces), SDKs (software development kits), or anything similar in it&#8217;s purpose then you&#8217;ll be in for some serious headaches. Most notable of these are those that wrap your game within another swf file. You might be able to face serious issues and problems varying from sounds not playing/missing, disposition world objects, localtoGlobal/globaltoLocal miscalculations, undefined object property, sprites (movieclips) not following the expected position and behavior, wrongly positioned custom cursors and a lot more.<span id="more-466"></span></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// somewhere in the timeline...</span>
<span style="color: #0066CC;">_root</span>.<span style="color: #006600;">mySuperFunction</span> = <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
  <span style="color: #808080; font-style: italic;">// doing some super things</span>
  <span style="color: #b1b100;">return</span> <span style="color: #ff0000;">'my super function worked!'</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">// somewhere else in the game...</span>
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">_root</span>.<span style="color: #006600;">mySuperFunction</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">// before</span>
  <span style="color: #808080; font-style: italic;">// outputs: my super  function worked!</span>
<span style="color: #808080; font-style: italic;">// after some integration and browser testing...</span>
  <span style="color: #808080; font-style: italic;">// outputs:         (its really has no output)</span>
<span style="color: #808080; font-style: italic;">// nooooo!!! it isn't working now! but it used to work before,</span>
<span style="color: #808080; font-style: italic;">// maybe this thing wrecks my game when I use it!? I didn't do anything else.</span></pre></div></div>

<p>Although I won&#8217;t be discussing fixes for the issues mentioned above, we can start by doing what is recommended, to not directly reference from the <code>_root</code>. The most starter&#8217;s way from first look at the documentations and other sources, is using <code>_lockroot</code>. Basically it could prove to be a good way to fix and keep things the same but for some cases it might not be enough. For more assurance and better practice I would recommend referencing <code>_root</code> from a global variable or static variable from a class (most recommended).</p>
<p><em>Why do I have to use a variable?</em> So what we reference <strong>can be dynamic</strong> &#8211; there are some cases where the <code>_root</code> is not technically the parent most, where it can be a specific game container or something similar, this way you don&#8217;t have to shift through using <code>_root</code> and updating all your codes when needed. And the sole reason is for code reusability.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// probably on frame1 before your preloader code</span>
<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_lockroot</span> = <span style="color: #000000; font-weight: bold;">true</span>; <span style="color: #808080; font-style: italic;">// where this = root actually</span>
<span style="color: #0066CC;">this</span>.<span style="color: #006600;">mySuperFunction</span> = <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
  <span style="color: #808080; font-style: italic;">// doing some super things</span>
  <span style="color: #b1b100;">return</span> <span style="color: #ff0000;">'my super function worked!'</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// for those who do timeline coding or the like</span>
<span style="color: #000000; font-weight: bold;">_global</span>.<span style="color: #006600;">gameroot</span> = <span style="color: #0066CC;">this</span>; <span style="color: #808080; font-style: italic;">// where this = root actually</span>
&nbsp;
<span style="color: #808080; font-style: italic;">// somewhere else through the game...</span>
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">_global</span>.<span style="color: #006600;">gameroot</span>.<span style="color: #006600;">mySuperFunction</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// output: my super function worked!</span>
<span style="color: #808080; font-style: italic;">// hoorah! its working well!</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// and for those who use classes (highly recommended),</span>
<span style="color: #808080; font-style: italic;">// simply pass it on your main class during instantiation</span>
<span style="color: #808080; font-style: italic;">// to be referenced on a static variable</span>
<span style="color: #000000; font-weight: bold;">var</span> maingame = <span style="color: #000000; font-weight: bold;">new</span> MainGame<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span> <span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// where this = root actually</span>
&nbsp;
<span style="color: #808080; font-style: italic;">// on your MainGame class or the like</span>
<span style="color: #000000; font-weight: bold;">class</span> MainGame<span style="color: #66cc66;">&#123;</span>
  <span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">var</span> GameRoot:<span style="color: #0066CC;">MovieClip</span>;
  <span style="color: #808080; font-style: italic;">// constructor</span>
  <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> MainGame<span style="color: #66cc66;">&#40;</span> root:<span style="color: #0066CC;">MovieClip</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    GameRoot = root; <span style="color: #808080; font-style: italic;">// stores the root mc in static var</span>
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">// somewhere else through the game...</span>
<span style="color: #808080; font-style: italic;">// now simply reference from static variable MainGame.GameRoot instead of _root</span>
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> MainGame.<span style="color: #006600;">GameRoot</span>.<span style="color: #006600;">mySuperFunction</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;  <span style="color: #808080; font-style: italic;">// output: my super function worked!</span></pre></div></div>

<h3>Magical Weirdness of Yellow Boxes</h3>
<div id="attachment_469" class="wp-caption alignright" style="width: 204px"><img class="size-full wp-image-469" title="Yellow Box" src="http://jaycsantos.com/uploads/2009/04/yellowbox.jpg" alt="Yellow Box" width="194" height="117" /><p class="wp-caption-text">Yellow Box</p></div>
<p>Some games that incorporate interactive buttons (or movieclips that acts as buttons) are not wary of this feature. Basically flash has the ability to take use of tabbing on GUI, but since we are game developers there are high chances we would not want this as it might look ugly. While most games might not be affected by this feature there are certain circumstances that the game play can be cheated one way or another. Good examples are those games that use mouse interactivity using mouse over and mouse click events, where as the player can cheat things by combining tabbing, pressing space (to select) and the use of mouse. When a yellow box appears over a button its <code>rollOver</code> event is triggered, and when space is pressed its <code>onPress</code> event is, and that is where some cheating may occur on some combinations and timing. It is fairly a simple piece of code you have to declare at the beginning to disable all of the magical yellow boxes.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// probably on frame1 before your preloader code</span>
<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">tabEnabled</span> = <span style="color: #000000; font-weight: bold;">false</span>; <span style="color: #808080; font-style: italic;">// disable tabs for the whole movieclip</span>
<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">tabChildren</span> = <span style="color: #000000; font-weight: bold;">false</span>; <span style="color: #808080; font-style: italic;">// disables tabs for the rest movieclip's childrens</span></pre></div></div>

<h3>Right clicks and Context Menus</h3>
<div id="attachment_468" class="wp-caption alignright" style="width: 226px"><img class="size-full wp-image-468" title="Context Menu" src="http://jaycsantos.com/uploads/2009/04/contextmenu.jpg" alt="Which frame to move?" width="216" height="152" /><p class="wp-caption-text">Which frame to move?</p></div>
<p>While the context menus from right clicks (control-click for Macs) on flash can&#8217;t be removed, we can modify the menus and also strip down unnecessary movie controls like forward, back, play, etc. If your game/project is AS2 powered and is not really well structured (timeline coding and uses <code>gotoAndStop()</code> methods ) then you might encounter glitches and frame skips once the player right clicks and select any movie controls. They could end up skipping levels to scoring indefinitely and would make things less fun and more cheating for them.</p>
<p>If all you want is to simplify the menu:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// probably on frame1 before your preloader code</span>
<span style="color: #0066CC;">Stage</span>.<span style="color: #0066CC;">showMenu</span> = <span style="color: #000000; font-weight: bold;">false</span>;</pre></div></div>

<p>But if you also would like to customize and add your own menus then:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// probably on frame1 before your preloader code</span>
<span style="color: #808080; font-style: italic;">// instantiate a new contextmenu</span>
<span style="color: #000000; font-weight: bold;">var</span> my_cm:<span style="color: #0066CC;">ContextMenu</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">ContextMenu</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
my_cm.<span style="color: #0066CC;">hideBuiltInItems</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// hides the built in items, duh</span>
my_cm.<span style="color: #0066CC;">customItems</span>.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">ContextMenuItem</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;(c) Jayc Santos&quot;</span>, gotoJayc<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// creates a new menu</span>
<span style="color: #000000; font-weight: bold;">function</span> gotoJayc<span style="color: #66cc66;">&#40;</span>obj, item<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span> <span style="color: #0066CC;">getURL</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http://jaycsantos.com/&quot;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span>
<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">menu</span> = my_cm; <span style="color: #808080; font-style: italic;">// overwrites the default menu and where this = _root (most of the time)</span></pre></div></div>

<p>There are also some cases where simply right clicking would create issues for the game play and/or cheat things. A good way to determine is to use the <code>onSelect</code> event. You can also use the <code>onSelect</code> event for more customizations of your context menus (<a title="onSelect (ContextMenu.onSelect handler)" rel="none" href="http://livedocs.adobe.com/flash/9.0/main/00001554.html" target="_blank">see livedocs sample</a>).</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> my_cm:<span style="color: #0066CC;">ContextMenu</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">ContextMenu</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">function</span> menuHandler<span style="color: #66cc66;">&#40;</span>obj:<span style="color: #0066CC;">Object</span>, <span style="color: #0066CC;">menu</span>:<span style="color: #0066CC;">ContextMenu</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
  <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;right click context menu was invoked&quot;</span> <span style="color: #66cc66;">&#41;</span>;
  <span style="color: #808080; font-style: italic;">// do awesome things</span>
<span style="color: #66cc66;">&#125;</span>
my_cm.<span style="color: #0066CC;">onSelect</span> = menuHandler;
<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">menu</span> = my_cm;</pre></div></div>

<h3>Conclusion</h3>
<p>So overall you might probably want to have something like:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// probably on frame1 before your preloader code</span>
<span style="color: #0066CC;">Stage</span>.<span style="color: #0066CC;">showMenu</span> = <span style="color: #000000; font-weight: bold;">false</span>; <span style="color: #808080; font-style: italic;">// hides the built in items on context menu</span>
<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_lockroot</span> = <span style="color: #000000; font-weight: bold;">true</span>; <span style="color: #808080; font-style: italic;">// locks the root, duh</span>
<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">tabEnabled</span> = <span style="color: #000000; font-weight: bold;">false</span>; <span style="color: #808080; font-style: italic;">// disables tabs</span>
<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">tabChildren</span> = <span style="color: #000000; font-weight: bold;">false</span>; <span style="color: #808080; font-style: italic;">// disables tabs for it's children</span></pre></div></div>

<p>for timeline coders</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">_global</span>.<span style="color: #006600;">gameroot</span> = <span style="color: #0066CC;">this</span>; <span style="color: #808080; font-style: italic;">// where this = root actually</span>
<span style="color: #808080; font-style: italic;">//  when &quot;this&quot; is traced it ouputs &quot;_level0&quot; most of the time unless altered</span></pre></div></div>

<p>and for those who use a little more OOP approach</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> maingame = <span style="color: #000000; font-weight: bold;">new</span> MainGame<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span> <span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// where this = root actually</span>
&nbsp;
<span style="color: #808080; font-style: italic;">// on your MainGame class or the like</span>
<span style="color: #000000; font-weight: bold;">class</span> MainGame<span style="color: #66cc66;">&#123;</span>
  <span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">var</span> GameRoot:<span style="color: #0066CC;">MovieClip</span>;
  <span style="color: #808080; font-style: italic;">// constructor</span>
  <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> MainGame<span style="color: #66cc66;">&#40;</span> root:<span style="color: #0066CC;">MovieClip</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    GameRoot = root; <span style="color: #808080; font-style: italic;">// stores the root mc in static var</span>
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Now, your actionscript 2 coding life will be a little better with these in mind.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/duwMwinvxiCRMjXTQUHJkaKRGNU/0/da"><img src="http://feedads.g.doubleclick.net/~a/duwMwinvxiCRMjXTQUHJkaKRGNU/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/duwMwinvxiCRMjXTQUHJkaKRGNU/1/da"><img src="http://feedads.g.doubleclick.net/~a/duwMwinvxiCRMjXTQUHJkaKRGNU/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=Z7mmF_irh8M:fbPHMLi5J14:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?i=Z7mmF_irh8M:fbPHMLi5J14:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=Z7mmF_irh8M:fbPHMLi5J14:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=Z7mmF_irh8M:fbPHMLi5J14:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?i=Z7mmF_irh8M:fbPHMLi5J14:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=Z7mmF_irh8M:fbPHMLi5J14:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?i=Z7mmF_irh8M:fbPHMLi5J14:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://jaycsantos.com/flash/things-to-initialize-on-your-as2-gameproject/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://jaycsantos.com/flash/things-to-initialize-on-your-as2-gameproject/</feedburner:origLink></item>
		<item>
		<title>Cheating AI from Hardcourt – Code the Plans</title>
		<link>http://feedproxy.google.com/~r/Jaycsantos/~3/BylPhXQXWJQ/</link>
		<comments>http://jaycsantos.com/flash/cheating-ai-from-hardcourt-code-the-plans/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 14:09:06 +0000</pubDate>
		<dc:creator>Jayc Santos</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Hardcourt]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://jaycsantos.com/?p=384</guid>
		<description><![CDATA[So I have introduced how to plan out simple AI behavior from my previous post &#8211;  Cheating AI from Hardcourt &#8211; Plan it out &#8211; if you haven&#8217;t, read that one first before this.
Our next step would be writing the data charts into codes. It might look quite easy when you see the simple [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_465" class="wp-caption alignleft" style="width: 260px"><img class="size-full wp-image-465" title="Plan your behavior" src="http://jaycsantos.com/uploads/2009/04/screen3.jpg" alt="Behavior" width="250" height="130" /><p class="wp-caption-text">Plan your behavior</p></div>
<p>So I have introduced how to plan out simple AI behavior from my previous post &#8211;  <a href="http://jaycsantos.com/games/cheating-ai-from-hardcourt-plan-it-out">Cheating AI from Hardcourt &#8211; Plan it out</a> &#8211; if you haven&#8217;t, read that one first before this.</p>
<p>Our next step would be writing the data charts into codes. It might look quite easy when you see the simple flow charts but remember that the AI must process this through out the game with a character&#8217;s lifespan.</p>
<p>What I&#8217;m about to share is simply a psuedo codish (partly actionscript syntax) of the AI&#8217;s logic. Eventually you can port it into which ever approach you are comfortable with, like OOP or the old school timeline.</p>
<p>Remember that this is my first published game where as I still used AS2 using prototypes and functions but I&#8217;ll discuss this in a little of close objective approach. First of we prepare a few world declarations &amp; preparation in a quick manner.</p>
<p><span id="more-384"></span></p>
<h3>Prepare the world</h3>
<p>In the game world object or whichever the game&#8217;s entities reside, we&#8217;ll be having a <code>calculateDistance</code> method that pre-calculates distances of each of the characters then stores each of their enemies distance on an <code>enemyDist</code> container object.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900;">// from the game world</span>
 <span style="color: #009900;">// called within the main loop</span>
<span style="color: #339966; font-weight: bold;">function</span> calculateDistances<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
  <span style="color: #009900;">// pre-calculate distances of:</span>
  <span style="color: #009900;">//   ball to char - store distance to the character's ballDist variable</span>
  <span style="color: #009900;">//   char to char - store all other character's (enemy's) distance to character's enemyDist container variable</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>The code below acts as base methods for all characters. This is primarily an advantage from inheritance whereas properties and methods of the base class is inherited by the class that extends it. Basically all the characters will be capable of methods such as moving (<code>moveChar</code>), getting the ball (<code>getBall</code>), shooting it (<code>shoot</code>) and punching their enemies (<code>punch</code>).</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">  <span style="color: #009900;">// used to store the ball object also do determine if the we have the ball; set to null if we not</span>
<span style="color: #6699cc; font-weight: bold;">var</span> myBall<span style="color: #000000; font-weight: bold;">:</span>Ball;
  <span style="color: #009900;">// the distance of the ball from character in Vector2D (x, y)</span>
<span style="color: #6699cc; font-weight: bold;">var</span> ballDist<span style="color: #000000; font-weight: bold;">:</span>Vector2D;
  <span style="color: #009900;">// contains enemies distances</span>
<span style="color: #6699cc; font-weight: bold;">var</span> enemyDist<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Object</span>;
  <span style="color: #009900;">// assuming that 25 is the range where the character can punch it's enemies</span>
<span style="color: #6699cc; font-weight: bold;">var</span> punchRange<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">25</span>;
&nbsp;
 <span style="color: #009900;">// moves the character</span>
<span style="color: #339966; font-weight: bold;">function</span> moveChar<span style="color: #000000;">&#40;</span> xdir, ydir <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
  <span style="color: #009900;">//  xdir - move left (-1) or right (1)</span>
  <span style="color: #009900;">//  ydir - move up (-1) or down (1)</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
 <span style="color: #009900;">// determines if we have the ball else if the ball is close &amp;amp; not owned (by enemy) then get it</span>
<span style="color: #339966; font-weight: bold;">function</span> getBall<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Object</span> <span style="color: #000000;">&#123;</span>
  <span style="color: #009900;">//  use ballDist for the calculated distance;</span>
  <span style="color: #009900;">//  returns: ball object - if our char already has it</span>
  <span style="color: #009900;">// 	      null - if the ball is nowhere near</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
 <span style="color: #009900;">// shoots the ball</span>
<span style="color: #339966; font-weight: bold;">function</span> shoot<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
  <span style="color: #009900;">// release the ball towards the ring</span>
  <span style="color: #009900;">// set myBall to null</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
 <span style="color: #009900;">// attacks the enemy</span>
 <span style="color: #009900;">//  params: enemy:Object - the enemy instance to punch</span>
<span style="color: #339966; font-weight: bold;">function</span> punch<span style="color: #000000;">&#40;</span> enemy<span style="color: #000000; font-weight: bold;">:</span>BaseChar <span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> <span style="color: #000000;">&#123;</span>
  <span style="color: #009900;">//  returns: true - if successful hit</span>
  <span style="color: #009900;">//           false - else not</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Note: for the <a title="More info about 2D Vector" href="http://google.com/search?q=actionscript+vector+2d" target="_blank">Vector2D</a>, some might be wondering what it is, well it is a class whose purpose is to calculate Vector operations in two dimensions.</p>
<p>Now we have prepared the initial methods, let&#8217;s go with the proposed coding of the flow charts.</p>
<h3>Basic Behaviors</h3>
<p>The AI controlled character behavior:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">  <span style="color: #009900;">// runs with the main loop for each AI character</span>
<span style="color: #339966; font-weight: bold;">function</span> thinkAI<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
  <span style="color: #6699cc; font-weight: bold;">var</span> xdir = <span style="color: #000000; font-weight:bold;">0</span>;
  <span style="color: #6699cc; font-weight: bold;">var</span> ydir = <span style="color: #000000; font-weight:bold;">0</span>;
&nbsp;
    <span style="color: #009900;">// if we have the ball</span>
  <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span> getBall<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
      <span style="color: #009900;">// then shoot it!!</span>
    shoot<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
    <span style="color: #009900;">// if not</span>
  <span style="color: #000000;">&#125;</span><span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #000000;">&#123;</span>
      <span style="color: #009900;">// get the direction of the ball</span>
    xdir = ballDist.<span style="color: #004993;">x</span> <span style="color: #000000; font-weight: bold;">?</span> ballDist.<span style="color: #004993;">x</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">Math</span>.<span style="color: #004993;">abs</span><span style="color: #000000;">&#40;</span> ballDist.<span style="color: #004993;">x</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">0</span>;
    ydir = ballDist.<span style="color: #004993;">y</span> <span style="color: #000000; font-weight: bold;">?</span> ballDist.<span style="color: #004993;">y</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">Math</span>.<span style="color: #004993;">abs</span><span style="color: #000000;">&#40;</span> ballDist.<span style="color: #004993;">y</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">0</span>;
      <span style="color: #009900;">// and move towards it</span>
    moveChar<span style="color: #000000;">&#40;</span> xdir, ydir <span style="color: #000000;">&#41;</span>;
  <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<div style="overflow:hidden">
<div id="attachment_380" class="wp-caption alignleft" style="width: 160px"><a href="http://jaycsantos.com/uploads/2009/03/ai_chart0.gif"  onclick="return false"><img id="img_384_ai_chart0_gif" class="size-thumbnail wp-image-380" title="Basic Chart - Get &amp;  shoot " src="http://jaycsantos.com/uploads/2009/03/ai_chart0-150x118.gif" alt="Basic Chart - Get &amp; shoot" width="150" height="118"onclick="enlarge(this)" longdesc="http://jaycsantos.com/uploads/2009/03/ai_chart0.gif" /></a><p class="wp-caption-text">Basic Chart - Get &amp; shoot</p></div>
<p>We used the method <code>getBall()</code> to determine if we have the ball or not, if so shoot it. Else, we get the distance from <code>ballDist</code> (which contains the distance in x &amp; y values), have it&#8217;s polarity from it&#8217;s the absolute value and move towards it.</p>
<p>This is only the first chart (Basic Chart), our AI only considers that in the game world there is only the character himself and the ball, so whenever he gets the ball he shoots it immediately and repeats the process.</p></div>
<h3>Expanding for more Interactions</h3>
<p>What we do next is implement the second chart (Interactive Chart) and consider situations with the enemy and interact with it.</p>
<p>So improving the thinkAI() method:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #339966; font-weight: bold;">function</span> thinkAI<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
  <span style="color: #6699cc; font-weight: bold;">var</span> xdir = <span style="color: #000000; font-weight:bold;">0</span>;
  <span style="color: #6699cc; font-weight: bold;">var</span> ydir = <span style="color: #000000; font-weight:bold;">0</span>;
&nbsp;
    <span style="color: #009900;">// if we have the ball</span>
  <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span> getBall<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
      <span style="color: #009900;">// then shoot it!!</span>
    shoot<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
    <span style="color: #009900;">// if not,</span>
  <span style="color: #000000;">&#125;</span><span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #6699cc; font-weight: bold;">var</span> ball = GameWorld.ball;
    <span style="color: #6699cc; font-weight: bold;">var</span> dist<span style="color: #000000; font-weight: bold;">:</span>Vector2D;
      <span style="color: #009900;">// check if another char has the ball, since definitely it isn't this char</span>
    <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span> ball.owner <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
        <span style="color: #009900;">// store the enemy who has the ball in a local var</span>
      <span style="color: #6699cc; font-weight: bold;">var</span> targetEnemy = enemyDist<span style="color: #000000;">&#91;</span> ball.owner.id <span style="color: #000000;">&#93;</span>;
        <span style="color: #009900;">// this is the distance of the enemy char with respect to this char</span>
      dist = targetEnemy.dist;
        <span style="color: #009900;">// if this enemy is within punching range</span>
      <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span> dist.len <span style="color: #000000; font-weight: bold;">&lt;</span> punchRange <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
        punch<span style="color: #000000;">&#40;</span> ball.owner <span style="color: #000000;">&#41;</span>;
          <span style="color: #009900;">// no need to do the processes below...</span>
        <span style="color: #0033ff; font-weight: bold;">return</span>;
      <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #000000;">&#123;</span>
      dist = ballDist;
    <span style="color: #000000;">&#125;</span>
      <span style="color: #009900;">// get the direction</span>
    xdir = dist.<span style="color: #004993;">x</span> <span style="color: #000000; font-weight: bold;">?</span> dist.<span style="color: #004993;">x</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">Math</span>.<span style="color: #004993;">abs</span><span style="color: #000000;">&#40;</span> dist.<span style="color: #004993;">x</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">0</span>;
    ydir = dist.<span style="color: #004993;">y</span> <span style="color: #000000; font-weight: bold;">?</span> dist.<span style="color: #004993;">y</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">Math</span>.<span style="color: #004993;">abs</span><span style="color: #000000;">&#40;</span> dist.<span style="color: #004993;">y</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">0</span>;
      <span style="color: #009900;">// and move towards it</span>
    moveChar<span style="color: #000000;">&#40;</span> xdir, ydir <span style="color: #000000;">&#41;</span>;
  <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<div style="overflow:hidden">
<div id="attachment_381" class="wp-caption alignright" style="width: 160px"><a href="http://jaycsantos.com/uploads/2009/03/ai_chart1.gif"  onclick="return false"><img id="img_384_ai_chart1_gif" class="size-thumbnail wp-image-381" title="Interactive Chart - Steal the ball" src="http://jaycsantos.com/uploads/2009/03/ai_chart1-150x105.gif" alt="Interactive Chart - Steal the ball" width="150" height="105"onclick="enlarge(this)" longdesc="http://jaycsantos.com/uploads/2009/03/ai_chart1.gif" /></a><p class="wp-caption-text">Interactive Chart - Steal the ball</p></div>
<p>After determining that the ball is not in our character&#8217;s possession, we check if the ball is owned by another character. As it is owned, it certainly is not our character who has it as we already tested. So from the <code>enemyDist</code> container object (this has the pre-calculated distances of the character&#8217;s enemies) we get the enemies distance. See if the enemy is within stealing (ok, punching) range and punch if so, else move towards the enemy.</p>
<p>Now we have considered enemies too, if they have possession of the ball, our AI char simply goes after him and if he is within range we steal/punch.</p>
<blockquote><p>Take note that when a character is punched he losses the ball so I also call punching stealing the ball. <img src='http://jaycsantos.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p></blockquote>
</div>
<p>Then we take this into the 2nd chart.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #339966; font-weight: bold;">function</span> thinkAI<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
  <span style="color: #6699cc; font-weight: bold;">var</span> xdir = <span style="color: #000000; font-weight:bold;">0</span>;
  <span style="color: #6699cc; font-weight: bold;">var</span> ydir = <span style="color: #000000; font-weight:bold;">0</span>;
&nbsp;
    <span style="color: #009900;">// if we have the ball</span>
  <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span> getBall<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
      <span style="color: #009900;">// then shoot it!!</span>
    shoot<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
      <span style="color: #009900;">// if not,</span>
  <span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #6699cc; font-weight: bold;">var</span> ball = GameWorld.ball;
    <span style="color: #6699cc; font-weight: bold;">var</span> dist<span style="color: #000000; font-weight: bold;">:</span>Vector2D;
      <span style="color: #009900;">// check if another char has the ball, since definitely it isn't this char</span>
    <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span> ball.owner <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
        <span style="color: #009900;">// store the enemy who has the ball in a local var</span>
      <span style="color: #6699cc; font-weight: bold;">var</span> targetEnemy = enemyDist<span style="color: #000000;">&#91;</span> ball.owner.id <span style="color: #000000;">&#93;</span>;
        <span style="color: #009900;">// targetEnemy.dist is the distance of the enemy char with respect to this char</span>
      dist = targetEnemy.dist;
        <span style="color: #009900;">// if this enemy is within punching range</span>
      <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span> dist.len <span style="color: #000000; font-weight: bold;">&lt;</span> punchRange <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
        punch<span style="color: #000000;">&#40;</span> ball.owner <span style="color: #000000;">&#41;</span>;
          <span style="color: #009900;">// no need to do the processes below...</span>
        <span style="color: #0033ff; font-weight: bold;">return</span>;
      <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #000000;">&#123;</span>
        <span style="color: #009900;">// default the distance from the ball</span>
      <span style="color: #6699cc; font-weight: bold;">var</span> dist = ballDist;
      <span style="color: #6699cc; font-weight: bold;">var</span> ds;
        <span style="color: #009900;">// loop through enemies</span>
      <span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span> <span style="color: #004993;">c</span> <span style="color: #0033ff; font-weight: bold;">in</span> enemyDist <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
        ds = enemyDist<span style="color: #000000;">&#91;</span> <span style="color: #004993;">c</span> <span style="color: #000000;">&#93;</span>.dist;
          <span style="color: #009900;">// see if they are closer</span>
        <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span> ds.len <span style="color: #000000; font-weight: bold;">&lt;</span> dist.len <span style="color: #000000;">&#41;</span>
          dist = ds;
          <span style="color: #009900;">// it seems that this enemy is already in range, no need to check the others</span>
        <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span> ds.len <span style="color: #000000; font-weight: bold;">&lt;</span> punchRange <span style="color: #000000;">&#41;</span>
          <span style="color: #0033ff; font-weight: bold;">break</span>;
      <span style="color: #000000;">&#125;</span>
        <span style="color: #009900;">// if this is not the ball distance then it could only be the enemy</span>
      <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span> dist <span style="color: #000000; font-weight: bold;">!</span>= ballDist <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
          <span style="color: #009900;">// if this enemy is within punching range</span>
        <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span> dist.len <span style="color: #000000; font-weight: bold;">&lt;</span> punchRange <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
            <span style="color: #009900;">// attack!!</span>
          punch<span style="color: #000000;">&#40;</span> ball.owner <span style="color: #000000;">&#41;</span>;
            <span style="color: #009900;">// no need to do the processes below...</span>
          <span style="color: #0033ff; font-weight: bold;">return</span>;
        <span style="color: #000000;">&#125;</span>
      <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
      <span style="color: #009900;">// get the direction</span>
    xdir = dist.<span style="color: #004993;">x</span> <span style="color: #000000; font-weight: bold;">?</span> dist.<span style="color: #004993;">x</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">Math</span>.<span style="color: #004993;">abs</span><span style="color: #000000;">&#40;</span> dist.<span style="color: #004993;">x</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">0</span>;
    ydir = dist.<span style="color: #004993;">y</span> <span style="color: #000000; font-weight: bold;">?</span> dist.<span style="color: #004993;">y</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">Math</span>.<span style="color: #004993;">abs</span><span style="color: #000000;">&#40;</span> dist.<span style="color: #004993;">y</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">0</span>;
      <span style="color: #009900;">// and move towards it</span>
    moveChar<span style="color: #000000;">&#40;</span> xdir, ydir <span style="color: #000000;">&#41;</span>;
  <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<div style="overflow:hidden">
<div id="attachment_382" class="wp-caption alignleft" style="width: 160px"><a href="http://jaycsantos.com/uploads/2009/03/ai_chart2.gif"  onclick="return false"><img id="img_384_ai_chart2_gif" class="size-thumbnail wp-image-382" title="Interactive Chart 2 - Go offensive, attack!" src="http://jaycsantos.com/uploads/2009/03/ai_chart2-150x95.gif" alt="Interactive Chart 2 - Go offensive, attack!" width="150" height="95"onclick="enlarge(this)" longdesc="http://jaycsantos.com/uploads/2009/03/ai_chart2.gif" /></a><p class="wp-caption-text">Interactive Chart 2 - Go offensive, attack!</p></div>
<p>What I added here is for our AI character to consider not only the ball itself and it&#8217;s possible owner, but also nearby enemies. Checking through all enemies and determining if they are close enough or within range, therefore stopping them with a punch.</p>
<p>You can also see clearly the advantage of pre-calculating the distances, as  I used the enemy and ball distances enough to avoid recalculating them again and again when needed.</p></div>
<p>Now we have our competitive AI ready! Or not. Feeling like something is missing? Yes, its &#8220;<em>difficulty</em>!&#8221; Basically as you might have suspected that this AI behavior has the perfect reflex (well not so perfect really).  It does what it has to depending on exact situations at the exact time on the next loop.</p>
<blockquote><p><strong>Example this:</strong></p>
<p>Just at the same moment you grab the ball the enemy would instantly steal the ball or, simply saying, you can&#8217;t even run away, your character&#8217;s very change in position and angle is updated and read by the AI at the same time or yet exactly at the next frame therefore it knows where exactly you are same way the moment you move anywhere.</p>
<p>And another problem with the perfect reflex is same way we planned it, the moment the AI character grabs the ball he just shoots it at once.</p></blockquote>
<p>For this problem, a good fix I did was based around with numbers. Yes, &#8220;numbers&#8221; will help with everything, you can imagine setting a level of intelligence for the AI and how much well it executes it&#8217;s task depends on the numbers assigned. But I&#8217;ll leave that to another post to discuss about it more&#8230;</p>
<p>What do you think? <a href="../games/hardcourt/?play">Play hardcourt now!</a> to experience the AI in action.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/i2FwnHGotFVj6bhHi7gAzbga1uw/0/da"><img src="http://feedads.g.doubleclick.net/~a/i2FwnHGotFVj6bhHi7gAzbga1uw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/i2FwnHGotFVj6bhHi7gAzbga1uw/1/da"><img src="http://feedads.g.doubleclick.net/~a/i2FwnHGotFVj6bhHi7gAzbga1uw/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=BylPhXQXWJQ:4wSIcZfjCbY:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?i=BylPhXQXWJQ:4wSIcZfjCbY:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=BylPhXQXWJQ:4wSIcZfjCbY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=BylPhXQXWJQ:4wSIcZfjCbY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?i=BylPhXQXWJQ:4wSIcZfjCbY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=BylPhXQXWJQ:4wSIcZfjCbY:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?i=BylPhXQXWJQ:4wSIcZfjCbY:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://jaycsantos.com/flash/cheating-ai-from-hardcourt-code-the-plans/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jaycsantos.com/flash/cheating-ai-from-hardcourt-code-the-plans/</feedburner:origLink></item>
		<item>
		<title>Version 2 is Up and Other Updates</title>
		<link>http://feedproxy.google.com/~r/Jaycsantos/~3/4KL9zaSKUvA/</link>
		<comments>http://jaycsantos.com/news/version-2-is-up-and-other-updates/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 05:01:29 +0000</pubDate>
		<dc:creator>Jayc Santos</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[game update]]></category>
		<category><![CDATA[Neolithic]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://jaycsantos.com/?p=462</guid>
		<description><![CDATA[Horay Horay!! v2 (version 2) of jaycsantos.com is now up and running.
Look at all the colors&#8230; yeah, I know it&#8217;s the same scheme. But I&#8217;ve added more functionality and relative contents.

sidebars are much wider
home page is quite different
game list page is more awesome
game pages are more content oriented now with media (images and vids), download, [...]]]></description>
			<content:encoded><![CDATA[<p>Horay Horay!! v2 (version 2) of jaycsantos.com is now up and running.</p>
<p>Look at all the colors&#8230; yeah, I know it&#8217;s the same scheme. But I&#8217;ve added more functionality and relative contents.</p>
<div id="attachment_463" class="wp-caption alignright" style="width: 150px"><a href="http://jaycsantos.com/uploads/2009/04/designv1.jpg"  onclick="return false"><img id="img_462_designv1_jpg" class="size-thumbnail wp-image-463" title="jaycsantos.com v1" src="http://jaycsantos.com/uploads/2009/04/designv1-140x105.jpg" alt="jaycsantos.com v1" width="140" height="105"onclick="enlarge(this)" longdesc="http://jaycsantos.com/uploads/2009/04/designv1.jpg" /></a><p class="wp-caption-text">jaycsantos.com v1</p></div>
<div id="attachment_393" class="wp-caption alignright" style="width: 150px"><a href="http://jaycsantos.com/uploads/2009/03/designv2.jpg"  onclick="return false"><img id="img_462_designv2_jpg" class="size-thumbnail wp-image-393" title="JaycSantos.com v2" src="http://jaycsantos.com/uploads/2009/03/designv2-150x88.jpg" alt="JaycSantos.com v2" width="140" height="82"onclick="enlarge(this)" longdesc="http://jaycsantos.com/uploads/2009/03/designv2.jpg" /></a><p class="wp-caption-text">JaycSantos.com v2</p></div>
<ul>
<li>sidebars are much wider</li>
<li>home page is quite different</li>
<li>game list page is more awesome</li>
<li>game pages are more content oriented now with media (images and vids), download, highscore and playable sub pages.</li>
<li>And the site is now more blog feature oriented with related posts, archives, tags, etc &#8211; all displayed respectively.</li>
</ul>
<p>By the way, the long promised update on the <a href="http://jaycsantos.com/portfolio/">portfolio page</a> is finally done. I was able to put some things in there for now and it even has my pic!</p>
<p>With regards to game production, I&#8217;m glad to share that I&#8217;m continuing, or I should restarting, the development of <a href="http://jaycsantos.com/games/neolithic/">Neolithic</a>. The whole engine was done before and is quite playable but I&#8217;m rewriting the engine again, this time in AS3 so it can have more power which results with more fun. I&#8217;m keeping the assets and slightly upgrade them too.</p>
<p>Enjoy the newly designed site!</p>

<p><a href="http://feedads.g.doubleclick.net/~a/K58jPSfbE7onwdStVfHOBD2Jq3o/0/da"><img src="http://feedads.g.doubleclick.net/~a/K58jPSfbE7onwdStVfHOBD2Jq3o/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/K58jPSfbE7onwdStVfHOBD2Jq3o/1/da"><img src="http://feedads.g.doubleclick.net/~a/K58jPSfbE7onwdStVfHOBD2Jq3o/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=4KL9zaSKUvA:t8uuG3-N0Yk:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?i=4KL9zaSKUvA:t8uuG3-N0Yk:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=4KL9zaSKUvA:t8uuG3-N0Yk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=4KL9zaSKUvA:t8uuG3-N0Yk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?i=4KL9zaSKUvA:t8uuG3-N0Yk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=4KL9zaSKUvA:t8uuG3-N0Yk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?i=4KL9zaSKUvA:t8uuG3-N0Yk:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://jaycsantos.com/news/version-2-is-up-and-other-updates/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://jaycsantos.com/news/version-2-is-up-and-other-updates/</feedburner:origLink></item>
		<item>
		<title>V2 Redesign</title>
		<link>http://feedproxy.google.com/~r/Jaycsantos/~3/jpytO9gVTbQ/</link>
		<comments>http://jaycsantos.com/news/v2-redesign/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 03:45:52 +0000</pubDate>
		<dc:creator>Jayc Santos</dc:creator>
				<category><![CDATA[Arts n Visuals]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://jaycsantos.com/?p=392</guid>
		<description><![CDATA[I&#8217;ve had my current theme for more than half a year, and I&#8217;m currently working on the next version during leisure time. &#8220;But the current one is good, simple and plain&#8221; &#8211; Yes it is, but it lacks things that I didn&#8217;t knew yet when I first made this. Actually v1 is my first full [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_394" class="wp-caption alignleft" style="width: 210px"><img class="size-full wp-image-394" title="JaycSantos.com v2 logo" src="http://jaycsantos.com/uploads/2009/03/designv2logo.jpg" alt="v2 logo" width="200" height="95" /><p class="wp-caption-text">v2 logo</p></div>
<p>I&#8217;ve had my current theme for more than half a year, and I&#8217;m currently working on the next version during leisure time. &#8220;<em>But the current one is good, simple and plain</em>&#8221; &#8211; Yes it is, but it lacks things that I didn&#8217;t knew yet when I first made this. Actually v1 is my first full WP template. So basically, the current theme (v1) doesn&#8217;t support <a title="WP Widgets" href="http://codex.wordpress.org/Plugins/WordPress_Widgets" target="_blank">wordpress widgets</a>. Oh yes, widgets, also known as the &#8220;sidebar accessories&#8221; which are plugins that can be integrated into the sidebar.<span id="more-392"></span></p>
<p>So taking feature and content design into consideration, I decided to redesign my theme and catch up. And now presenting a sneak peak into the version changes. (also click on image below to enlarge)</p>
<div id="attachment_393" class="wp-caption alignright" style="width: 160px"><a href="http://jaycsantos.com/uploads/2009/03/designv2.jpg"  onclick="return false"><img id="img_392_designv2_jpg" class="size-thumbnail wp-image-393" title="JaycSantos.com v2 design" src="http://jaycsantos.com/uploads/2009/03/designv2-150x88.jpg" alt="JaycSantos.com v2 design" width="150" height="88"onclick="enlarge(this)" longdesc="http://jaycsantos.com/uploads/2009/03/designv2.jpg" /></a><p class="wp-caption-text">v2 design</p></div>
<ul>
<li>I&#8217;ve redesigned the logo to be brighter and sharper.</li>
<li>Kept the color scheme (I still like my colors) and some box styles yet made the design livelier.</li>
<li>Sided with more personalized design than corporate look but still as sleek as it is.</li>
<li>Widget support! And it&#8217;s not for sidebars only. <img src='http://jaycsantos.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </li>
<li>More content/game/portfolio exposure.</li>
<li>Maximized content width yet still support 1024&#215;768 user screens.</li>
<li>Removed the news section (from v1).</li>
</ul>
<p>As of this post&#8217;s time, sliced it up into html/css then the next step is converting into a wordpress theme. Watch out, I&#8217;ll be uploading v2 in a week or three.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/LpERBDite1mfWxS_QJt9D5WDq7w/0/da"><img src="http://feedads.g.doubleclick.net/~a/LpERBDite1mfWxS_QJt9D5WDq7w/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/LpERBDite1mfWxS_QJt9D5WDq7w/1/da"><img src="http://feedads.g.doubleclick.net/~a/LpERBDite1mfWxS_QJt9D5WDq7w/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=jpytO9gVTbQ:B9lp__JdrKY:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?i=jpytO9gVTbQ:B9lp__JdrKY:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=jpytO9gVTbQ:B9lp__JdrKY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=jpytO9gVTbQ:B9lp__JdrKY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?i=jpytO9gVTbQ:B9lp__JdrKY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Jaycsantos?a=jpytO9gVTbQ:B9lp__JdrKY:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Jaycsantos?i=jpytO9gVTbQ:B9lp__JdrKY:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://jaycsantos.com/news/v2-redesign/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://jaycsantos.com/news/v2-redesign/</feedburner:origLink></item>
	</channel>
</rss><!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
