Several questions

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
Guest

Several questions

Post by Guest » Tue Sep 13, 2005 8:10 pm

I have a couple of questions. Firstly, I notice that well done games never have a problem with flicker. I've also noticed that in relsoft's polygon files, he uses something called the setvideoseg which seems to get rid of flicker and black blocks behind sprites. Can anyone give me anymore info on this?
Secondly, how do you make many frames of anime without using a seperate array for each, thus avoiding using hundreds of IF statements.
Finally, how do you rotate sprites so that you could make a 360 2d shooter?

User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Post by {Nathan} » Wed Sep 14, 2005 5:16 pm

google and the 600 tutors on this site are your FRIEND!!!
Image

User avatar
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 » Wed Sep 14, 2005 6:50 pm

In QBasic, the flickering can be controlled by:

Code: Select all

WAIT &H3DA, 8
Also doing LINE over CLS:

Code: Select all

SCREEN 13

'Start loop
DO
LINE (0, 0)-(320, 200), 0, BF'Clear Screen...
'Calculate
'Draw GFX
WAIT &H3DA, 8
'Delay Loop
LOOP UNTIL INKEY$ = CHR$(27)
Those should help you out as for flickering... :wink:
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)

Guest

Condemned

Post by Guest » Mon Oct 10, 2005 12:46 am

I think some one does not like me. B) xx(

User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Post by {Nathan} » Mon Oct 10, 2005 3:09 pm

actually, I do like you (since you like QB), but I just hate it when people go to these forums without searching google, or the expanse of tutorials on this site. just be glad you had forums, i programed in qb for 2 years until i found an active community.
Image

User avatar
Pete
Site Admin
Posts: 882
Joined: Sun Dec 07, 2003 9:10 pm
Location: Candor, NY
Contact:

Post by Pete » Mon Oct 10, 2005 5:16 pm

Nathan1993 wrote:I just hate it when people go to these forums without searching google, or the expanse of tutorials on this site. just be glad you had forums, i programed in qb for 2 years until i found an active community.
You tell people to do web searches to find out info about QB programming, yet it took you two years to find an active community? If you search "qbasic" in any search engine, you'll find about five active boards on the first page of results! Seems like you didn't even follow your own advice.

User avatar
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 » Mon Oct 10, 2005 7:02 pm

:lol: I found QBN a few weeks after starting QB, with AOL's search (Imagin if I had Google).... I just never bother to regester (At the time, I wasn't allowed to talk via the internet also (Parents :wink:)),...

And two years coding allone isn't bad.. When you have to resolve your own problems, you can learn alot more.... Being the option of posting for help was never there for me in my n00b stage, I can say, I don't regret it....

It's rare I post for help, and it doesn't mean I don't ever have problems,. I've just learned how to fix them myself...

:wink:
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)

Antoni
Veteran
Posts: 132
Joined: Wed Jun 15, 2005 3:01 pm
Contact:

Re: Several questions

Post by Antoni » Tue Oct 11, 2005 9:37 am

Anonymous wrote:I have a couple of questions. Firstly, I notice that well done games never have a problem with flicker. I've also noticed that in relsoft's polygon files, he uses something called the setvideoseg which seems to get rid of flicker and black blocks behind sprites. Can anyone give me anymore info on this?
SetVideoSeg is a hack by Plasma that overwrites a QB internal variable, redirecting the drawing keywords as PSET, PUT, GET, LINE... to your buffer, when normally they only draw to screen. So you can draw to the buffer the same way you would draw to screen. Without SetVideoSeg you must use POKE to set individual pixels if you want to draw to a buffer.
When your drawing is ready you can send it to screen with a PUT.

User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Post by {Nathan} » Tue Oct 11, 2005 3:46 pm

Pete wrote:
Nathan1993 wrote:I just hate it when people go to these forums without searching google, or the expanse of tutorials on this site. just be glad you had forums, i programed in qb for 2 years until i found an active community.
You tell people to do web searches to find out info about QB programming, yet it took you two years to find an active community? If you search "qbasic" in any search engine, you'll find about five active boards on the first page of results! Seems like you didn't even follow your own advice.
actually, I did, I just never *visited* the forums... mostly because I hated them and thought they were dumb (bad experiences... *shudders*). Becuase of that, I never really checked the forums... then I saw that your forums were active (and nice :-p).
Image

urger
Coder
Posts: 21
Joined: Fri Dec 03, 2004 6:35 pm

Post by urger » Tue Oct 11, 2005 7:09 pm

Laughing I found QBN a few weeks after starting QB, with AOL's search (Imagin if I had Google).... I just never bother to regester (At the time, I wasn't allowed to talk via the internet also (Parents Wink)),...

And two years coding allone isn't bad.. When you have to resolve your own problems, you can learn alot more.... Being the option of posting for help was never there for me in my n00b stage, I can say, I don't regret it....

It's rare I post for help, and it doesn't mean I don't ever have problems,. I've just learned how to fix them myself...
I'm in the same boat. I started coding in QB 8 years before I bothered to look to see if there was a QB community on the internet, despite the fact that I belonged to comp.lang.lisp for seemingly ever. If I had found the QB communuity earlier I probably would have stuck to working in just QB instead of learning LISP, Perl, Python, TCL etc. I would have lost out on a lot.
Share and Enjoy.

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

Post by Nemesis » Wed Oct 12, 2005 6:39 pm

Here's my version of SETVIDEOSEG...

Code: Select all

'
DEFINT A-Z
DIM SHARED VIDEO(32007)
SCREEN 13: CLS 
VIDEOseg& = 1 + VARSEG(VIDEO(0)) 
DEF SEG : BSAVE "buffer.tmp", &H0, &HFA00 
DEF SEG = VIDEOseg&: BLOAD "buffer.tmp", 0 
KILL "buffer.tmp" 
FOR I = 8 TO 32007 - 1 
 IF VIDEO(I) = &H7DA0 AND VIDEO(I + 1) = &HA000 THEN 
  VIDEO(0) = ((I + 1) * 2) - 16 
  VIDEO(1) = VIDEO(0) + 1 
  VIDEO(4) = VIDEOseg& AND &HFF 
  IF (VIDEOseg& AND &H8000) THEN 
   VIDEO(5) = ((VIDEOseg& AND &HFF00) \ &HFF) + &H100 
  ELSE 
   VIDEO(5) = (VIDEOseg& AND &HFF00) \ &HFF 
  END IF 
  DEF SEG 
  VIDEO(2) = PEEK(VIDEO(0)): VIDEO(3) = PEEK(VIDEO(1)) 
  POKE VIDEO(0), VIDEO(4): POKE VIDEO(1), VIDEO(5) 
  EXIT FOR 
 END IF 
NEXT 
' 
VIDEO(6) = 2560 
VIDEO(7) = 200
'
And this part is for PUTting the screen buffer at the VGA's (SCREEN 13)
beginning address...

Code: Select all

' 
 DEF SEG 
 POKE VIDEO(0), VIDEO(2) 
 POKE VIDEO(1), VIDEO(3) 
 PUT (0, 0), VIDEO(6), PSET 
 POKE VIDEO(0), VIDEO(4) 
 POKE VIDEO(1), VIDEO(5) 
 ' 
Personally I think this version is easier to use than the other.

P.s..

If you need more help or any questions feel free to post or send a private message to me.

Cya,

Nemesis

Post Reply