'=========================================================================== ' Subject: COLORFUL BOUNCING LINES Date: 12-20-97 (10:33) ' Author: Alexander Meyer Code: QB, QBasic, PDS ' Origin: Meyer.Karl@t-online.de Packet: GRAPHICS.ABC '=========================================================================== ' //// ' 0(o o)0 '-------------------------ooO (_) Ooo--------------------- ' LINEBOUN.BAS -- Written in QuickBasic 4.5 ' ' Name: Colourful bouning lines ' Author: Alexander Meyer ' Date: 11-23-1997 ' Description: This shows four bouncing lines in VGA ' 'For questions or comments mail to: Meyer.Karl@t-online.de '-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- SCREEN 13 'VGA 320 x 200 DIM x(1 TO 4) DIM y(1 TO 4) DIM XDir(1 TO 4) DIM YDir(1 TO 4) x(1) = 0: y(1) = 0 x(2) = 319: y(2) = 199 x(3) = 0: y(3) = 199 x(4) = 319: y(4) = 0 DO FOR a = 1 TO 4 'For all four lines IF x(a) >= 319 THEN XDir(a) = 1 IF x(a) <= 1 THEN XDir(a) = 0 IF y(a) >= 199 THEN YDir(a) = 1 IF y(a) <= 1 THEN YDir(a) = 0 IF XDir(a) = 0 THEN x(a) = x(a) + 1 ELSE x(a) = x(a) - 1 END IF IF YDir(a) = 0 THEN y(a) = y(a) + 1 ELSE y(a) = y(a) - 1 END IF NEXT a c = c + 1 IF c = 248 THEN c = 1 IF INKEY$ <> "" THEN END PSET (x(1), y(1)), c 'Draw lines PSET (x(2), y(2)), c PSET (x(3), y(3)), c PSET (x(4), y(4)), c LOOP END