<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Predator Interactive</title>
	<atom:link href="http://www.predatorinteractive.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.predatorinteractive.com</link>
	<description>2D Game Programming Resources for Noobs</description>
	<lastBuildDate>Wed, 21 Jul 2010 00:18:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Welcome To Predator Interactive</title>
		<link>http://www.predatorinteractive.com/new/welcome-to-predator-interactive</link>
		<comments>http://www.predatorinteractive.com/new/welcome-to-predator-interactive#comments</comments>
		<pubDate>Thu, 25 Jun 2009 07:05:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[I'm New Here]]></category>
		<category><![CDATA[intro]]></category>
		<category><![CDATA[predator interactive]]></category>
		<category><![CDATA[welcome]]></category>

		<guid isPermaLink="false">http://www.predatorinteractive.com/?p=256</guid>
		<description><![CDATA[Know a little C++? Want to learn 2D game programming? Start here to learn more!<!-- Easy AdSense V2.92 -->
<!-- Post[count: 1] -->
<div class="ezAdsense adsense adsense-leadout" style="text-align:center;margin:12px;"><script type="text/javascript"><!--
google_ad_client = "pub-8758858260781245";
/* 468x60, created 6/19/09 */
google_ad_slot = "6950501204";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<!-- Easy AdSense V2.92 -->

]]></description>
			<content:encoded><![CDATA[<p><span style="color:    #ffffff;">h</span></p>
<p><span style="color: #ffffff;"><br />
</span></p>
<h2><span style="text-decoration: underline;">Welcome to Predator Interactive.</span></h2>
<h3><span style="text-decoration: underline;"><strong>What do I need to know?</strong></span></h3>
<p>All you need is at least a little bit of C++ knowledge to start using one of our amazing graphics packages.  No graphics programming knowledge is required.</p>
<h3><strong><a title="Instinct Graphics Package" href="http://www.predatorinteractive.com/category/graphicspackages/instinct-graphics-package" target="_self">Instinct Graphics Package<br />
</a></strong></h3>
<p style="padding-left: 30px;"><strong>Suggested User: </strong>Beginning C++ Programmer or Beginning Game Programmer</p>
<p style="padding-left: 30px;">The first is the Instinct Graphics Package.  If you have limited to intermediate knowledge of C++, have had no experience with graphics programming, or would just like to try something easy to start off with, we definitely suggest this.  Don&#8217;t be fooled though, this is still a powerful package that can do lots of interesting programs.  For more info on the Instinct Graphics Package, check out our video tutorials on that <a href="http://www.predatorinteractive.com/category/graphicspackages/instinct-graphics-package"><strong>here</strong></a>.</p>
<p>We hope that you will find everything you need here to transcend from noob to 2D game programming master.</p>
<!-- Easy AdSense V2.92 -->
<!-- Post[count: 2] -->
<div class="ezAdsense adsense adsense-leadout" style="text-align:center;margin:12px;"><script type="text/javascript"><!--
google_ad_client = "pub-8758858260781245";
/* 468x60, created 6/19/09 */
google_ad_slot = "6950501204";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<!-- Easy AdSense V2.92 -->

]]></content:encoded>
			<wfw:commentRss>http://www.predatorinteractive.com/new/welcome-to-predator-interactive/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>9. Playing Audio</title>
		<link>http://www.predatorinteractive.com/instinct-graphics-package/9-playing-audio</link>
		<comments>http://www.predatorinteractive.com/instinct-graphics-package/9-playing-audio#comments</comments>
		<pubDate>Tue, 23 Jun 2009 05:14:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Instinct Graphics Package]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[ogg]]></category>
		<category><![CDATA[sound]]></category>
		<category><![CDATA[wav]]></category>

		<guid isPermaLink="false">http://www.predatorinteractive.com/?p=242</guid>
		<description><![CDATA[Coming Soon!<!-- Easy AdSense V2.92 -->
<!-- Post[count: 3] -->
<div class="ezAdsense adsense adsense-leadout" style="text-align:center;margin:12px;"><script type="text/javascript"><!--
google_ad_client = "pub-8758858260781245";
/* 468x60, created 6/19/09 */
google_ad_slot = "6950501204";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<!-- Easy AdSense V2.92 -->

]]></description>
			<content:encoded><![CDATA[<p>Learn how to play different types of music and sounds as well as converting different types of audio to more suitable file types.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.predatorinteractive.com/instinct-graphics-package/9-playing-audio/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>8. Real Time User Input</title>
		<link>http://www.predatorinteractive.com/instinct-graphics-package/8-real-time-user-input</link>
		<comments>http://www.predatorinteractive.com/instinct-graphics-package/8-real-time-user-input#comments</comments>
		<pubDate>Tue, 23 Jun 2009 05:09:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Instinct Graphics Package]]></category>
		<category><![CDATA[input]]></category>
		<category><![CDATA[key]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[real time]]></category>
		<category><![CDATA[user]]></category>

		<guid isPermaLink="false">http://www.predatorinteractive.com/?p=237</guid>
		<description><![CDATA[Coming Soon!]]></description>
			<content:encoded><![CDATA[<p>Be able to now get real time feedback from the user without halting your program.  You should know the basics of animations prior to trying this one out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.predatorinteractive.com/instinct-graphics-package/8-real-time-user-input/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>7. Basic Animation and Timers</title>
		<link>http://www.predatorinteractive.com/instinct-graphics-package/7-basic-animation-and-timers</link>
		<comments>http://www.predatorinteractive.com/instinct-graphics-package/7-basic-animation-and-timers#comments</comments>
		<pubDate>Tue, 23 Jun 2009 05:06:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Instinct Graphics Package]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[ball]]></category>
		<category><![CDATA[bouncing]]></category>
		<category><![CDATA[frame]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[timer]]></category>

		<guid isPermaLink="false">http://www.predatorinteractive.com/?p=233</guid>
		<description><![CDATA[How to generally setup your program for doing animations and using Timers to ensure the program runs the same across different computers.]]></description>
			<content:encoded><![CDATA[<div id="wp_zdytfp_container_233" style="width:100%; height:470px; text-align:center; margin:auto;">
<div id="v_wp_zdytfp_container_233" style="width:100%; height:100%;">ZD YouTube FLV Player</div>
</div>
<script type="text/javascript">
var flashvars = {
vurl: "http://www.predatorinteractive.com/wp-content/uploads/2009/06/instinct_animation.mp4",
autoplay: "yes",
yturl: "http://www.predatorinteractive.com/wp-content/plugins/zd-youtube-flv-player/fl_youTubeProxy.php"
};
var params = {
wmode: "transparent",
allowFullScreen: "true"
};
var attributes = {
id: "my_wp_zdytfp_container_233",
name: "my_wp_zdytfp_container_233"
};
swfobject.embedSWF("http://www.predatorinteractive.com/wp-content/plugins/zd-youtube-flv-player/flash/zdytflv-player-dark.swf", "v_wp_zdytfp_container_233", "630", "470", "9.0.0", false, flashvars, params, attributes);
</script>

<p><span style="color:   #ffffff;">h</span></p>
<p><span style="color: #ffffff;"><br />
</span></p>
<h2><span style="text-decoration: underline;">Basic Animation and Timers</span></h2>
<p>Prior to actually getting into the animation code, let&#8217;s take a quick look at timers.</p>
<h3><span style="text-decoration: underline;">Timers</span></h3>
<p>To create a timer which has a time value of zero, simply type: <strong>&#8220;Timer name_of_timer<span style="color: #ff0000;">;</span><span style="color: #000000;">&#8220;</span></strong><br />
Example:</p>
<ul>
<li>Timer animation_timer<span style="color: #ff0000;">;</span></li>
<li>Timer stopwatch<span style="color: #ff0000;">;</span></li>
</ul>
<p><span style="color: #000000;">The basic functions of timers are as follow:</span></p>
<ul>
<li><span style="color: #000000;">timer<span style="color: #ff0000;">.</span>start<span style="color: #ff0000;">();</span> <span style="color: #808080;">//Makes the timer starting ticking.</span><br />
</span></li>
<li><span style="color: #000000;">timer<span style="color: #ff0000;">.</span>stop<span style="color: #ff0000;">(); </span><span style="color: #808080;">//Stops the timer from ticking.</span></span></li>
<li><span style="color: #000000;">timer<span style="color: #ff0000;">.</span>reset<span style="color: #ff0000;">();</span> <span style="color: #808080;">//Resets the time value of the timer to zero regardless if it is running or not.</span></span></li>
</ul>
<p><span style="color: #000000;">To get the number of <em><strong>milliseconds</strong></em> on the timer, use the member function: <strong>&#8220;timer<span style="color: #ff0000;">.</span>get_time<span style="color: #ff0000;">();<span style="color: #000000;">&#8220;</span><br />
</span></strong><span style="color: #ff0000;"><span style="color: #000000;">Example:</span></span></span></p>
<ul>
<li><span style="color: #000000;"><span style="color: #ff0000;"><span style="color: #000000;"><span style="color: #0000ff;">int</span> milliseconds <span style="color: #ff0000;">=</span> timer<span style="color: #ff0000;">.</span>get_time<span style="color: #ff0000;">();</span></span></span></span></li>
<li><span style="color: #000000;"><span style="color: #ff0000;"><span style="color: #000000;">win <span style="color: #ff0000;">&lt;&lt;</span> Message<span style="color: #ff0000;">(</span>Point<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">5</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">5</span><span style="color: #ff0000;">),</span> timer<span style="color: #ff0000;">.</span>get_time<span style="color: #ff0000;">());</span></span></span></span></li>
<li><span style="color: #000000;"><span style="color: #ff0000;"><span style="color: #000000;"><span style="color: #0000ff;">if</span><span style="color: #ff0000;">(</span>timer.get_time<span style="color: #ff0000;">()</span> <span style="color: #ff0000;">&gt;</span> <span style="color: #ff00ff;">1000</span><span style="color: #ff0000;">)</span></span></span></span></li>
</ul>
<p>To add time to the timer use the <strong>&#8220;timer<span style="color: #ff0000;">.</span>add_time<span style="color: #ff0000;">(</span><span style="color: #0000ff;">double</span> milliseconds<span style="color: #ff0000;">);<span style="color: #000000;">&#8220;</span></span></strong><span style="color: #000000;"> </span>member function.<br />
Example:</p>
<ul>
<li>timer<span style="color: #ff0000;">.</span>add_time<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">20000</span><span style="color: #ff0000;">);</span></li>
<li>timer<span style="color: #ff0000;">.</span>add_time<span style="color: #ff0000;">(</span>penalty_time<span style="color: #ff0000;">);</span></li>
</ul>
<p><span style="color: #000000;">To check if the time has passed some number of milliseconds use:<strong><span style="color: #000000;"> &#8220;</span><span style="color: #0000ff;">bool</span> timer<span style="color: #ff0000;">.</span>has_passed<span style="color: #ff0000;">(</span><span style="color: #0000ff;">double</span> milliseconds<span style="color: #ff0000;">);<span style="color: #000000;">&#8220;</span><br />
</span></strong><span style="color: #ff0000;"><span style="color: #000000;">Example:</span></span></span></p>
<ul>
<li><span style="color: #000000;"><span style="color: #ff0000;"><span style="color: #000000;"><span style="color: #0000ff;">if</span><span style="color: #ff0000;">(</span>timer<span style="color: #ff0000;">.</span>has_passed<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">15000</span><span style="color: #ff0000;">));</span></span></span></span></li>
<li><span style="color: #000000;"><span style="color: #ff0000;"><span style="color: #000000;"><span style="color: #0000ff;">bool</span> passed <span style="color: #ff0000;">=</span> timer<span style="color: #ff0000;">.</span>has_passed<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">10500</span><span style="color: #ff0000;">);</span></span></span></span></li>
</ul>
<h3><span style="text-decoration: underline;">Wait for</span></h3>
<p>You can also use the <strong>&#8220;wait_for<span style="color: #ff0000;">(</span><span style="color: #0000ff;">double</span> milliseconds<span style="color: #ff0000;">)<span style="color: #000000;">&#8220;</span></span></strong><span style="color: #ff0000;"> </span>function which makes the program wait for the passed in number of milliseconds.<br />
Example:</p>
<ul>
<li>wait_for<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">10000</span><span style="color: #ff0000;">);</span> <span style="color: #808080;">//The program will wait here for 10 seconds.</span></li>
<li>wait_for<span style="color: #ff0000;">(</span>delay_time<span style="color: #ff0000;">);</span> <span style="color: #808080;">//The program will wait here for delay_time milliseconds.</span></li>
</ul>
<p>Remember, there are <span style="color: #ff00ff;">1000</span> milliseconds in <span style="color: #ff00ff;">1</span> second.</p>
<h2><span style="text-decoration: underline;">Animation</span></h2>
<p>To better understand animation, here is a general definition:<strong> Seeing a series of rapid pictures that gives the illusion of movement.</strong></p>
<h3><strong><span style="text-decoration: underline;">Frames</span><br />
</strong></h3>
<p>We are going to call these individual pictures that create this illusion of movement<em><strong> frames. </strong></em>So for example here are a series of four frames:</p>
<p style="text-align: center;"><a rel="attachment wp-att-489" href="http://www.predatorinteractive.com/instinct-graphics-package/7-basic-animation-and-timers/attachment/movingballframe_1"><img class="alignnone size-full wp-image-489" title="movingballframe_1" src="http://www.predatorinteractive.com/wp-content/uploads/2009/06/movingballframe_1.gif" alt="movingballframe_1" width="132" height="132" /></a> <a rel="attachment wp-att-490" href="http://www.predatorinteractive.com/instinct-graphics-package/7-basic-animation-and-timers/attachment/movingballframe_2"><img class="alignnone size-full wp-image-490" title="movingballframe_2" src="http://www.predatorinteractive.com/wp-content/uploads/2009/06/movingballframe_2.gif" alt="movingballframe_2" width="132" height="132" /></a> <a rel="attachment wp-att-491" href="http://www.predatorinteractive.com/instinct-graphics-package/7-basic-animation-and-timers/attachment/movingballframe_3"><img class="alignnone size-full wp-image-491" title="movingballframe_3" src="http://www.predatorinteractive.com/wp-content/uploads/2009/06/movingballframe_3.gif" alt="movingballframe_3" width="132" height="132" /></a> <a rel="attachment wp-att-492" href="http://www.predatorinteractive.com/instinct-graphics-package/7-basic-animation-and-timers/attachment/movingballframe_4"><img class="alignnone size-full wp-image-492" title="movingballframe_4" src="http://www.predatorinteractive.com/wp-content/uploads/2009/06/movingballframe_4.gif" alt="movingballframe_4" width="132" height="132" /></a></p>
<p>Now if we show each of these frames one after another with a small pause in between, we will see what <em>looks</em> like a ball moving. This illusion is the basis behind animation!</p>
<p style="text-align: center;"><a rel="attachment wp-att-498" href="http://www.predatorinteractive.com/instinct-graphics-package/7-basic-animation-and-timers/attachment/movingball"><img class="size-full wp-image-498 aligncenter" title="movingball" src="http://www.predatorinteractive.com/wp-content/uploads/2009/06/movingball.gif" alt="movingball" width="180" height="180" /></a></p>
<p style="text-align: left;">Now that we hopefully have a better understanding of how animation works, we can put it to use with the Instinct Graphics Package.</p>
<h3 style="text-align: left;"><span style="text-decoration: underline;">Coding Animation</span></h3>
<p>Well we could code the above example by simply drawing a ball, moving it and redrawing it.  If we did that four times in our code with a <strong>wait_for<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">100</span><span style="color: #ff0000;">);</span></strong> in between each of those to cause a slight pause, we could reproduce the moving blue ball easily.<br />
Example:</p>
<pre style="padding-left: 30px;">Circle circ <span style="color: #ff0000;">=</span> Circle<span style="color: #ff0000;">(</span>Point<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">1</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">5</span><span style="color: #ff0000;">),</span> <span style="color: #ff00ff;">1</span><span style="color: #ff0000;">,</span> BLUE<span style="color: #ff0000;">,</span> <span style="color: #0000ff;">true</span><span style="color: #ff0000;">);</span>

<span style="color: #808080;">//Frame 1</span>
win <span style="color: #ff0000;">&lt;&lt;</span> circ<span style="color: #ff0000;">;</span>
win<span style="color: #ff0000;">.</span>output_buffer<span style="color: #ff0000;">();</span>

<span style="color: #808080;">//Frame 2</span>
wait_for<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">100</span><span style="color: #ff0000;">);</span>
circ<span style="color: #ff0000;">.</span>move<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">1</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">0</span><span style="color: #ff0000;">);</span>
win.clear_buffer<span style="color: #ff0000;">();</span>
win <span style="color: #ff0000;">&lt;&lt;</span> circ<span style="color: #ff0000;">;</span>
win<span style="color: #ff0000;">.</span>output_buffer<span style="color: #ff0000;">();</span>

<span style="color: #808080;">//Frame 3</span>
wait_for<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">100</span><span style="color: #ff0000;">);</span>
circ<span style="color: #ff0000;">.</span>move<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">1</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">0</span><span style="color: #ff0000;">);</span>
win.clear_buffer<span style="color: #ff0000;">();</span>
win <span style="color: #ff0000;">&lt;&lt;</span> circ<span style="color: #ff0000;">;</span>
win<span style="color: #ff0000;">.</span>output_buffer<span style="color: #ff0000;">();</span>

<span style="color: #808080;">//Frame 4</span>
wait_for<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">100</span><span style="color: #ff0000;">);</span>
circ<span style="color: #ff0000;">.</span>move<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">1</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">0</span><span style="color: #ff0000;">);</span>
win.clear_buffer<span style="color: #ff0000;">();</span>
win <span style="color: #ff0000;">&lt;&lt;</span> circ<span style="color: #ff0000;">;</span>
win<span style="color: #ff0000;">.</span>output_buffer<span style="color: #ff0000;">();
</span></pre>
<p>As you can see above, the frames 2-4 become very much the same. If we wanted more frames we would have to continue copying and pasting the same code for each frame.</p>
<h3><span style="text-decoration: underline;">Using loops</span></h3>
<p>However, if we use a loop that moves everything and redraws it each time, we could have as many frames as we want without having to continuously add code for each frame.<br />
Example:</p>
<pre style="padding-left: 30px;">win <span style="color: #ff0000;">&lt;&lt;</span> circ<span style="color: #ff0000;">;</span>
win<span style="color: #ff0000;">.</span>output_buffer<span style="color: #ff0000;">();</span>

<span style="color: #808080;"><span style="color: #0000ff;">while</span><span style="color: #ff0000;">(</span><span style="color: #0000ff;">true</span><span style="color: #ff0000;">)</span>
<span style="color: #ff0000;">{</span></span>
    wait_for<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">100</span><span style="color: #ff0000;">);</span>
    circ<span style="color: #ff0000;">.</span>move<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">1</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">0</span><span style="color: #ff0000;">);</span>
    win.clear_buffer<span style="color: #ff0000;">();</span>
    win <span style="color: #ff0000;">&lt;&lt;</span> circ<span style="color: #ff0000;">;</span>
    win<span style="color: #ff0000;">.</span>output_buffer<span style="color: #ff0000;">();
}</span></pre>
<p>With the <strong><span style="color: #0000ff;">while</span><span style="color: #ff0000;">(</span><span style="color: #0000ff;">true</span><span style="color: #ff0000;">)</span></strong>, the program will continuously run that loop until we close the program.  So now the loop will continously do frame after frame of moving the ball and redrawing it.</p>
<h3><span style="text-decoration: underline;">Frame Rate<br />
</span></h3>
<p>As you can see above, we were using a value of <span style="color: #ff00ff;">100</span> as the number of milliseconds to wait in between each frame.  This in practice is not a nice number to use since that only allows us to have around <span style="color: #ff00ff;">10</span> frames per second (FPS), which is not a good number.  Generally speaking, a good frame rate for animated programs is usually in between <span style="color: #ff00ff;">60</span> and <span style="color: #ff00ff;">30</span> frames per second.  Because of that, I would suggest using a wait_for amount of <strong><span style="color: #ff00ff;">20</span></strong> milliseconds, which in turn creates a frame rate of around <span style="color: #ff00ff;">50</span> FPS.</p>
<ul>
<li>wait_for<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">20</span><span style="color: #ff0000;">);</span></li>
</ul>
<p>Just keep in mind that this wait_for<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">20</span><span style="color: #ff0000;">);</span> by itself is not the best way to do timing for animation, but it is the simplest.  Later we will go over better and more advanced forms of doing timing for animation loops.</p>
<h3><span style="text-decoration: underline;">Sectioning the Animation Loop</span></h3>
<p>The last bit of advice I would suggest is to always split up the animation loop into two sections to make sure it is done right:</p>
<pre style="padding-left: 30px;"><span style="color: #808080;"><span style="color: #0000ff;">while</span><span style="color: #ff0000;">(</span><span style="color: #0000ff;">true</span><span style="color: #ff0000;">)</span>
<span style="color: #ff0000;">{</span></span>
    wait_for<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">20</span><span style="color: #ff0000;">);</span>

    <span style="color: #808080;">///////////////////
    // Handle Logic
    /////////////////</span><span style="color: #808080;">//</span>
    circ<span style="color: #ff0000;">.</span>move<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">1</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">0</span><span style="color: #ff0000;">);

    <span style="color: #808080;">///////////////////
    // Draw Everything
    ///////////////////</span>
</span>    win.clear_buffer<span style="color: #ff0000;">();</span>
    win <span style="color: #ff0000;">&lt;&lt;</span> circ<span style="color: #ff0000;">;</span>
    win<span style="color: #ff0000;">.</span>output_buffer<span style="color: #ff0000;">();
}
</span></pre>
<p>There should be two distinct sections, the section that handles all the logic of the animation (moving objects, doing collision detection, changing colors of objects, etc), and a section that simply draws everything that needs to be drawn.  So what does this mean?  There should be NO drawing of objects in the <em><strong>Handle Logic</strong></em> section, and only code that deals with the drawing of objects in the <em><strong>Draw Everything</strong></em> section.  If you code is sectioned properly and done correctly, your animation should come out nice and smooth and work perfectly with no flickering.</p>
<h3><span style="text-decoration: underline;">What Now?</span></h3>
<p>Now the rest is up to you in terms of what you want to do in this animation loop.  You don&#8217;t have to have a ball that moves around solely in the X direction.  This was merely an example. You can use Rects, Circles, Images, etc. to make anything you can think of.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.predatorinteractive.com/instinct-graphics-package/7-basic-animation-and-timers/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.predatorinteractive.com/wp-content/uploads/2009/06/instinct_animation.mp4" length="40893731" type="video/mp4" />
		</item>
		<item>
		<title>6. Creating and Drawing Images</title>
		<link>http://www.predatorinteractive.com/instinct-graphics-package/6-creating-and-drawing-images</link>
		<comments>http://www.predatorinteractive.com/instinct-graphics-package/6-creating-and-drawing-images#comments</comments>
		<pubDate>Tue, 23 Jun 2009 05:02:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Instinct Graphics Package]]></category>
		<category><![CDATA[drawing]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[sprites]]></category>

		<guid isPermaLink="false">http://www.predatorinteractive.com/?p=231</guid>
		<description><![CDATA[All the basics about where to put your images, how to draw them, and helpful hints about transparency.]]></description>
			<content:encoded><![CDATA[<div id="wp_zdytfp_container_231" style="width:100%; height:470px; text-align:center; margin:auto;">
<div id="v_wp_zdytfp_container_231" style="width:100%; height:100%;">ZD YouTube FLV Player</div>
</div>
<script type="text/javascript">
var flashvars = {
vurl: "http://www.predatorinteractive.com/wp-content/uploads/2009/06/instinctimages.mp4",
autoplay: "yes",
yturl: "http://www.predatorinteractive.com/wp-content/plugins/zd-youtube-flv-player/fl_youTubeProxy.php"
};
var params = {
wmode: "transparent",
allowFullScreen: "true"
};
var attributes = {
id: "my_wp_zdytfp_container_231",
name: "my_wp_zdytfp_container_231"
};
swfobject.embedSWF("http://www.predatorinteractive.com/wp-content/plugins/zd-youtube-flv-player/flash/zdytflv-player-dark.swf", "v_wp_zdytfp_container_231", "630", "470", "9.0.0", false, flashvars, params, attributes);
</script>

<p><span style="color:   #ffffff;">h</span></p>
<p><span style="color: #ffffff;"><br />
</span></p>
<p>All the basics about where to put your images, how to draw them, and helpful hints about transparency.</p>
<p><strong>Image Types</strong></p>
<p>JPEG &#8211; Does no transparency.</p>
<p>GIF &#8211; Does either full transparency or full opaque.</p>
<p>PNG &#8211; Does any level of transparency and opacity.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.predatorinteractive.com/instinct-graphics-package/6-creating-and-drawing-images/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.predatorinteractive.com/wp-content/uploads/2009/06/instinctimages.mp4" length="6667316" type="video/mp4" />
		</item>
		<item>
		<title>5. Window and Coordinate Resizing</title>
		<link>http://www.predatorinteractive.com/instinct-graphics-package/5-window-and-coordinate-resizing</link>
		<comments>http://www.predatorinteractive.com/instinct-graphics-package/5-window-and-coordinate-resizing#comments</comments>
		<pubDate>Tue, 23 Jun 2009 05:00:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Instinct Graphics Package]]></category>
		<category><![CDATA[coord]]></category>
		<category><![CDATA[win]]></category>
		<category><![CDATA[window size]]></category>

		<guid isPermaLink="false">http://www.predatorinteractive.com/?p=228</guid>
		<description><![CDATA[Functions that will allow you to change both the coordinate system and actual window size.]]></description>
			<content:encoded><![CDATA[<div id="wp_zdytfp_container_228" style="width:100%; height:470px; text-align:center; margin:auto;">
<div id="v_wp_zdytfp_container_228" style="width:100%; height:100%;">ZD YouTube FLV Player</div>
</div>
<script type="text/javascript">
var flashvars = {
vurl: "http://www.predatorinteractive.com/wp-content/uploads/2009/06/instinctwindowresize.mp4",
autoplay: "yes",
yturl: "http://www.predatorinteractive.com/wp-content/plugins/zd-youtube-flv-player/fl_youTubeProxy.php"
};
var params = {
wmode: "transparent",
allowFullScreen: "true"
};
var attributes = {
id: "my_wp_zdytfp_container_228",
name: "my_wp_zdytfp_container_228"
};
swfobject.embedSWF("http://www.predatorinteractive.com/wp-content/plugins/zd-youtube-flv-player/flash/zdytflv-player-dark.swf", "v_wp_zdytfp_container_228", "630", "470", "9.0.0", false, flashvars, params, attributes);
</script>

<p><span style="color:   #ffffff;">h</span></p>
<p><span style="color: #ffffff;"><br />
</span></p>
<h2><span style="text-decoration: underline;"><strong>Window and Coordinate Resizing<br />
</strong></span></h2>
<p>So we have seen how to draw the basic shapes and how to get user input to build some more interesting programs.   Now let&#8217;s figure out how to modify our coordinate window and the physical window size.</p>
<h3><span style="text-decoration: underline;">Setting the Coordinate System</span></h3>
<p>If you remember from before, our default coordinate system is (0, 0) in the bottom left corner, and (10, 10) in the top right corner.</p>
<p style="text-align: center;"><a href="http://www.predatorinteractive.com/?attachment_id=548"><img class="aligncenter size-full wp-image-548" title="coord" src="http://www.predatorinteractive.com/wp-content/uploads/2010/05/coord.PNG" alt="coord" width="412" height="430" /></a></p>
<p>We do have a function for changing the coordinate system: <strong><br />
win<span style="color: #ff0000;">.</span>coord<span style="color: #ff0000;">(</span><span style="color: #0000ff;">double</span> ll_x, <span style="color: #0000ff;">double</span> ll_y, <span style="color: #0000ff;">double</span> ur_x, <span style="color: #0000ff;">double</span> ur_y<span style="color: #ff0000;">);<br />
</span></strong><span style="color: #000000;"><em>Example:</em></span><strong><span style="color: #ff0000;"> </span></strong></p>
<ul>
<li>win<span style="color: #ff0000;">.</span>coord<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">0</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">0</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">10</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">10</span><span style="color: #ff0000;">);</span> <span style="color: #999999;">//Default coordinate system</span></li>
<li>win<span style="color: #ff0000;">.</span>coord<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">0</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">0</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">50</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">50</span><span style="color: #ff0000;">);</span></li>
<li>win<span style="color: #ff0000;">.</span>coord<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">-124.5</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">76</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">92.4</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">-33.7</span><span style="color: #ff0000;">);</span></li>
</ul>
<p>So for example three up there, our coordinate system would be this after that call:</p>
<p style="text-align: center;"><a href="http://www.predatorinteractive.com/?attachment_id=549"><img class="aligncenter size-full wp-image-549" title="coord2" src="http://www.predatorinteractive.com/wp-content/uploads/2010/05/coord2.PNG" alt="coord2" width="413" height="430" /></a></p>
<p>So the first two values of <strong>win<span style="color: #ff0000;">.</span>coord<span style="color: #ff0000;">(</span>ll_x,  ll_y, ur_x, ur_y<span style="color: #ff0000;">)</span></strong> are the X and Y of the lower left corner of the  coordinate system on the screen and the second two values are the X and Y  of the upper left corner.</p>
<h3><span style="text-decoration: underline;">Changing the Screen Size</span></h3>
<p>As you have probably noticed, our default physical window is a square:</p>
<p style="text-align: center;"><a rel="attachment wp-att-551" href="http://www.predatorinteractive.com/instinct-graphics-package/5-window-and-coordinate-resizing/attachment/squaresize"><img class="aligncenter size-full wp-image-551" title="squaresize" src="http://www.predatorinteractive.com/wp-content/uploads/2010/05/squaresize.PNG" alt="squaresize" width="330" height="344" /></a></p>
<p style="text-align: center;">
<p><strong>The default size of our window is <span style="color: #ff00ff;">500 </span>pixels for the width and <span style="color: #ff00ff;">500</span> pixels for the height.</strong></p>
<p>If you ever want to change the size of your window<strong>, (not the coordinate system)</strong>, you can use this function: <strong>win<span style="color: #ff0000;">.</span>set_window_size<span style="color: #ff0000;">(</span><span style="color: #0000ff;">int</span> width<span style="color: #ff0000;">, </span><span style="color: #0000ff;">int</span> height<span style="color: #ff0000;">);<br />
</span></strong><span style="color: #ff0000;"><span style="color: #000000;"><em>Example:</em></span></span></p>
<ul>
<li><span style="color: #ff0000;"><span style="color: #000000;">win<span style="color: #ff0000;">.</span>set_window_size<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">500</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">500</span><span style="color: #ff0000;">);</span> <span style="color: #808080;">//Default window size</span></span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;">win<span style="color: #ff0000;">.</span>set_window_size<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">800</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">600</span><span style="color: #ff0000;">);</span></span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;">win<span style="color: #ff0000;">.</span>set_window_size<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">1280, </span><span style="color: #ff0000;"> </span> <span style="color: #ff00ff;">720</span><span style="color: #ff0000;">);</span></span></span></li>
</ul>
<p><strong>If you are looking for a decent wide window size, standards like </strong><strong><span style="color: #ff00ff;">800</span> x <span style="color: #ff00ff;">600</span>, <span style="color: #ff00ff;">1024</span> x <span style="color: #ff00ff;">768</span>, <span style="color: #ff00ff;">1280</span> x <span style="color: #ff00ff;">720</span> are good sizes to use.</strong></p>
<p>To get an idea of what resizing the window would do, here is what the window would look like after running the second example above (<span style="color: #ff00ff;">800</span> x <span style="color: #ff00ff;">600</span>):</p>
<p style="text-align: center;"><a href="http://www.predatorinteractive.com/?attachment_id=550"></a><a rel="attachment wp-att-550" href="http://www.predatorinteractive.com/instinct-graphics-package/5-window-and-coordinate-resizing/attachment/rectwindow"><img class="aligncenter size-full wp-image-550" title="rectwindow" src="http://www.predatorinteractive.com/wp-content/uploads/2010/05/rectwindow.PNG" alt="rectwindow" width="523" height="408" /></a></p>
<p>Ut oh! The window looks bigger but the circle no longer looks correct.  The reason is because we stretched the window without changing our coordinate system.</p>
<h3><span style="text-decoration: underline;"><strong>Choosing Coordinate Systems for Certain Window Sizes</strong></span></h3>
<p><strong>To get the best results, you should use window sizes and coordinate sizes that are of the same ratio.</strong></p>
<p>The reason the default window size and coordinate size look alright is because both are ratio <strong>1 : 1</strong>.</p>
<ul>
<li>Default Coordinate System: <span style="color: #ff00ff;">10</span> by <span style="color: #ff00ff;">10</span>.  <span style="color: #ff00ff;">10</span> / <span style="color: #ff00ff;">10</span> =&gt;  <span style="color: #ff00ff;">1</span> / <span style="color: #ff00ff;">1 </span> =&gt; <strong> 1 : 1</strong></li>
<li>Default Window Size: <span style="color: #ff00ff;">500</span> by <span style="color: #ff00ff;">500</span>.  <span style="color: #ff00ff;">500</span> / <span style="color: #ff00ff;">500</span> =&gt;  <span style="color: #ff00ff;">1</span> /<span style="color: #ff00ff;"> 1</span> =&gt;  <strong>1 : 1</strong></li>
</ul>
<p>Since both the coordinate system and window size are of the same ratio <strong>1 : 1</strong>, everything drawn looks normal.</p>
<p><strong>But why did it look stretched when we changed the window size to <span style="color: #ff00ff;">800</span> x <span style="color: #ff00ff;">600</span>?</strong></p>
<ul>
<li>Default Coordinate System: <span style="color: #ff00ff;">10</span> by <span style="color: #ff00ff;">10</span>.  <span style="color: #ff00ff;">10</span> / <span style="color: #ff00ff;">10</span> =&gt; <span style="color: #ff00ff;">1</span> / <span style="color: #ff00ff;">1</span> =&gt;  <strong>1 : 1</strong></li>
<li>New Window Size: <span style="color: #ff00ff;">800</span> by <span style="color: #ff00ff;">600</span>.   <span style="color: #ff00ff;">800 </span>/<span style="color: #ff00ff;"> 600</span> =&gt; <span style="color: #ff00ff;">4</span> / <span style="color: #ff00ff;">3</span> =&gt;  <strong>4 : 3</strong></li>
</ul>
<p>The reason the circle looked stretched was because the coordinate size and window size had different ratios. <strong>1 : 1</strong> and <strong>4 : 3</strong></p>
<p><strong>Solution? Choose a coordinate system that has the same ratio as your window.</strong></p>
<p><strong>win<span style="color: #ff0000;">.</span>coord<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">0</span><span style="color: #ff0000;">, </span><span style="color: #ff00ff;">0</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">40</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">30</span><span style="color: #ff0000;">); </span></strong><span style="color: #ff0000;"><span style="color: #999999;">//Change the coordinate system</span></span><strong><br />
</strong></p>
<ul>
<li>New Coordinate System: <span style="color: #ff00ff;">40</span> by <span style="color: #ff00ff;">30</span>.  <span style="color: #ff00ff;">40</span> / <span style="color: #ff00ff;">30</span> =&gt; <span style="color: #ff00ff;">4</span> / <span style="color: #ff00ff;">3</span> =&gt;  <strong>4 : 3</strong></li>
<li>New Window Size: <span style="color: #ff00ff;">800</span> by <span style="color: #ff00ff;">600</span>.   <span style="color: #ff00ff;">800 </span>/<span style="color: #ff00ff;"> 600</span> =&gt; <span style="color: #ff00ff;">4</span> / <span style="color: #ff00ff;">3</span> =&gt;  <strong>4 : 3</strong></li>
</ul>
<p>Now our coordinate system and window size have the same ratio <strong>4 : 3</strong>! Draw a circle in the center of our new coordinate system.</p>
<ul>
<li>win <span style="color: #ff0000;">&lt;&lt;</span> Circle<span style="color: #ff0000;">(</span>Point<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">20</span><span style="color: #ff0000;">,</span><span style="color: #ff00ff;"> 15</span><span style="color: #ff0000;">),</span> <span style="color: #ff00ff;">5</span><span style="color: #ff0000;">, </span>BLUE<span style="color: #ff0000;">,</span> <span style="color: #0000ff;">true</span><span style="color: #ff0000;">);</span></li>
</ul>
<p style="text-align: center;"><a href="http://www.predatorinteractive.com/?attachment_id=552"><img class="aligncenter size-full wp-image-552" title="widefix" src="http://www.predatorinteractive.com/wp-content/uploads/2010/05/widefix.PNG" alt="widefix" width="523" height="410" /></a></p>
<p style="text-align: left;">Viola! Everything looks normal again!  So now you know how to change your coordinate window and your physical window size. <strong>And remember! Try to use the same ratios for both to make things draw proportionally correct!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.predatorinteractive.com/instinct-graphics-package/5-window-and-coordinate-resizing/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.predatorinteractive.com/wp-content/uploads/2009/06/instinctwindowresize.mp4" length="28898718" type="video/mp4" />
		</item>
		<item>
		<title>4. Clearing the Screen and Functions for Shapes</title>
		<link>http://www.predatorinteractive.com/instinct-graphics-package/clearing-the-screen-and-putting-it-all-together</link>
		<comments>http://www.predatorinteractive.com/instinct-graphics-package/clearing-the-screen-and-putting-it-all-together#comments</comments>
		<pubDate>Sun, 21 Jun 2009 22:32:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Instinct Graphics Package]]></category>
		<category><![CDATA[clearing]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[instinct]]></category>
		<category><![CDATA[shapes]]></category>

		<guid isPermaLink="false">http://www.predatorinteractive.com/?p=193</guid>
		<description><![CDATA[Learn how to clear the screen to draw new stuff and see more functions for shapes.]]></description>
			<content:encoded><![CDATA[<div id="wp_zdytfp_container_193" style="width:100%; height:470px; text-align:center; margin:auto;">
<div id="v_wp_zdytfp_container_193" style="width:100%; height:100%;">ZD YouTube FLV Player</div>
</div>
<script type="text/javascript">
var flashvars = {
vurl: "http://www.predatorinteractive.com/wp-content/uploads/2009/06/instinctclearingandfunctions.flv",
autoplay: "yes",
yturl: "http://www.predatorinteractive.com/wp-content/plugins/zd-youtube-flv-player/fl_youTubeProxy.php"
};
var params = {
wmode: "transparent",
allowFullScreen: "true"
};
var attributes = {
id: "my_wp_zdytfp_container_193",
name: "my_wp_zdytfp_container_193"
};
swfobject.embedSWF("http://www.predatorinteractive.com/wp-content/plugins/zd-youtube-flv-player/flash/zdytflv-player-dark.swf", "v_wp_zdytfp_container_193", "630", "470", "9.0.0", false, flashvars, params, attributes);
</script>

<p><span style="color:   #ffffff;">h</span></p>
<p><span style="color: #ffffff;"><br />
</span></p>
<h2><span style="text-decoration: underline;">Clearing the Screen and Functions for Shapes</span></h2>
<p>Here is a quick overview of how to clear the screen and other functions you have for shapes.</p>
<h3><span style="text-decoration: underline;">Why Do We Need To Clear the Screen?</span></h3>
<p>So what exactly do we mean by clearing the screen.  Well if we did the following code:</p>
<p style="padding-left: 30px;">win <span style="color: #ff0000;">&lt;&lt;</span> Circle<span style="color: #ff0000;">(</span>Point<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">5</span><span style="color: #ff0000;">, </span><span style="color: #ff00ff;">5</span><span style="color: #ff0000;">),</span> <span style="color: #ff00ff;">2</span><span style="color: #ff0000;">);</span><br />
win<span style="color: #ff0000;">.</span>output_buffer<span style="color: #ff0000;">();</span></p>
<p>Naturally we will draw a circle to the screen.  But if we do the following code right afterward:</p>
<p style="padding-left: 30px;">win <span style="color: #ff0000;">&lt;&lt;</span> Rect<span style="color: #ff0000;">(</span>Point<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">2</span><span style="color: #ff0000;">, </span><span style="color: #ff00ff;">2</span><span style="color: #ff0000;">), </span><span style="color: #ff00ff;">3</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">3</span><span style="color: #ff0000;">);</span><br />
win<span style="color: #ff0000;">.</span>output_buffer<span style="color: #ff0000;">();</span></p>
<p>It will then draw a Rectangle to the screen.  However, the circle we initially outputted will still be on there as well. If we want to only have the Rectangle on the screen by itself, we have to clear the circle that we drew before hand. To do that, we need to make sure the buffer is empty prior to inserting the Rect object.</p>
<h3><span style="text-decoration: underline;">Clearing the Screen</span></h3>
<p>To clear the buffer we use the following function: <strong>win<span style="color: #ff0000;">.</span>clear_buffer<span style="color: #ff0000;">();</span></strong></p>
<p>This will clear all of the objects off of the buffer so we can begin inserting new ones to draw.  So now if we do the following code:</p>
<p style="padding-left: 30px;">win <span style="color: #ff0000;">&lt;&lt;</span> Circle<span style="color: #ff0000;">(</span>Point<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">5</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">5</span><span style="color: #ff0000;">),</span> <span style="color: #ff00ff;">2</span><span style="color: #ff0000;">);<br />
</span>win<span style="color: #ff0000;">.</span>output_buffer<span style="color: #ff0000;">();</span></p>
<p style="padding-left: 30px;">win<span style="color: #ff0000;">.</span>clear_buffer<span style="color: #ff0000;">();</span><br />
win <span style="color: #ff0000;">&lt;&lt;</span> Rect<span style="color: #ff0000;">(</span>Point<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">2</span><span style="color: #ff0000;">,</span><span style="color: #ff00ff;"> 2</span><span style="color: #ff0000;">), </span><span style="color: #ff00ff;">3</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">3</span><span style="color: #ff0000;">);</span><br />
win<span style="color: #ff0000;">.</span>output_buffer<span style="color: #ff0000;">();</span></p>
<p>First the circle is added to the buffer and drawn to the screen.  Then everything will be cleared from the buffer with <strong>win<span style="color: #ff0000;">.</span>clear_buffer<span style="color: #ff0000;">()</span></strong>.  This does <strong>NOT</strong> clear the screen, this just clears the drawing buffer.  Then the Rect is added to the empty drawing buffer.  And then finally, the Rect is outputted to the screen by itself with the second call of <strong>win<span style="color: #ff0000;">.</span>output_buffer<span style="color: #ff0000;">();</span></strong></p>
<hr />
<h2><span style="text-decoration: underline;"><span style="color: #ff0000;"><span style="color: #000000;">More Functions for Shapes</span></span></span></h2>
<p><strong><span style="color: #ff0000;"><span style="color: #000000;">Every shape in the Instinct Graphics Package can use the following functions:</span></span></strong></p>
<ul>
<li>obj<span style="color: #ff0000;">.</span>move<span style="color: #ff0000;">(</span><span style="color: #0000ff;">double</span> dx<span style="color: #ff0000;">,</span><span style="color: #0000ff;"> double</span> dy<span style="color: #ff0000;">);<span style="color: #000000;"> </span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;">obj<span style="color: #ff0000;">.</span>get_color<span style="color: #ff0000;">();</span></span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;">obj<span style="color: #ff0000;">.</span>is_filled_in<span style="color: #ff0000;">();</span></span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;"><span style="color: #ff0000;"><span style="color: #000000;"><span style="color: #ff0000;"><span style="color: #000000;">obj<span style="color: #ff0000;">.</span>set_visibility<span style="color: #ff0000;">(</span><span style="color: #0000ff;">double</span> percent<span style="color: #ff0000;">);</span></span></span></span></span></span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;"><span style="color: #ff0000;"><span style="color: #000000;"><span style="color: #ff0000;"><span style="color: #000000;">obj<span style="color: #ff0000;">.</span>get_visibility<span style="color: #ff0000;">();</span><br />
</span></span></span></span></span></span></li>
</ul>
<p>You can also use these functions below which were covered in Tutorial <strong><a href="http://www.predatorinteractive.com/instinct-graphics-package/2-basic-commands-and-drawing-shapes" target="_blank">2. Basic Commands and Drawing Shapes.</a></strong></p>
<ul>
<li>obj<span style="color: #ff0000;">.</span>set_color<span style="color: #ff0000;">(</span>Color color<span style="color: #ff0000;">); </span></li>
<li>obj<span style="color: #ff0000;">.</span>set_filled_in<span style="color: #ff0000;">(</span>bool is_filled<span style="color: #ff0000;">); </span></li>
</ul>
<h3><span style="text-decoration: underline;">Function:</span> obj<span style="color: #ff0000;">.</span>move<span style="color: #ff0000;">(</span><span style="color: #0000ff;">double</span> dx<span style="color: #ff0000;">,</span> <span style="color: #0000ff;">double</span> dy<span style="color: #ff0000;">);</span></h3>
<p><span style="text-decoration: underline;"><strong><span style="color: #ff0000;"> </span></strong></span><strong><span style="color: #ff0000;"><span style="color: #000000;">Definition: Moves the shape dx units in the x direction and dy units in the y direction.</span></span></strong></p>
<ul>
<li><span style="color: #ff0000;"><span style="color: #000000;">c<span style="color: #ff0000;"><span style="color: #000000;">irc</span>.</span>move<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">5</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">4</span><span style="color: #ff0000;">);</span></span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;">message<span style="color: #ff0000;">.</span>move<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">-2</span><span style="color: #ff0000;">,</span> <span style="color: #ff00ff;">3</span><span style="color: #ff0000;">);</span></span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;">triangle<span style="color: #ff0000;">.</span>move<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">0</span><span style="color: #ff0000;">,</span><span style="color: #ff00ff;"> -1</span><span style="color: #ff0000;">);</span><br />
</span></span></li>
</ul>
<p>So for the first example, we moved the Circle circ <span style="color: #ff00ff;">5</span> units in the x direction and<span style="color: #ff00ff;"> 4</span> units in the y direction.</p>
<h3><span style="text-decoration: underline;">Function:</span> obj<span style="color: #ff0000;">.</span>get_color<span style="color: #ff0000;">();</span></h3>
<p><span style="color: #ff0000;"><span style="color: #000000;"><strong>Definition: Returns the color of the shape.</strong></span></span></p>
<ul>
<li> <span style="color: #ff0000;"><span style="color: #000000;"><span style="color: #0000ff;">if</span><span style="color: #ff0000;">(</span>circ<span style="color: #ff0000;">.</span>get_color<span style="color: #ff0000;">() <span style="color: #000000;"><span style="color: #ff0000;">==</span> YELLOW<span style="color: #ff0000;">)</span></span><br />
</span></span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;"><span style="color: #ff0000;"><span style="color: #000000;">Color rect_color <span style="color: #ff0000;">=</span> rect<span style="color: #ff0000;">.</span>get_color<span style="color: #ff0000;">();</span></span><br />
</span></span></span></li>
</ul>
<p>So for the first example, the <span style="color: #0000ff;">if</span> statement is <span style="color: #0000ff;">true</span> if the color of circ is YELLOW.</p>
<h3><span style="text-decoration: underline;">Function:</span> obj<span style="color: #ff0000;">.</span>is_filled_in<span style="color: #ff0000;">();</span></h3>
<p><strong>Definition: Returns whether or not the shape is filled in with color.  <span style="color: #0000ff;">True</span> means it is filled in, <span style="color: #0000ff;">false</span> means it is outlined with color.</strong></p>
<ul>
<li>rect<span style="color: #ff0000;">.</span>is_filled_in<span style="color: #ff0000;">();</span></li>
<li><span style="color: #0000ff;">if</span><span style="color: #ff0000;">(</span>circ<span style="color: #ff0000;">.</span>is_filled_in<span style="color: #ff0000;">())</span></li>
</ul>
<p>The first example returns <span style="color: #0000ff;">true</span> if the Rect rect is filled in, and <span style="color: #0000ff;">false</span> if it is just outline with color.</p>
<h3><span style="text-decoration: underline;">Function:</span> obj<span style="color: #ff0000;">.</span>set_visibility<span style="color: #ff0000;">(</span><span style="color: #ff0000;"><span style="color: #000000;"><span style="color: #0000ff;">double</span> percent</span>);</span></h3>
<p><span style="color: #ff0000;"><strong><span style="color: #000000;">Definition: Sets the visibility of the shape to the percent amount passed in.  A percent value of <span style="color: #ff00ff;">1.0</span> means the shape is fully visible (100% visible). A percent value of <span style="color: #ff00ff;">0.5</span> means the shape is half visible (50% visible). A percent value of <span style="color: #ff00ff;">0.0</span> means the shape is fully invisible (0% visible).<br />
</span></strong></span></p>
<ul>
<li><span style="color: #ff0000;"><span style="color: #000000;">circ<span style="color: #ff0000;">.</span>set_visibility<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">0.75</span><span style="color: #ff0000;">);</span></span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;">message<span style="color: #ff0000;">.</span>set_visibility<span style="color: #ff0000;">(</span><span style="color: #ff00ff;">0.10</span><span style="color: #ff0000;">);</span></span></span></li>
</ul>
<p>The first example sets the visibility of circ to 75%.  So the Circle circ is parcially see-through but mostly visible.</p>
<h3><span style="text-decoration: underline;">Function:</span> obj<span style="color: #ff0000;">.</span>get_visibility<span style="color: #ff0000;">();</span></h3>
<p><strong>Definition: Returns the visibility amount of the shape.</strong></p>
<ul>
<li><span style="color: #0000ff;">if</span><span style="color: #ff0000;">(</span>circ<span style="color: #ff0000;">.</span>get_visibility<span style="color: #ff0000;">() ==</span> <span style="color: #ff00ff;">0.0</span><span style="color: #ff0000;">)</span></li>
<li>rect<span style="color: #ff0000;">.</span>set_visibility<span style="color: #ff0000;">(</span>rect<span style="color: #ff0000;">.</span>get_visiblity<span style="color: #ff0000;">()</span> <span style="color: #ff0000;">-</span> <span style="color: #ff00ff;">0.1</span><span style="color: #ff0000;">);</span></li>
</ul>
<p><span style="color: #000000;">The first example, the <span style="color: #0000ff;">if</span> statement is <span style="color: #0000ff;">true</span> if the visibility of circ is <span style="color: #ff00ff;">0.0</span> (invisible).</span></p>
<hr />
<h2><span style="color: #000000;"><span style="text-decoration: underline;">Functions Specific to each Shape</span></span></h2>
<p><span style="color: #000000;">Each shape also has its own set of specific functions that it&#8217;s shape type.  In other words, there are functions specific to Rects and functions specific to Circles, etc.  So let&#8217;s look at all of those:</span></p>
<h3><span style="text-decoration: underline;"><span style="color: #000000;">Point<br />
</span></span></h3>
<p><span style="color: #000000;">The Point shape has these specific functions it can call as well:</span></p>
<ul>
<li><span style="color: #000000;">pt<span style="color: #ff0000;">.</span>get_x<span style="color: #ff0000;">();</span></span></li>
<li><span style="color: #000000;">pt<span style="color: #ff0000;">.</span>get_y<span style="color: #ff0000;">();</span></span></li>
<li><span style="color: #000000;">pt<span style="color: #ff0000;">.</span>set_x<span style="color: #ff0000;">(</span><span style="color: #0000ff;">double</span> new_x<span style="color: #ff0000;">);</span></span></li>
<li><span style="color: #000000;">pt<span style="color: #ff0000;">.</span>set_y<span style="color: #ff0000;">(</span><span style="color: #0000ff;">double</span> new_y<span style="color: #ff0000;">);</span></span></li>
</ul>
<h3><span style="text-decoration: underline;">Circle</span></h3>
<p>The Circle shape has these specific functions it can call as well:</p>
<ul>
<li>circ<span style="color: #ff0000;">.</span>get_center<span style="color: #ff0000;">();</span></li>
<li>circ<span style="color: #ff0000;">.</span>get_radius<span style="color: #ff0000;">();</span></li>
<li>circ<span style="color: #ff0000;">.</span>set_radius<span style="color: #ff0000;">(</span>double new_radius<span style="color: #ff0000;">);</span></li>
<li>circ<span style="color: #ff0000;">.</span>set_center<span style="color: #ff0000;">(</span>Point new_center<span style="color: #ff0000;">);</span></li>
</ul>
<h3><span style="text-decoration: underline;">Line</span></h3>
<p>The Line shape has these specific functions it can call as well:</p>
<ul>
<li>line<span style="color: #ff0000;">.</span>get_start<span style="color: #ff0000;">();</span></li>
<li>line<span style="color: #ff0000;">.</span>get_end<span style="color: #ff0000;">();</span></li>
<li>line<span style="color: #ff0000;">.</span>set_start<span style="color: #ff0000;">(</span>Point new_start<span style="color: #ff0000;">);</span></li>
<li>line<span style="color: #ff0000;">.</span>set_end<span style="color: #ff0000;">(</span>Point new_end<span style="color: #ff0000;">);</span></li>
</ul>
<h3><span style="text-decoration: underline;">Triangle</span></h3>
<p>The Triangle shape has these specific functions it can call:</p>
<ul>
<li>tri<span style="color: #ff0000;">.</span>get_p1<span style="color: #ff0000;">();</span></li>
<li>tri<span style="color: #ff0000;">.</span>get_p2<span style="color: #ff0000;">();</span></li>
<li>tri<span style="color: #ff0000;">.</span>get_p3<span style="color: #ff0000;">();</span></li>
<li>tri<span style="color: #ff0000;">.</span>set_p1<span style="color: #ff0000;">(</span>Point new_p1<span style="color: #ff0000;">);</span></li>
<li>tri<span style="color: #ff0000;">.</span>set_p2<span style="color: #ff0000;">(</span>Point new_p2<span style="color: #ff0000;">);</span></li>
<li>tri<span style="color: #ff0000;">.</span>set_p3<span style="color: #ff0000;">(</span>Point new_p3<span style="color: #ff0000;">);</span></li>
</ul>
<h3><span style="text-decoration: underline;">Message</span></h3>
<p>The Message shape has these specific functions it can call:</p>
<ul>
<li>message<span style="color: #ff0000;">.</span>get_text<span style="color: #ff0000;">();</span></li>
<li>message<span style="color: #ff0000;">.</span>get_lower_left<span style="color: #ff0000;">();</span></li>
<li>message<span style="color: #ff0000;">.</span>set_text<span style="color: #ff0000;">(</span><span style="color: #000000;">string</span> text<span style="color: #ff0000;">);<br />
</span>message<span style="color: #ff0000;">.</span>set_text<span style="color: #ff0000;">(</span><span style="color: #0000ff;">int </span>text<span style="color: #ff0000;">);</span><br />
message<span style="color: #ff0000;">.</span>set_text<span style="color: #ff0000;">(</span><span style="color: #0000ff;">double</span> text<span style="color: #ff0000;">); </span></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.predatorinteractive.com/instinct-graphics-package/clearing-the-screen-and-putting-it-all-together/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Audio Editor, Image Editor, and Install Creator</title>
		<link>http://www.predatorinteractive.com/usefulstuff/audio-editor-image-editor-and-install-creator</link>
		<comments>http://www.predatorinteractive.com/usefulstuff/audio-editor-image-editor-and-install-creator#comments</comments>
		<pubDate>Sat, 20 Jun 2009 03:08:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Useful Stuff]]></category>
		<category><![CDATA[audacity]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[gimp]]></category>
		<category><![CDATA[installer]]></category>

		<guid isPermaLink="false">http://www.predatorinteractive.com/?p=157</guid>
		<description><![CDATA[Here we have three great and free programs to help with creating content for your games and programs.

Audacity &#8211; Audio Editing Program
Gimp &#8211; Image Editor
Install Creator &#8211; Makes Install Files for Programs

Audacity
This is a simple yet powerful audio editing program that can mix channels, add effects, and save to multiple file types including Ogg Vorbis [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Here we have three great and free programs to help with creating content for your games and programs.</strong></p>
<ul>
<li><strong>Audacity</strong> &#8211; Audio Editing Program</li>
<li><strong>Gimp</strong> &#8211; Image Editor</li>
<li><strong>Install Creator</strong> &#8211; Makes Install Files for Programs</li>
</ul>
<h3><span style="text-decoration: underline;">Audacity</span></h3>
<p>This is a simple yet powerful audio editing program that can mix channels, add effects, and save to multiple file types including Ogg Vorbis which is used a lot in the game industry.</p>
<p><a href="http://audacity.sourceforge.net/">http://audacity.sourceforge.net/</a></p>
<h3><span style="text-decoration: underline;">Gimp </span></h3>
<p>If you don&#8217;t have the cash for Photoshop, then Gimp is probably your best next bet.  Not as powerful and easy as Photoshop, but should be able to do enough for all that sprite editing.</p>
<p><a href="http://www.gimp.org/">http://www.gimp.org/</a></p>
<h3><span style="text-decoration: underline;">Install Creator </span></h3>
<p>A neat little program that creates installers out of zip files.  Allows you to place programs in the Program Files, auto create a short-cut to the desktop, and even can create an uninstaller that you can find on the Add/Remove Programs.</p>
<p><a href="http://www.clickteam.com/website/usa/installcreator.html">http://www.clickteam.com/website/usa/installcreator.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.predatorinteractive.com/usefulstuff/audio-editor-image-editor-and-install-creator/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3. Getting Basic User Input</title>
		<link>http://www.predatorinteractive.com/instinct-graphics-package/3-getting-user-input</link>
		<comments>http://www.predatorinteractive.com/instinct-graphics-package/3-getting-user-input#comments</comments>
		<pubDate>Fri, 19 Jun 2009 23:32:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Instinct Graphics Package]]></category>
		<category><![CDATA[input]]></category>
		<category><![CDATA[user input]]></category>

		<guid isPermaLink="false">http://www.predatorinteractive.com/?p=140</guid>
		<description><![CDATA[All the basics for asking the user for input.  ]]></description>
			<content:encoded><![CDATA[<div id="wp_zdytfp_container_140" style="width:100%; height:470px; text-align:center; margin:auto;">
<div id="v_wp_zdytfp_container_140" style="width:100%; height:100%;">ZD YouTube FLV Player</div>
</div>
<script type="text/javascript">
var flashvars = {
vurl: "http://www.predatorinteractive.com/wp-content/uploads/2009/06/instinctbasicinput.flv",
autoplay: "yes",
yturl: "http://www.predatorinteractive.com/wp-content/plugins/zd-youtube-flv-player/fl_youTubeProxy.php"
};
var params = {
wmode: "transparent",
allowFullScreen: "true"
};
var attributes = {
id: "my_wp_zdytfp_container_140",
name: "my_wp_zdytfp_container_140"
};
swfobject.embedSWF("http://www.predatorinteractive.com/wp-content/plugins/zd-youtube-flv-player/flash/zdytflv-player-dark.swf", "v_wp_zdytfp_container_140", "630", "470", "9.0.0", false, flashvars, params, attributes);
</script>

<p><span style="color:   #ffffff;">h</span></p>
<p><span style="color: #ffffff;"><br />
</span></p>
<h2><span style="text-decoration: underline;">Getting Basic User Input</span></h2>
<p>There are four main ways to pause the program and ask the user for a value.</p>
<ul>
<li>Getting an int value</li>
<li>Getting a double value</li>
<li>Getting a string value</li>
<li>Getting a point on the screen</li>
</ul>
<h3><span style="text-decoration: underline;">Getting an int value</span></h3>
<p>To ask for an int, use the function: <strong> win<span style="color: #ff0000;">.</span>get_int<span style="color: #ff0000;">(</span>string prompt<span style="color: #ff0000;">);</span></strong><br />
Example:</p>
<ul>
<li> <span style="color: #0000ff;">int</span> age <span style="color: #ff0000;">=</span> win<span style="color: #ff0000;">.</span>get_int<span style="color: #ff0000;">(</span><span style="color: #0000ff;">&#8220;How old are you?&#8221;</span><span style="color: #ff0000;">);</span></li>
<li><span style="color: #0000ff;">int</span> radius <span style="color: #ff0000;">=</span> win<span style="color: #ff0000;">.</span>get_int<span style="color: #ff0000;">(</span><span style="color: #0000ff;">&#8220;Enter a value for the radius.&#8221;</span><span style="color: #ff0000;">);</span></li>
</ul>
<p>In example 1, the program will pause and display the message &#8220;<span style="color: #000000;"><strong><em>How old are you?</em></strong></span>&#8221; at the top of the screen. The user will then type in a numerical value and press enter.  That value typed will then be returned and stored in the variable <em><strong>age</strong></em>.</p>
<p style="text-align: center;"><a rel="attachment wp-att-369" href="http://www.predatorinteractive.com/?attachment_id=369"></a><img class="aligncenter size-full wp-image-371" title="getint" src="http://www.predatorinteractive.com/wp-content/uploads/2009/06/getint.JPG" alt="getint" width="553" height="116" /></p>
<h3><span style="text-decoration: underline;">Getting a double value</span></h3>
<p>To ask for a double, use the function:  <strong>win<span style="color: #ff0000;">.</span>get_double<span style="color: #ff0000;">(</span>string prompt<span style="color: #ff0000;">);</span></strong><br />
Example:</p>
<ul>
<li> <span style="color: #0000ff;">double</span> price <span style="color: #ff0000;">=</span> win<span style="color: #ff0000;">.</span>get_double<span style="color: #ff0000;">(</span><span style="color: #0000ff;">&#8220;How much does the car cost?&#8221;</span><span style="color: #ff0000;">);</span></li>
<li><span style="color: #0000ff;">double</span> mass <span style="color: #ff0000;">=</span> win<span style="color: #ff0000;">.</span>get_double<span style="color: #ff0000;">(</span><span style="color: #0000ff;">&#8220;How much does the ball weigh?&#8221;</span><span style="color: #ff0000;">);</span></li>
</ul>
<p>In example 1, the program will pause and display the message &#8220;<span style="color: #000000;"><strong><em>How much does the car cost?</em></strong></span>&#8221; at the top of the screen. The user will then type in a numerical double value and press enter.  That value typed will then be returned and stored in the variable <strong><em>price</em></strong>.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-374" title="getdouble" src="http://www.predatorinteractive.com/wp-content/uploads/2009/06/getdouble.JPG" alt="getdouble" width="543" height="111" /></p>
<h3><span style="text-decoration: underline;">Getting a string value</span></h3>
<p>To ask for a string, use this function:  <strong>win<span style="color: #ff0000;">.</span>get_string<span style="color: #ff0000;">(</span>string prompt<span style="color: #ff0000;">);</span></strong><br />
Example:</p>
<ul>
<li> <span style="color: #0000ff;">string</span> name <span style="color: #ff0000;">=</span> win<span style="color: #ff0000;">.</span>get_string<span style="color: #ff0000;">(</span><span style="color: #0000ff;">&#8220;What is your name?&#8221;</span><span style="color: #ff0000;">);</span></li>
<li><span style="color: #0000ff;">string</span> part <span style="color: #ff0000;">=</span> win<span style="color: #ff0000;">.</span>get_string<span style="color: #ff0000;">(</span><span style="color: #0000ff;">&#8220;Which part would you like to buy?&#8221;</span><span style="color: #ff0000;">);</span></li>
</ul>
<p>In example 1, the program will pause and display the message &#8220;<span style="color: #000000;"><strong><em>What is your name?</em></strong></span>&#8221; at the top of the screen. The user will then type in a string value and press enter.  That value typed will then be returned and stored in the variable <strong><em>name</em></strong>.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-375" title="getstring" src="http://www.predatorinteractive.com/wp-content/uploads/2009/06/getstring.JPG" alt="getstring" width="538" height="107" /></p>
<h3><span style="text-decoration: underline;">Getting a Point on the screen</span></h3>
<p>To ask for a point on the window, use this function:  <strong>win<span style="color: #ff0000;">.</span>get_click<span style="color: #ff0000;">(</span>string prompt<span style="color: #ff0000;">);</span></strong><br />
Example:</p>
<ul>
<li> <span style="color: #0000ff;">Point</span> location <span style="color: #ff0000;">=</span> win<span style="color: #ff0000;">.</span>get_click<span style="color: #ff0000;">(</span><span style="color: #0000ff;">&#8220;Click where you want to start.&#8221;</span><span style="color: #ff0000;">);</span></li>
<li><span style="color: #0000ff;">Point</span> end_point <span style="color: #ff0000;">=</span> win<span style="color: #ff0000;">.</span>get_click<span style="color: #ff0000;">(</span><span style="color: #0000ff;">&#8220;Click on the screen for the end point of the line to make.&#8221;</span><span style="color: #ff0000;">);</span></li>
</ul>
<p>In example 1, the program will pause and display the message &#8220;<span style="color: #000000;"><strong><em>Click where you want to start.</em></strong></span>&#8221; at the top of the screen. The user will then click a location on the screen.  That Point location on the screen will be returned and stored in the variable <strong><em>location</em></strong>.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-376" title="getclick" src="http://www.predatorinteractive.com/wp-content/uploads/2009/06/getclick.JPG" alt="getclick" width="548" height="102" /></p>
<h3><span style="text-decoration: underline;">Changing the color of the displayed message</span></h3>
<p>Similar to  drawing objects, you can also specify a color for all the prompts.  The default color is <strong>BLACK</strong>.  To set the color of the prompts, just add a color to the end of the function.<br />
Example:</p>
<ul>
<li> win<span style="color: #ff0000;">.</span>get_int<span style="color: #ff0000;">(</span><span style="color: #0000ff;">&#8220;How old are you?&#8221;</span><span style="color: #ff0000;">,</span> BLUE<span style="color: #ff0000;">)</span><span style="color: #ff0000;">;</span></li>
<li>win<span style="color: #ff0000;">.</span>get_double<span style="color: #ff0000;">(</span><span style="color: #0000ff;">&#8220;What is the weight of the ball?&#8221;</span><span style="color: #ff0000;">,</span> GREEN<span style="color: #ff0000;">);</span></li>
<li>win<span style="color: #ff0000;">.</span>get_click<span style="color: #ff0000;">(</span><span style="color: #0000ff;">&#8220;Click where you want to start.&#8221;</span><span style="color: #ff0000;">,</span> WHITE<span style="color: #ff0000;">);</span></li>
</ul>
<p>So for example 1, the message &#8220;<span style="color: #000000;"><strong><em>How old are you?</em></strong></span>&#8221; will be displayed at the top of the screen in the color <span style="color: #000000;"><strong>BLUE</strong></span> instead of <strong>BLACK</strong>.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-377" title="getintcolor" src="http://www.predatorinteractive.com/wp-content/uploads/2009/06/getintcolor.JPG" alt="getintcolor" width="554" height="109" /></p>
<p>Those are all the basics for getting user input. Soon it will be Instinct to you!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.predatorinteractive.com/instinct-graphics-package/3-getting-user-input/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Amateur Game Hosting Site</title>
		<link>http://www.predatorinteractive.com/usefulstuff/amateur-game-hosting-site</link>
		<comments>http://www.predatorinteractive.com/usefulstuff/amateur-game-hosting-site#comments</comments>
		<pubDate>Fri, 19 Jun 2009 22:06:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Useful Stuff]]></category>
		<category><![CDATA[2D]]></category>
		<category><![CDATA[amateur]]></category>
		<category><![CDATA[game alchemy]]></category>
		<category><![CDATA[game hosting]]></category>

		<guid isPermaLink="false">http://www.predatorinteractive.com/predatorinteractive/?p=131</guid>
		<description><![CDATA[Game Alchemy
Game Alchemy is a site that gives amateur game makers a place to show off their stuff.


Post your game for anyone to play
See just how many people downloaded your game
Have other players rate your game out of 10
Get your own personal forum page for players to post about your stuff

See how your game racks [...]]]></description>
			<content:encoded><![CDATA[<h3><span style="text-decoration: underline;">Game Alchemy</span></h3>
<p><strong>Game Alchemy is a site that gives amateur game makers a place to show off their stuff.<br />
</strong></p>
<ul>
<li>Post your game for anyone to play</li>
<li>See just how many people downloaded your game</li>
<li>Have other players rate your game out of 10</li>
<li>Get your own personal forum page for players to post about your stuff</li>
</ul>
<p>See how your game racks up and maybe even get the <strong><em>Game of the Month</em></strong> accolade!</p>
<p><strong><a href="http://www.gamealchemy.com/">http://www.gamealchemy.com/</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.predatorinteractive.com/usefulstuff/amateur-game-hosting-site/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
