<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Setting game speeds the same on all computers</title>
		<link>http://www.allegro.cc/forums/view/587622</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Thu, 21 Sep 2006 03:49:58 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>ok so i have my pong game working and everything is fine and i feel great about it so i decided to send it out to sum friends to show them my work and see if they can find flaws in the program through playing it, the first thing they noticed is how fast the ball moves when the game starts....however when i complie and run the game the ball starts out and a speed barely above crawling, so whats goin on here??</p><p>second they noticed the lack of a start menu of any kind so they can be ready to play right when they start the game and not be shocked into the game with the ball already moveing and they don&#39;t even know the controls(lack of a readme or instruction which should also be on a menu) i looked at another game&#39;s menu screen and thought it was cool and then looked at its code...and its probably more lines of code than my entire game ha ha ha so any suggestions for either of these?<br />Danex!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Danex!)</author>
		<pubDate>Tue, 19 Sep 2006 07:24:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I assume you had a peek at my game code. I didn&#39;t think it was THAT long <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" /></p><p>For you ball speed problem, use timers to work out how much time has elapsed since the last frame was blatted to the screen, and use this to multiply your speed variables. </p><p>Say you want 10 ball movements done per second. Then you would use something along the lines of:</p><div class="source-code snippet"><div class="inner"><pre><span class="p">#define ballMovements 10</span>

timeMultiplier <span class="k3">=</span> ballMovements<span class="k3">/</span>ticksPerSecond<span class="k2">;</span>
deltaTime <span class="k3">=</span> timeNow<span class="k2">(</span><span class="k2">)</span> <span class="k3">-</span> lastTime<span class="k2">;</span>
position <span class="k3">=</span> position <span class="k3">+</span> <span class="k2">(</span>speed <span class="k3">*</span> timeMulitplier <span class="k3">*</span> deltaTime<span class="k2">)</span><span class="k2">;</span>
lastTime <span class="k3">=</span> timeNow<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

On slower machines the steps between sequential ball placements would be larger than faster on machines. It&#39;s pseudo code (ie you need to determine what you want to use for timeNow() and ticksPerSecond).</p><p>One way of implementing a menu system would be to print a list of options and highlight the chosen menu option (a pointer next to the text, changing the colour of the text, a coloured box behind the text...), and move the highlight with the cursor keys, selecting the option when space or return are pressed.</p><p>Jeroen
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (HardTranceFan)</author>
		<pubDate>Tue, 19 Sep 2006 09:29:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You could always just have a start screen for the game that has the control keys written on it somewhere if you want to take the easy way out for your game. <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matt Weir)</author>
		<pubDate>Tue, 19 Sep 2006 11:02:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That reminds me of the good old days, when you had to enter the letter of the option you wanted to choose (Press &#39;S&#39; to start, &#39;E&#39; to exit&#39;, &#39;O&#39; for options...)</p><p>Sigh. <img src="http://www.allegro.cc/forums/smileys/cheesy.gif" alt=":D" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (HardTranceFan)</author>
		<pubDate>Tue, 19 Sep 2006 11:42:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>hey hardtrace, i am trying to implement a moves per second like u said but i don&#39;t really understand what you are saying and therefore could not implement it :/... so could you clarify or help or something?<br />Danex!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Danex!)</author>
		<pubDate>Wed, 20 Sep 2006 01:12:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>nm <img src="http://www.allegro.cc/forums/smileys/lipsrsealed.gif" alt=":-X" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (imaxcs)</author>
		<pubDate>Wed, 20 Sep 2006 02:57:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>OK, I&#39;ll try it by explaining what is happening, and then giving a little definition of each variable involved in my pseudo code.</p><p>The idea is to move the ball at a set speed by altering the ball&#39;s position on the screen a set number of times per second, regardless of how fast or slow the PC runs. </p><p>The PC timer works on clock ticks. I assume faster PCs have more clock ticks per second than slower PCs. Dividing the number of ball speed updates by the number of clock ticks per second, you get a multiplier. Using this multiplier on the number of clock ticks that have passed determines the number of times the speed factor should be added to the ball&#39;s position.</p><p>For example: Say you have 2 PCs, PC1 with 1000 clock ticks per second, PC2 with 5000 clock ticks per second, and you want the speed component to be added 10 times per second. The multiplier for PC1 will be 10/1000 = 1/100 (add the speed component once every 100 clock ticks). The multiplier for PC2 will be 10/5000 = 1/500. </p><p>Now, just for explanations sake, assume the speed is 1 (pixel) this is to be added 10 times per second. Say PC1 updates the ball position every 250 clock ticks (deltaTime = 250, which is the same on PC1 as 4 times a second) and PC2 updates the ball position every 200 clock ticks (deltaTime = 200, equivalent to 25 times a second). For PC1, the position update will be 1 * 250 * (1/100), or 2.5 pixels every update. This still achieves the 10 updates per second (2.5 * 4 = 10). For PC2, the position update will be 1 * 200 * (1/500) = 0.4 pixels per update. This too achieves the 10 updates per second (0.4 * 25 = 10)</p><p>The pseudo code names stand for:</p><p><b>timeMultiplier</b> is calculated to be the minimum number of clock ticks that need to occur before the ball should be redrawn to the screen.</p><p><b>ballMovements</b> is the number of times you want the speed component to be added to the ball&#39;s position per second. Play with this to get a reasonable speed.</p><p><b>ticksPerSecond</b> is the number of clock cycles (?) that occur per second (=CLOCKS_PER_SEC in time.h from memory)</p><p><b>deltaTime</b> is the elapsed time between the last time the ball was drawn to the screen and now</p><p><b>timeNow()</b> is a made up function name that gets the number of cycles elapsed (=clock() in time.h, again from memory)</p><p><b>lastTime</b> is the number of cycles when the ball was last redrawn to the screen.</p><p><b>position</b> is the x or y component of the ball&#39;s screen position</p><p><b>speed </b> is the x or y speed value of the ball</p><p>To add to this all, an alternative is to check that a set number of clock ticks have passed (ie deltaTime &gt; ticksPerSecond / ballMovements), and then adding the speed component accordingly.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (HardTranceFan)</author>
		<pubDate>Wed, 20 Sep 2006 04:04:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ok so everything resets itself.<br />Also i should declare all of your intergers as global floats correct.<br />How do i get the time_now() from &lt;time.h&gt; shoudl i set timenow() = time.h? Can you even do this without errors?<br />Also ticks per second would also be taken from time.h right? So how to you get that out of there?<br />So basically my questions are:</p><p>1) Can i set time_now = &lt;time.h&gt;. If not what should i do to do this?</p><p>2) How do i pull ticks_per_second out of the computer?<br />Danex!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Danex!)</author>
		<pubDate>Wed, 20 Sep 2006 04:47:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
1) Can i set time_now = &lt;time.h&gt;. If not what should i do to do this?
</p></div></div><p>
Err, no. timeNow() was a pseudo code for a function that gets the current number of clock ticks. As per definition, in time.h it&#39;s clock(). time.h is a standard C library.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
2) How do i pull ticks_per_second out of the computer?
</p></div></div><p>
As I explained the definitions, use CLOCKS_PER_SEC.</p><p>Check out <a href="http://www.cplusplus.com/ref/ctime/">http://www.cplusplus.com/ref/ctime/</a> , and look for some tutorials on timers. You can also look at the source code of <a href="http://www.allegro.cc/forums/thread/587475">my game</a> for timer usage.</p><p>Jeroen
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (HardTranceFan)</author>
		<pubDate>Wed, 20 Sep 2006 05:46:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I see now, i just over analyzed it thinking that you were useing other names besides clock() and the other one for a specific reason cause it might cause errors in the program.(I guess you giving me the pseudo then the acual function confused me.) However i understand now <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />, back to work then, Thankyou for your help!<br />Danex!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Danex!)</author>
		<pubDate>Wed, 20 Sep 2006 05:53:19 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I had thought using the pseudo code may help in case you used a different timer library, but looks like it confused the issue a little. I&#39;ll try making it clearer next time. Good luck making it all work in your game <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>Jeroen
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (HardTranceFan)</author>
		<pubDate>Wed, 20 Sep 2006 05:59:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="source-code snippet"><div class="inner"><pre> timeMultiplier <span class="k3">=</span> ballMovements<span class="k3">/</span>CLOCKS_PER_SEC<span class="k2">;</span>
deltaTime <span class="k3">=</span> <a href="http://www.delorie.com/djgpp/doc/libc/libc_103.html" target="_blank">clock</a><span class="k2">(</span><span class="k2">)</span> <span class="k3">-</span> lastTime<span class="k2">;</span>
ball_x <span class="k3">=</span> ball_x <span class="k3">+</span> <span class="k2">(</span>x_speed <span class="k3">*</span> timeMulitplier <span class="k3">*</span> deltaTime<span class="k2">)</span><span class="k2">;</span>
lastTime <span class="k3">=</span> <a href="http://www.delorie.com/djgpp/doc/libc/libc_103.html" target="_blank">clock</a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
ball_y <span class="k3">=</span> ball_y <span class="k3">+</span> y_speed<span class="k2">;</span>
</pre></div></div><p>
Above is what i am working with.<br />When you complie the program it returns the error:<br />`timeMulitplier&#39; undeclared (first use this function)<br />Why is it counting timeMultiplier as a function when i declared it as a float?<br />Danex!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Danex!)</author>
		<pubDate>Wed, 20 Sep 2006 06:20:29 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Its not counting it as a function. its saying its not been defined or declared anywhere this function can see. and won&#39;t repeat the warning again after this first message.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Wed, 20 Sep 2006 06:22:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Its defined as a global, how can it not be seen?<br />Danex!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Danex!)</author>
		<pubDate>Wed, 20 Sep 2006 06:23:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Its defined as a global, how can it not be seen?
</p></div></div><p>If it&#39;s defined below where it&#39;s used, or in a different (not included) file?  Or if you made a typo ...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Zaphos)</author>
		<pubDate>Wed, 20 Sep 2006 06:47:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You&#39;ll also need to apply the timeMulitplier * deltaTime bit to the ball_y calculation (or the ball will travel slowly vertically on your machine, and race along on your mates PCs).</p><p>Jeroen
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (HardTranceFan)</author>
		<pubDate>Wed, 20 Sep 2006 06:53:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>thats my code with comments where i defined timeMultiplier and where it showed error
</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td><span class="c">//global stuff</span></td></tr><tr><td class="number">2</td><td>&#160;</td></tr><tr><td class="number">3</td><td><span class="p">#include &lt;allegro.h&gt;</span></td></tr><tr><td class="number">4</td><td><span class="p">#include &lt;cstdlib&gt;</span></td></tr><tr><td class="number">5</td><td><span class="p">#include &lt;time.h&gt;</span></td></tr><tr><td class="number">6</td><td><span class="p">#define ballMovements 10</span></td></tr><tr><td class="number">7</td><td><a href="http://www.allegro.cc/manual/BITMAP" target="_blank"><span class="a">BITMAP</span></a> <span class="k3">*</span>buffer<span class="k2">;</span></td></tr><tr><td class="number">8</td><td><span class="k1">void</span> menu<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">9</td><td><span class="k1">void</span> game<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span> </td></tr><tr><td class="number">10</td><td><span class="k1">volatile</span> <span class="k1">long</span> speed_counter<span class="k2">;</span> </td></tr><tr><td class="number">11</td><td><span class="k1">void</span> increment_speed_counter<span class="k2">(</span><span class="k2">)</span> <span class="k2">{</span></td></tr><tr><td class="number">12</td><td>speed_counter <span class="k3">+</span><span class="k3">+</span><span class="k2">;</span> <span class="k2">}</span></td></tr><tr><td class="number">13</td><td><a href="http://www.allegro.cc/manual/END_OF_FUNCTION" target="_blank"><span class="a">END_OF_FUNCTION</span></a><span class="k2">(</span>increment_speed_counter<span class="k2">)</span></td></tr><tr><td class="number">14</td><td><span class="k1">float</span> ball_x <span class="k3">=</span> <span class="n">320</span><span class="k2">;</span></td></tr><tr><td class="number">15</td><td><span class="k1">float</span> ball_y <span class="k3">=</span> <span class="n">240</span><span class="k2">;</span></td></tr><tr><td class="number">16</td><td><span class="k1">int</span> paddle_speed_up <span class="k3">=</span> <span class="n">2</span><span class="k2">;</span></td></tr><tr><td class="number">17</td><td><span class="k1">int</span> paddle_speed_down <span class="k3">=</span> <span class="n">2</span><span class="k2">;</span></td></tr><tr><td class="number">18</td><td><span class="k1">int</span> paddle_1_y <span class="k3">=</span> <span class="n">240</span><span class="k2">;</span></td></tr><tr><td class="number">19</td><td><span class="k1">int</span> paddle_1_height <span class="k3">=</span> <span class="n">79</span><span class="k2">;</span></td></tr><tr><td class="number">20</td><td><span class="k1">int</span> paddle_2_height <span class="k3">=</span> <span class="n">79</span><span class="k2">;</span></td></tr><tr><td class="number">21</td><td><span class="k1">int</span> paddle_2_y <span class="k3">=</span> <span class="n">240</span><span class="k2">;</span></td></tr><tr><td class="number">22</td><td><span class="k1">int</span> paddle_1_x <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span></td></tr><tr><td class="number">23</td><td><span class="k1">int</span> paddle_2_x <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span></td></tr><tr><td class="number">24</td><td><span class="k1">float</span> x_speed<span class="k3">=</span><span class="k3">-</span><span class="n">1</span><span class="k2">;</span></td></tr><tr><td class="number">25</td><td><span class="k1">float</span> y_speed<span class="k3">=</span><span class="k3">-</span><span class="n">1</span><span class="k2">;</span></td></tr><tr><td class="number">26</td><td><span class="k1">float</span> deltaTime, lastTime<span class="k2">;</span></td></tr><tr><td class="number">27</td><td><span class="k1">float</span> timeMultiplier<span class="k2">;</span> <span class="c">//defined as a global float</span></td></tr><tr><td class="number">28</td><td>&#160;</td></tr><tr><td class="number">29</td><td><span class="c">//main</span></td></tr><tr><td class="number">30</td><td>&#160;</td></tr><tr><td class="number">31</td><td><span class="k1">int</span> main<span class="k2">(</span><span class="k2">)</span> <span class="k2">{</span></td></tr><tr><td class="number">32</td><td>    <a href="http://www.allegro.cc/manual/allegro_init" target="_blank"><span class="a">allegro_init</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">33</td><td>    <a href="http://www.allegro.cc/manual/install_timer" target="_blank"><span class="a">install_timer</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">34</td><td>    <a href="http://www.allegro.cc/manual/LOCK_VARIABLE" target="_blank"><span class="a">LOCK_VARIABLE</span></a><span class="k2">(</span>speed_counter<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">35</td><td>    <a href="http://www.allegro.cc/manual/LOCK_FUNCTION" target="_blank"><span class="a">LOCK_FUNCTION</span></a><span class="k2">(</span>increment_speed_counter<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">36</td><td>    <a href="http://www.allegro.cc/manual/install_int_ex" target="_blank"><span class="a">install_int_ex</span></a><span class="k2">(</span>increment_speed_counter,BPS_TO_TIMER<span class="k2">(</span><span class="n">60</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">37</td><td>    <a href="http://www.allegro.cc/manual/install_keyboard" target="_blank"><span class="a">install_keyboard</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">38</td><td>    <a href="http://www.allegro.cc/manual/set_color_depth" target="_blank"><span class="a">set_color_depth</span></a><span class="k2">(</span><span class="n">16</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">39</td><td>    <a href="http://www.allegro.cc/manual/set_gfx_mode" target="_blank"><span class="a">set_gfx_mode</span></a><span class="k2">(</span>GFX_AUTODETECT_WINDOWED,<span class="n">640</span>,<span class="n">480</span>,<span class="n">0</span>,<span class="n">0</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">40</td><td>    </td></tr><tr><td class="number">41</td><td>    <a href="http://www.allegro.cc/manual/BITMAP" target="_blank"><span class="a">BITMAP</span></a> <span class="k3">*</span>paddle_1<span class="k2">;</span></td></tr><tr><td class="number">42</td><td>    <a href="http://www.allegro.cc/manual/BITMAP" target="_blank"><span class="a">BITMAP</span></a> <span class="k3">*</span>paddle_2<span class="k2">;</span></td></tr><tr><td class="number">43</td><td>    paddle_1 <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span><span class="s">"paddle1.bmp"</span>,NULL<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">44</td><td>    paddle_2 <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span><span class="s">"paddle2.bmp"</span>,NULL<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">45</td><td>    buffer <span class="k3">=</span> <a href="http://www.allegro.cc/manual/create_bitmap" target="_blank"><span class="a">create_bitmap</span></a><span class="k2">(</span><span class="n">640</span>,<span class="n">480</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">46</td><td>    menu<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">47</td><td>    <span class="k1">while</span> <span class="k2">(</span><span class="k3">!</span><a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_ESC<span class="k2">]</span><span class="k2">)</span></td></tr><tr><td class="number">48</td><td>    <span class="k2">{</span> </td></tr><tr><td class="number">49</td><td>          </td></tr><tr><td class="number">50</td><td>    <span class="k1">while</span> <span class="k2">(</span>speed_counter <span class="k3">&gt;</span><span class="n">0</span><span class="k2">)</span> </td></tr><tr><td class="number">51</td><td>          <span class="k2">{</span>                  </td></tr><tr><td class="number">52</td><td>    <span class="k1">if</span> <span class="k2">(</span><a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_DOWN<span class="k2">]</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">53</td><td>    paddle_1_y <span class="k3">=</span> paddle_1_y <span class="k3">+</span> paddle_speed_up<span class="k2">;</span> <span class="k2">}</span></td></tr><tr><td class="number">54</td><td>    <span class="k1">else</span> <span class="k1">if</span> <span class="k2">(</span><a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_UP<span class="k2">]</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">55</td><td>    paddle_1_y <span class="k3">=</span> paddle_1_y <span class="k3">-</span> paddle_speed_up<span class="k2">;</span> <span class="k2">}</span></td></tr><tr><td class="number">56</td><td>    <span class="k1">if</span> <span class="k2">(</span><a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_S<span class="k2">]</span><span class="k2">)</span> <span class="k2">{</span></td></tr><tr><td class="number">57</td><td>    paddle_2_y <span class="k3">=</span> paddle_2_y <span class="k3">+</span> paddle_speed_up<span class="k2">;</span> <span class="k2">}</span>                </td></tr><tr><td class="number">58</td><td>    <span class="k1">else</span> <span class="k1">if</span> <span class="k2">(</span><a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_W<span class="k2">]</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">59</td><td>    paddle_2_y <span class="k3">=</span> paddle_2_y <span class="k3">-</span> paddle_speed_up<span class="k2">;</span> <span class="k2">}</span> </td></tr><tr><td class="number">60</td><td>    speed_counter <span class="k3">-</span><span class="k3">-</span><span class="k2">;</span> </td></tr><tr><td class="number">61</td><td>    <span class="k1">if</span> <span class="k2">(</span>paddle_1_y <span class="k3">&lt;</span> <span class="n">0</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">62</td><td>    paddle_1_y <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span><span class="k2">}</span></td></tr><tr><td class="number">63</td><td>    <span class="k1">if</span> <span class="k2">(</span>paddle_2_y <span class="k3">&lt;</span> <span class="n">0</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">64</td><td>    paddle_2_y <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span><span class="k2">}</span></td></tr><tr><td class="number">65</td><td>    <span class="k1">if</span> <span class="k2">(</span>paddle_1_y <span class="k3">+</span> paddle_1_height <span class="k3">&gt;</span> <span class="n">480</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">66</td><td>    paddle_1_y <span class="k3">=</span> <span class="n">480</span> <span class="k3">-</span> paddle_1_height<span class="k2">;</span><span class="k2">}</span></td></tr><tr><td class="number">67</td><td>    <span class="k1">if</span> <span class="k2">(</span>paddle_2_y <span class="k3">+</span> paddle_2_height <span class="k3">&gt;</span> <span class="n">480</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">68</td><td>    paddle_2_y <span class="k3">=</span> <span class="n">480</span> <span class="k3">-</span> paddle_2_height<span class="k2">;</span><span class="k2">}</span></td></tr><tr><td class="number">69</td><td>    </td></tr><tr><td class="number">70</td><td>    <span class="k2">}</span></td></tr><tr><td class="number">71</td><td>    </td></tr><tr><td class="number">72</td><td>    game<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">73</td><td>    <a href="http://www.allegro.cc/manual/textout_ex" target="_blank"><span class="a">textout_ex</span></a><span class="k2">(</span>buffer, <a href="http://www.allegro.cc/manual/font" target="_blank"><span class="a">font</span></a>, <span class="s">"PongGame // Press ESC to leave"</span>, <span class="n">0</span>, <span class="n">0</span>, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span> <span class="n">255</span>, <span class="n">0</span>, <span class="n">0</span><span class="k2">)</span>, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span> <span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">74</td><td>    <a href="http://www.allegro.cc/manual/draw_sprite" target="_blank"><span class="a">draw_sprite</span></a><span class="k2">(</span>buffer, paddle_1, <span class="n">20</span>, paddle_1_y<span class="k2">)</span><span class="k2">;</span>                                                  </td></tr><tr><td class="number">75</td><td>    <a href="http://www.allegro.cc/manual/draw_sprite" target="_blank"><span class="a">draw_sprite</span></a><span class="k2">(</span>buffer, paddle_2, <span class="n">620</span>, paddle_2_y<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">76</td><td>    <a href="http://www.allegro.cc/manual/blit" target="_blank"><span class="a">blit</span></a><span class="k2">(</span>buffer,<a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a>,<span class="n">0</span>,<span class="n">0</span>,<span class="n">0</span>,<span class="n">0</span>,<span class="n">640</span>,<span class="n">480</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">77</td><td>    <a href="http://www.allegro.cc/manual/clear_bitmap" target="_blank"><span class="a">clear_bitmap</span></a><span class="k2">(</span>buffer<span class="k2">)</span><span class="k2">;</span> <span class="k2">}</span></td></tr><tr><td class="number">78</td><td><a href="http://www.allegro.cc/manual/destroy_bitmap" target="_blank"><span class="a">destroy_bitmap</span></a><span class="k2">(</span>paddle_1<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">79</td><td><a href="http://www.allegro.cc/manual/destroy_bitmap" target="_blank"><span class="a">destroy_bitmap</span></a><span class="k2">(</span>paddle_2<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">80</td><td><a href="http://www.allegro.cc/manual/destroy_bitmap" target="_blank"><span class="a">destroy_bitmap</span></a><span class="k2">(</span>buffer<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">81</td><td><span class="k1">return</span> <span class="n">0</span><span class="k2">;</span><span class="k2">}</span></td></tr><tr><td class="number">82</td><td><a href="http://www.allegro.cc/manual/END_OF_MAIN" target="_blank"><span class="a">END_OF_MAIN</span></a><span class="k2">(</span><span class="k2">)</span> </td></tr><tr><td class="number">83</td><td>&#160;</td></tr><tr><td class="number">84</td><td>&#160;</td></tr><tr><td class="number">85</td><td>     </td></tr><tr><td class="number">86</td><td><span class="k1">void</span> game<span class="k2">(</span><span class="k2">)</span><span class="k2">{</span> </td></tr><tr><td class="number">87</td><td>&#160;</td></tr><tr><td class="number">88</td><td>timeMultiplier <span class="k3">=</span> ballMovements<span class="k3">/</span>CLOCKS_PER_SEC<span class="k2">;</span></td></tr><tr><td class="number">89</td><td>deltaTime <span class="k3">=</span> <a href="http://www.delorie.com/djgpp/doc/libc/libc_103.html" target="_blank">clock</a><span class="k2">(</span><span class="k2">)</span> <span class="k3">-</span> lastTime<span class="k2">;</span></td></tr><tr><td class="number">90</td><td>ball_x <span class="k3">=</span> ball_x <span class="k3">+</span> <span class="k2">(</span>x_speed <span class="k3">*</span> timeMulitplier <span class="k3">*</span> deltaTime<span class="k2">)</span><span class="k2">;</span><span class="c">//error</span></td></tr><tr><td class="number">91</td><td>ball_y <span class="k3">=</span> ball_y <span class="k3">+</span> <span class="k2">(</span>y_speed <span class="k3">*</span> timeMulitplier <span class="k3">*</span> deltaTime<span class="k2">)</span><span class="k2">;</span><span class="c">//error</span></td></tr><tr><td class="number">92</td><td>lastTime <span class="k3">=</span> <a href="http://www.delorie.com/djgpp/doc/libc/libc_103.html" target="_blank">clock</a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span> </td></tr><tr><td class="number">93</td><td>&#160;</td></tr><tr><td class="number">94</td><td><span class="k1">if</span> <span class="k2">(</span>ball_y <span class="k3">&lt;</span> <span class="n">0</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">95</td><td>ball_y <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span></td></tr><tr><td class="number">96</td><td>y_speed <span class="k3">=</span> <span class="k3">-</span>y_speed<span class="k2">;</span><span class="k2">}</span></td></tr><tr><td class="number">97</td><td><span class="k1">if</span> <span class="k2">(</span>ball_y  <span class="k3">&gt;</span> <span class="n">475</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">98</td><td>ball_y <span class="k3">=</span> <span class="n">475</span><span class="k2">;</span></td></tr><tr><td class="number">99</td><td>y_speed <span class="k3">=</span> <span class="k3">-</span>y_speed<span class="k2">;</span><span class="k2">}</span></td></tr><tr><td class="number">100</td><td><span class="k1">if</span> <span class="k2">(</span>ball_x <span class="k3">&lt;</span> <span class="n">20</span> <span class="k3">&amp;</span><span class="k3">&amp;</span> ball_y <span class="k3">&gt;</span><span class="k3">=</span> paddle_1_y  <span class="k3">&amp;</span><span class="k3">&amp;</span> ball_y <span class="k3">&lt;</span><span class="k3">=</span> paddle_1_y <span class="k3">+</span> paddle_1_height<span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">101</td><td>    x_speed <span class="k3">=</span> <span class="k3">-</span>x_speed<span class="k2">;</span></td></tr><tr><td class="number">102</td><td>    y_speed <span class="k3">+</span><span class="k3">=</span> <span class="k2">(</span><span class="k1">float</span><span class="k2">)</span> <a href="http://www.delorie.com/djgpp/doc/libc/libc_637.html" target="_blank">rand</a><span class="k2">(</span><span class="k2">)</span> <span class="k3">/</span> RAND_MAX <span class="k3">*</span> .<span class="n">4</span><span class="k2">;</span></td></tr><tr><td class="number">103</td><td>    <span class="k1">if</span> <span class="k2">(</span>x_speed <span class="k3">&gt;</span> <span class="n">19</span><span class="k2">)</span> <span class="k2">{</span></td></tr><tr><td class="number">104</td><td>       x_speed <span class="k3">=</span> <span class="n">19</span><span class="k2">;</span><span class="k2">}</span></td></tr><tr><td class="number">105</td><td>    <span class="k1">if</span> <span class="k2">(</span>paddle_speed_up <span class="k3">&gt;</span> <span class="n">4</span><span class="k2">)</span></td></tr><tr><td class="number">106</td><td>    <span class="k2">{</span>paddle_speed_up <span class="k3">=</span> <span class="n">4</span><span class="k2">;</span><span class="k2">}</span>  </td></tr><tr><td class="number">107</td><td>       <span class="k1">else</span><span class="k2">{</span></td></tr><tr><td class="number">108</td><td>      x_speed<span class="k3">+</span><span class="k3">+</span><span class="k2">;</span></td></tr><tr><td class="number">109</td><td>    paddle_speed_up <span class="k3">=</span> paddle_speed_up <span class="k3">+</span> <span class="n">1</span><span class="k2">;</span><span class="k2">}</span></td></tr><tr><td class="number">110</td><td>    </td></tr><tr><td class="number">111</td><td>    <span class="k2">}</span></td></tr><tr><td class="number">112</td><td><span class="k1">if</span> <span class="k2">(</span>ball_x <span class="k3">&gt;</span> <span class="n">620</span> <span class="k3">&amp;</span><span class="k3">&amp;</span> ball_y <span class="k3">&gt;</span><span class="k3">=</span> paddle_2_y  <span class="k3">&amp;</span><span class="k3">&amp;</span> ball_y <span class="k3">&lt;</span><span class="k3">=</span> paddle_2_y <span class="k3">+</span> paddle_2_height<span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">113</td><td>    x_speed <span class="k3">=</span> <span class="k3">-</span>x_speed<span class="k2">;</span></td></tr><tr><td class="number">114</td><td>    y_speed <span class="k3">+</span><span class="k3">=</span> <span class="k2">(</span><span class="k1">float</span><span class="k2">)</span> <a href="http://www.delorie.com/djgpp/doc/libc/libc_637.html" target="_blank">rand</a><span class="k2">(</span><span class="k2">)</span> <span class="k3">/</span> RAND_MAX <span class="k3">*</span> .<span class="n">4</span><span class="k2">;</span></td></tr><tr><td class="number">115</td><td>    <span class="k1">if</span> <span class="k2">(</span>x_speed <span class="k3">&gt;</span> <span class="n">19</span><span class="k2">)</span> <span class="k2">{</span></td></tr><tr><td class="number">116</td><td>       x_speed <span class="k3">=</span> <span class="n">19</span><span class="k2">;</span><span class="k2">}</span></td></tr><tr><td class="number">117</td><td>&#160;</td></tr><tr><td class="number">118</td><td>   <span class="k2">}</span>                 </td></tr><tr><td class="number">119</td><td><span class="k1">if</span> <span class="k2">(</span>ball_x <span class="k3">&gt;</span> <span class="n">640</span><span class="k2">)</span> <span class="k2">{</span></td></tr><tr><td class="number">120</td><td>ball_x <span class="k3">=</span><span class="n">320</span><span class="k2">;</span></td></tr><tr><td class="number">121</td><td><a href="http://www.allegro.cc/manual/textout_ex" target="_blank"><span class="a">textout_ex</span></a><span class="k2">(</span> <a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a>, <a href="http://www.allegro.cc/manual/font" target="_blank"><span class="a">font</span></a>, <span class="s">"Player 1 Wins!"</span>, <span class="n">320</span>, <span class="n">240</span>, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span> <span class="n">255</span>, <span class="n">0</span>, <span class="n">0</span><span class="k2">)</span>, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span> <span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>      </td></tr><tr><td class="number">122</td><td><a href="http://www.allegro.cc/manual/rest" target="_blank"><span class="a">rest</span></a><span class="k2">(</span><span class="n">3000</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">123</td><td><a href="http://www.delorie.com/djgpp/doc/libc/libc_298.html" target="_blank">exit</a><span class="k2">(</span>EXIT_FAILURE<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">124</td><td><span class="k2">}</span>    </td></tr><tr><td class="number">125</td><td><span class="k1">if</span> <span class="k2">(</span>ball_x <span class="k3">&lt;</span> <span class="n">0</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">126</td><td>ball_x <span class="k3">=</span> <span class="n">320</span><span class="k2">;</span></td></tr><tr><td class="number">127</td><td><a href="http://www.allegro.cc/manual/textout_ex" target="_blank"><span class="a">textout_ex</span></a><span class="k2">(</span> <a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a>, <a href="http://www.allegro.cc/manual/font" target="_blank"><span class="a">font</span></a>, <span class="s">"Player 2 Wins!"</span>, <span class="n">320</span>, <span class="n">240</span>, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span> <span class="n">255</span>, <span class="n">0</span>, <span class="n">0</span><span class="k2">)</span>, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span> <span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">128</td><td><a href="http://www.allegro.cc/manual/rest" target="_blank"><span class="a">rest</span></a><span class="k2">(</span><span class="n">3000</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">129</td><td><a href="http://www.delorie.com/djgpp/doc/libc/libc_298.html" target="_blank">exit</a><span class="k2">(</span>EXIT_FAILURE<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">130</td><td><span class="k2">}</span></td></tr><tr><td class="number">131</td><td><a href="http://www.allegro.cc/manual/circlefill" target="_blank"><span class="a">circlefill</span></a><span class="k2">(</span> buffer, ball_x, ball_y , <span class="n">5</span>, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span> <span class="n">0</span>,<span class="n">255</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span> <span class="k2">}</span></td></tr><tr><td class="number">132</td><td>  </td></tr><tr><td class="number">133</td><td><span class="k1">void</span> menu<span class="k2">(</span><span class="k2">)</span> <span class="k2">{</span></td></tr><tr><td class="number">134</td><td>     <a href="http://www.allegro.cc/manual/textout_ex" target="_blank"><span class="a">textout_ex</span></a><span class="k2">(</span> <a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a>, <a href="http://www.allegro.cc/manual/font" target="_blank"><span class="a">font</span></a>, <span class="s">"Press any key to begin!"</span>, <span class="n">320</span>, <span class="n">240</span>, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span> <span class="n">255</span>, <span class="n">0</span>, <span class="n">0</span><span class="k2">)</span>, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span> <span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">135</td><td><a href="http://www.allegro.cc/manual/readkey" target="_blank"><span class="a">readkey</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span> <span class="k2">}</span></td></tr></tbody></table></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Danex!)</author>
		<pubDate>Wed, 20 Sep 2006 06:54:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You&#39;ve got a typo - timeMulitplier should be timeMultiplier <img src="http://www.allegro.cc/forums/smileys/rolleyes.gif" alt="::)" /></p><p>Jeroen
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (HardTranceFan)</author>
		<pubDate>Wed, 20 Sep 2006 07:09:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><img src="http://www.allegro.cc/forums/smileys/embarassed.gif" alt=":-[" />He he makes me feel dumb cause i checked that but i just can&#39;t spell.<br />Well now the program compiles but the ball never starts moving? Whats goin on there. With the old system it moved but jsut to fast on some computers, now its not moving at all. Could it be that my comp is so slow that its just takeing that long to move?<br />Danex!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Danex!)</author>
		<pubDate>Wed, 20 Sep 2006 07:25:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I copied the first spelling of it and did a repeated search in the code - it only found 2, hence it was a spelling difference.</p><p>As for your latest problem, I&#39;m tempted to say debug, but that might not solve it. Visit the time.h link I gave you earlier, and look the data type clock() returns.</p><p>Jeroen
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (HardTranceFan)</author>
		<pubDate>Wed, 20 Sep 2006 07:37:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ok I tried to run debug useing the dev C++ debug function but it just produced an error that turned my screen blue and i have to click to restore and it had shut down dev c++ so thats out. As for clock() it says for most compiliers it returns long int. Should i change it to long int type?<br />Danex!<br />[edit]<br />Did that and it did nothing...makes me mad that the game works perfectly on my system but differnetly on other systems
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Danex!)</author>
		<pubDate>Wed, 20 Sep 2006 07:43:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Try setting it to type clock_t.</p><p>Remember to cast in the calculations.</p><p>Debugging is not just a matter of running a program in debug mode. Debugging is the process of working out what is going wrong by whatever means you can. If debug mode won&#39;t work, try using output statements to the screen or a file to see what certain values are set to.</p><p>And I repeat, <b>look at examples of time.h being used in other programs.</b> It&#39;s one of the best ways of learning of how things are done.</p><p>Jeroen
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (HardTranceFan)</author>
		<pubDate>Wed, 20 Sep 2006 08:12:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
He he makes me feel dumb cause i checked that but i just can&#39;t spell.
</p></div></div><p>

Unless you&#39;ve set your compiler to not report a single error or warning, then it should have complained about an undeclared variable.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Wed, 20 Sep 2006 08:37:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>What&#39;s wrong with the Allegro FAQ?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bob)</author>
		<pubDate>Wed, 20 Sep 2006 11:51:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>clock() isn&#39;t the function you want, as it only measures time for the process, not the whole system time. The standard functions to use would be gettimeofday, or clock_gettime (both POSIX standard). Of course, Windows doesn&#39;t have these, so you&#39;ll need to use QueryPerformanceFrequency and QueryPerformanceCounter.</p><p>However, I&#39;d recommend against delta time methods for newbies. A fixed logic rate, as described in Allegro&#39;s FAQ, would be much simpler and work just as good.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kitty Cat)</author>
		<pubDate>Wed, 20 Sep 2006 12:32:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Also why are you installing the allegro timer-function anyway if you&#39;re not gonna use it <img src="http://www.allegro.cc/forums/smileys/cheesy.gif" alt=":D" /> ?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (fsDoom)</author>
		<pubDate>Wed, 20 Sep 2006 14:45:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
What&#39;s wrong with the Allegro FAQ?
</p></div></div><p>

Nothing. I dabbled with OpenGL and SDL before trying Allegro, and the method I described works with C++ using any of these game libraries.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
QueryPerformanceFrequency and QueryPerformanceCounter
</p></div></div><p>

Same idea as CLOCKS_PER_SEC and clock(). If QueryPerformanceFrequency and QueryPerformanceCounter windows specific, that would make them a lot less portable. </p><p>Jeroen
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (HardTranceFan)</author>
		<pubDate>Thu, 21 Sep 2006 02:57:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ok i looked at the code from FAQ(just a side note that FAQ section looks helpful, i will cunsult it before asking questions next time) but there is a problem, i am already using the code that it provided. Thats how i learned to make programs ha ha ha, so what should i do or add to it, the only thing not in my code that was not in the code before was update_game_logic();, which i have not previously made, is it declared already in the standard library? so i am adding that in in random places and seeing if it works or does anything, if you want to seed where i have already implemented the code just look up a bit in the forum, i posted it. Thankyou for your time.<br />Danex!<br />[edit]<br />think it works and realized the noobishness of that question, it mean udateing the ball by update_game_logic(); oh well now i just gotta get some friends to test for me, also i am woefully ignorant of how to set up a download site and keep it running<br />any help?<br />Danex
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Danex!)</author>
		<pubDate>Thu, 21 Sep 2006 03:12:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Same idea as CLOCKS_PER_SEC and clock().
</p></div></div><p>
Except it doesn&#39;t do the same thing. clock() only measures the time your process takes, not the system time/real-time. So that means if you rest or if your process is put to sleep while it waits on IO, clock will slow down. And the time other processes take will slow clock down as well.</p><p>There is no simple cross-platform way to get system time, with accuracy better th an seconds. clock_gettime(CLOCK_REALTIME, ...) and gettimeofday are standard and can get the system time, but Windows doesn&#39;t support them. So to get comparable functionality on Windows, you have to use QueryPerformanceFrequency and QueryPerformanceCounter. Or, since MinGW does try to add POSIX functions Windows doesn&#39;t natively support, you could supply patches for those functions and (when they&#39;re accepted and applied) use them on any system with GCC.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kitty Cat)</author>
		<pubDate>Thu, 21 Sep 2006 03:49:58 +0000</pubDate>
	</item>
</rss>
