Besides WAIT &H8D3, what's another way to to reduce flic

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
User avatar
Mentat
Veteran
Posts: 409
Joined: Tue Aug 07, 2007 3:39 pm
Location: NC, US

Besides WAIT &H8D3, what's another way to to reduce flic

Post by Mentat » Thu Jan 17, 2008 5:05 pm

I used WAIT, but everything drawn last still flickers horribly. Is there a way to get rid of it in screen 12? If not, what is the closest screen to 12 that can do it? I'm revisiting QB, and I can't seem to find the stuff I need.

Thanks.

The reason that I'm asking this is because of two reasons:
I'm writing a pac clone (but with path-finding and other types of AI)
And I want to make a moving 1st person perspective demo in QB

And both are going to flicker when I convert (they are currently in FB).
For any grievances posted above, I blame whoever is in charge . . .

User avatar
burger2227
Veteran
Posts: 2446
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 » Thu Jan 17, 2008 11:13 pm

What exactly are you erasing? Are you using CLS? CLS will cause flickering.

SCREEN 9 can use page flipping to stop flicker. Screen 12 cannot.

How does it look in FB? It might be better to use that.

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0

User avatar
BadMrBox
Veteran
Posts: 86
Joined: Tue Feb 28, 2006 12:19 pm

Post by BadMrBox » Fri Jan 18, 2008 4:51 am

You could take a swing at using Future.Lib if you are into lib's. http://www.petesqbsite.com/downloads/libraries.shtml

User avatar
Mentat
Veteran
Posts: 409
Joined: Tue Aug 07, 2007 3:39 pm
Location: NC, US

Post by Mentat » Fri Jan 18, 2008 7:22 am

burger2227 wrote:What exactly are you erasing? Are you using CLS? CLS will cause flickering.

SCREEN 9 can use page flipping to stop flicker. Screen 12 cannot.

How does it look in FB? It might be better to use that.

Ted
They both are currently in FB, and work very well. The demo doesn't use CLS, but the game does. I was hoping to convert these two (but only part of the demo) to QB.
For any grievances posted above, I blame whoever is in charge . . .

Nemesis
Coder
Posts: 36
Joined: Mon Aug 16, 2004 12:54 pm
Location: Colorado Springs, Colorado

Post by Nemesis » Sat Jan 19, 2008 1:50 pm

You could try double buffering. Although in SCREEN 12
you'd need a large array. I'm not sure if there are works
around this. Sounds like something I might look into
when I get some time.

Cya,

Nemesis

Mac
Veteran
Posts: 151
Joined: Mon Aug 06, 2007 2:00 pm

Re: Besides WAIT &H8D3, what's another way to to reduce

Post by Mac » Sat Jan 19, 2008 3:18 pm

Mentat wrote:I'm revisiting QB, and I can't seem to find the stuff I need.
WAIT &H3DA, 8:WAIT &H3DA, 8,8

This waits one screen refresh and often reduces flicker.

Also, do not erase icon from position P1 and then compute P2 and then, finally, write in P2. Instead, do all computing before the decision to erase.

Code: Select all

OldX = X: OldY = Y
GOSUB ComputeMove
IF OldX <> X or OLDY <> Y THEN
   CIRCLE (OldX, OldY), R, 0
   CIRCLE (X, Y), R, 15
   WAIT &H3DA, 8:WAIT &H3DA, 8,8
END IF
See? Only erase/write/wait if absolutely necessary. As opposed to erasing right away and then discovering it wasn't needed. And the time from erase to write is as small as possible.

Mac

Post Reply