<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Game Delays' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Game Delays' posted on the 'Basic' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Sat, 25 May 2013 08:34:50 -0700</pubDate>
    <lastBuildDate>Sat, 25 May 2013 08:34:50 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Game Delays</title>
      <link>http://www.programmersheaven.com/mb/basic/90427/90427/game-delays/</link>
      <description>Wazzup people?  I'm making a game in QBasic.  I have only 1 problem though,  The enemy delay. Unfortunatly the way I make the delay the enemys move at different speeds depending on the computer.  There has to be a way to make the delay the same for all computers?  Please help.  this is how I so it now:&lt;br /&gt;
&lt;br /&gt;
delay = delay + 1&lt;br /&gt;
IF delay = 5000 THEN&lt;br /&gt;
move the enemy&lt;br /&gt;
delay = 1&lt;br /&gt;
END IF&lt;br /&gt;
&lt;br /&gt;
HELP HELP HELP!!&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/basic/90427/90427/game-delays/</guid>
      <pubDate>Sun, 09 Dec 2001 11:46:04 -0700</pubDate>
      <category>Basic</category>
    </item>
    <item>
      <title>Re: Game Delays</title>
      <link>http://www.programmersheaven.com/mb/basic/90427/90481/re-game-delays/#90481</link>
      <description>: Wazzup people?  I'm making a game in QBasic.  I have only 1 problem though,  The enemy delay. Unfortunatly the way I make the delay the enemys move at different speeds depending on the computer.  There has to be a way to make the delay the same for all computers?  Please help.  this is how I so it now:&lt;br /&gt;
: &lt;br /&gt;
: delay = delay + 1&lt;br /&gt;
: IF delay = 5000 THEN&lt;br /&gt;
: move the enemy&lt;br /&gt;
: delay = 1&lt;br /&gt;
: END IF&lt;br /&gt;
: &lt;br /&gt;
: HELP HELP HELP!!&lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
&lt;br /&gt;
I've never tried it, but you I suppose could use On Timer to trigger move events somehow...&lt;br /&gt;
&lt;br /&gt;
Another option that many apps I've seen use is to just let the user set the delay...&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/basic/90427/90481/re-game-delays/#90481</guid>
      <pubDate>Sun, 09 Dec 2001 23:51:18 -0700</pubDate>
      <category>Basic</category>
    </item>
    <item>
      <title>Re: Game Delays</title>
      <link>http://www.programmersheaven.com/mb/basic/90427/90548/re-game-delays/#90548</link>
      <description>I briefly let the user give the delays but it sucks.  The user can make the enemys move slow and complete the game in an hour.  I've tried using the TIMER but then the users movements are delayed.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/basic/90427/90548/re-game-delays/#90548</guid>
      <pubDate>Mon, 10 Dec 2001 10:16:31 -0700</pubDate>
      <category>Basic</category>
    </item>
    <item>
      <title>Re: Game Delays</title>
      <link>http://www.programmersheaven.com/mb/basic/90427/90552/re-game-delays/#90552</link>
      <description>: I briefly let the user give the delays but it sucks.  The user can make the enemys move slow and complete the game in an hour.  I've tried using the TIMER but then the users movements are delayed.&lt;br /&gt;
: &lt;br /&gt;
&lt;br /&gt;
Nah, use a loop for the user movements and On Timer for frame rate and enemy updates:&lt;br /&gt;
&lt;br /&gt;
On Timer Goto LabelName&lt;br /&gt;
Do&lt;br /&gt;
'User movements. InKey, etc.&lt;br /&gt;
Loop&lt;br /&gt;
&lt;br /&gt;
LabelName&lt;br /&gt;
'Frame update and enemy movements&lt;br /&gt;
'Resume back into the loop to continue monitoring for user input.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/basic/90427/90552/re-game-delays/#90552</guid>
      <pubDate>Mon, 10 Dec 2001 10:33:27 -0700</pubDate>
      <category>Basic</category>
    </item>
    <item>
      <title>Re: Game Delays</title>
      <link>http://www.programmersheaven.com/mb/basic/90427/90555/re-game-delays/#90555</link>
      <description>I've tried that but the problem is I can't use fractions of a second.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/basic/90427/90555/re-game-delays/#90555</guid>
      <pubDate>Mon, 10 Dec 2001 10:37:06 -0700</pubDate>
      <category>Basic</category>
    </item>
    <item>
      <title>Re: Game Delays</title>
      <link>http://www.programmersheaven.com/mb/basic/90427/90559/re-game-delays/#90559</link>
      <description>: I've tried that but the problem is I can't use fractions of a second.&lt;br /&gt;
: &lt;br /&gt;
&lt;br /&gt;
How about a normal loop and check the time using Timer? It's been a while since I used QB (can you tell? &amp;lt;grin&amp;gt;) and I don't have a copy installed to check, but I think you can check the time (including fractions of a second) with Timer.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/basic/90427/90559/re-game-delays/#90559</guid>
      <pubDate>Mon, 10 Dec 2001 10:39:35 -0700</pubDate>
      <category>Basic</category>
    </item>
    <item>
      <title>Re: Game Delays</title>
      <link>http://www.programmersheaven.com/mb/basic/90427/90579/re-game-delays/#90579</link>
      <description>: delay = delay + 1&lt;br /&gt;
: IF delay = 5000 THEN&lt;br /&gt;
: move the enemy&lt;br /&gt;
: delay = 1&lt;br /&gt;
: END IF&lt;br /&gt;
&lt;br /&gt;
You have a good idea going here, and you are correct in thinking it'll be faster.  That's why old games run really fast on modern computers; they did for loops and counted instead of syncronising the event with the timer.&lt;br /&gt;
&lt;br /&gt;
start! = TIMER: DO WHILE TIMER &amp;lt; start! + 1: LOOP&lt;br /&gt;
&lt;br /&gt;
What does this do?&lt;br /&gt;
&lt;br /&gt;
First, it assigns start = timer.  In my case, timer is now 49907.82.  Then, it will stay in the loop until timer is &amp;gt;= to 49908.82, even though it says less than.  Put in code, the effect is that it will wait 1 second, indicated by the 1 before the :loop statement.  To wait 2 seconds, you'd put a 2 in there, to wait an entire minute, you'd put 60 in there.  To wait half a second, you'd put .5 there.  See?  Hope it helps.  Let me know how it goes, ok?  Oh, and don't forget the ! after start.  Because the timer can go above 32k, it's best to put it in single precision, it holds any timer value, as well as not sucking up too much memory.&lt;br /&gt;
---------------------------------------------&lt;br /&gt;
I've got a plan, but I'm going to need a dead monkey, some empty liquor bottles, and a vacuum cleaner.&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/basic/90427/90579/re-game-delays/#90579</guid>
      <pubDate>Mon, 10 Dec 2001 13:54:44 -0700</pubDate>
      <category>Basic</category>
    </item>
    <item>
      <title>Re: Game Delays</title>
      <link>http://www.programmersheaven.com/mb/basic/90427/90665/re-game-delays/#90665</link>
      <description>Using timer &lt;br /&gt;
&lt;pre class="sourcecode"&gt;
start!=timer
do while timer&amp;gt;=strat!+1:loop
&lt;/pre&gt;&lt;br /&gt;
It's work fine until it's 24:00, the the timer reset, so to end the loop you will have to wait 24 hours.&lt;br /&gt;
&lt;br /&gt;
use:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
for i = 0 to TimeToWait
  start!=timer
  do while int(start!) &amp;lt;&amp;gt; int(timer)
  loop
next
&lt;/pre&gt;&lt;br /&gt;
Ther is a maximum error of 0.8 second in the first second, all the other(2 to ...) will go fine.&lt;br /&gt;
if you want a smaller delay than 1 sec :&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
for i = 0 to TimerToWait
  start!=timer
  do while int(start!*10!) &amp;lt;&amp;gt; int(timer * 10!)
  loop
next
&lt;/pre&gt;&lt;br /&gt;
the delay can be each .1 second&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/basic/90427/90665/re-game-delays/#90665</guid>
      <pubDate>Tue, 11 Dec 2001 05:08:48 -0700</pubDate>
      <category>Basic</category>
    </item>
    <item>
      <title>Thanx all</title>
      <link>http://www.programmersheaven.com/mb/basic/90427/90751/thanx-all/#90751</link>
      <description>Thanks for all you help ppl.  I've finally got it to work.  Thanks again!!&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/basic/90427/90751/thanx-all/#90751</guid>
      <pubDate>Tue, 11 Dec 2001 11:15:37 -0700</pubDate>
      <category>Basic</category>
    </item>
    <item>
      <title>AHHH,  the horror!!</title>
      <link>http://www.programmersheaven.com/mb/basic/90427/90974/ahhh--the-horror/#90974</link>
      <description>Sorry to bug you guys again, but, I got a small problem again.  In the game that I'm writing I edit the autoexec.bat file to delete some tempary files in the games directory.  I've used the following syntax in the autoexec.bat:&lt;br /&gt;
&lt;br /&gt;
del c:\gamedirectory\temp\*.*&lt;br /&gt;
&lt;br /&gt;
The problem is that it asks for confirmation.  ie: press y/n&lt;br /&gt;
I know there is a way around this, I've seen it somewhere before.  &lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/basic/90427/90974/ahhh--the-horror/#90974</guid>
      <pubDate>Wed, 12 Dec 2001 12:55:15 -0700</pubDate>
      <category>Basic</category>
    </item>
    <item>
      <title>Re: AHHH,  the horror!!</title>
      <link>http://www.programmersheaven.com/mb/basic/90427/90978/re-ahhh--the-horror/#90978</link>
      <description>: Sorry to bug you guys again, but, I got a small problem again.  In the game that I'm writing I edit the autoexec.bat file to delete some tempary files in the games directory.  I've used the following syntax in the autoexec.bat:&lt;br /&gt;
: &lt;br /&gt;
: del c:\gamedirectory\temp\*.*&lt;br /&gt;
: &lt;br /&gt;
: The problem is that it asks for confirmation.  ie: press y/n&lt;br /&gt;
: I know there is a way around this, I've seen it somewhere before.  &lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
&lt;br /&gt;
Try del /q C:\gamedirectory\temp\*.*&lt;br /&gt;
&lt;br /&gt;
if that doesn't work,&lt;br /&gt;
&lt;br /&gt;
echo y | del C:\gamedirectory\temp\*.*&lt;br /&gt;
&lt;br /&gt;
if that doesn't work,&lt;br /&gt;
&lt;br /&gt;
I'm out of ideas.  :)&lt;br /&gt;
&lt;br /&gt;
Hope it helps.&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------&lt;br /&gt;
I've got a plan, but I'm going to need a dead monkey, some empty liquor bottles, and a vacuum cleaner.&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/basic/90427/90978/re-ahhh--the-horror/#90978</guid>
      <pubDate>Wed, 12 Dec 2001 13:21:34 -0700</pubDate>
      <category>Basic</category>
    </item>
    <item>
      <title>Re: AHHH,  the horror!!</title>
      <link>http://www.programmersheaven.com/mb/basic/90427/91029/re-ahhh--the-horror/#91029</link>
      <description>: Sorry to bug you guys again, but, I got a small problem again.  In the game that I'm writing I edit the autoexec.bat file to delete some tempary files in the games directory.  I've used the following syntax in the autoexec.bat:&lt;br /&gt;
: &lt;br /&gt;
: del c:\gamedirectory\temp\*.*&lt;br /&gt;
: &lt;br /&gt;
: The problem is that it asks for confirmation.  ie: press y/n&lt;br /&gt;
: I know there is a way around this, I've seen it somewhere before.  &lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
&lt;br /&gt;
I do this:&lt;br /&gt;
&lt;br /&gt;
deltree /y c:\gamedirectory\temp&lt;br /&gt;
mkdir c:\gamedirectory\temp&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/basic/90427/91029/re-ahhh--the-horror/#91029</guid>
      <pubDate>Wed, 12 Dec 2001 20:38:46 -0700</pubDate>
      <category>Basic</category>
    </item>
  </channel>
</rss>