Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
WAIT Statement...
#1
I'm sick of useing the crappyish Pause = TIMER stuff to slow my game down.

Can anyone explain to me how the WAIT Statement works (I read the QBasic Help but that kindof confused me).

Thanks Big Grin
Reply
#2
Perhaps wait is not the solutions to your problem, anyway wait what does is await the change of a bits from a given port, the vertical retrace wait can be done with two waits.

Take a look at "on timer gosub", etc.
Reply
#3
Quote:I'm sick of useing the crappyish Pause = TIMER stuff to slow my game down.

Can anyone explain to me how the WAIT Statement works (I read the QBasic Help but that kindof confused me).

Thanks Big Grin
For a nice set delay to the hundredths or thousandths of a second, the method you've been using works beautifully.
WAIT doesn't do delays - well, it sort of does. Xhantt explained.
Vertical Retrace, if that's what you're thinking of, reduces flicker and also adds a nice delay that locks you at about 60FPS.
Code:
WAIT &H3DA,8
WAIT &H3DA,8,8
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#4
Hmmm..... well ok.

The only thing is I think the Timer thing i'm doing only goes into the hunderiths...

Code:
Pause = TIMER
DO
LOOP UNTIL Pause + .01 = TIMER

So is that pretty much the best delay type thing I can get?

If so how do I make it so it won't screw up at midnight?
Reply
#5
Rellib has an excellent little delay function that goes up to milliseconds.
The midnight thing: just use the absolute value of the subtraction of TIMER, with the other method...
Code:
IF ABS(TIMER) - T! >= Delay! THEN
   'Do the stuff that you only want done once every Delay! seconds
   T!=TIMER
END IF

And btw! Haven't seen ya in a while, SD, how're ya?
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#6
Zack, doing pretty good... I have been somewhat active here... just not doing to much in qbasic. Actally I have been working on that tank game I posted a while ago (so far made it alot less flickery).
How have you been?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)