TIP: Click on subject to list as thread! ANSI
echo: quik_bas
to: ALL
from: DAVID AUKERMAN
date: 1998-04-17 20:06:00
subject: Code FAQ 04/98 10/12

'>>> Page 10 of CODE0498.FAQ begins here.
       WAIT 986, 8    (or WAIT &H3DA, 8....)
   That will help, but only a little bit.  The following example is
   a little animation of a guy running, and it uses the techniques
   described above.
[begin]
   ' =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
   ' RUN.BAS  by  Dave Shea
   ' Released to Public Domain on January 18th, 1997.
   '
   ' Compile: MicroSoft QuickBasic 4.5, PDS 7.1
   '
   ' Desc: A simple animation. Demonstrates some techniques behind
   ' animating in QB.
   '
   ' (Use at your own risk)
   ' =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
   CLS : SCREEN 13               'Set Screen 13, of course!
   PSET (25, 71), 31: DRAW "rdld2l2ngr3fnehld3rfrdngulhlg2lh"
   PSET (45, 71), 31: DRAW "rdld2lgnder2dnr2ld2rfdnguhld2lg"
   PSET (65, 71), 31: DRAW "rdld2ldrnednrddrfndhldlg"
   PSET (85, 71), 31: DRAW "rdld2lgnderdnr2d2rfdnguhlgdl2"
                                 'The above will draw four
                                 'different frames of a Stick man
                                 'running.
   DIM Guy1%(134), Guy2%(134), Guy3%(134), Guy4%(134)
                                 'Set aside the memory required for
                                 'each frame.
   GET (16, 69)-(34, 82), Guy1%  'Stick each frame into memory
   GET (36, 69)-(54, 82), Guy2%  '(X and Y values calculated by
   GET (56, 69)-(74, 82), Guy3%  ' pure trial and error. =u)
   GET (76, 69)-(94, 82), Guy4%
   CLS                           'Guess what THIS does!
   FOR a = 1 TO 300 STEP 2                'Begin Loop
    b = b + 1: IF b = 5 THEN b = 1        'Increase b until it
                                          'reaches a value of 5,
                                          'reset it to 1
    IF b = 1 THEN PUT (a, 100), Guy1%     'Determine which frame to
    IF b = 2 THEN PUT (a, 100), Guy2%     'PUT, then PUT it.
    IF b = 3 THEN PUT (a, 100), Guy3%
    IF b = 4 THEN PUT (a, 100), Guy4%
    WAIT 986, 8                           'Wait for Vertical
                                          'Retrace
    Start = TIMER                         'Small delay loop to slow
    WHILE TIMER < Start + .1: WEND        'it down a bit.
    IF b = 1 THEN PUT (a, 100), Guy1%     'Erase current frame by
    IF b = 2 THEN PUT (a, 100), Guy2%     'PUTting it again.
    IF b = 3 THEN PUT (a, 100), Guy3%
    IF b = 4 THEN PUT (a, 100), Guy4%
   NEXT                                   'Loop!
[end]
11) CAN I USE VESA SCREEN MODES IN QB?
   Most definitely.  The problem is not in getting INTO these
   screen modes; it's what you can actually DO when you're there.
   Once you have overstepped QB's regular screen modes, you can't
   use the built in graphics functions, so you have to write your
   own.  And that's where the fun part comes in.  Sticking a pixel
   on the screen is the main problem, as using INTERRUPTs seems to
   be the only standard way to do it so far, and INTERRUPT pixel-
   plotting is ridiculously slow.  But since that seems to be the
   only universally-working method, here's code for it.  Code by
   Dave Shea.
[begin]
   ' =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
'>>> Page 10 of CODE0498.FAQ ends here. Continued on next page.
___
 * SLMR 2.0 * "You summoned me, Captain?" asked T. Earl Gray, hotly.
--- Maximus/2 3.01
---------------
* Origin: The I.O. Board - 4GB -XX- V34+ (1:2255/10)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.