'=========================================================================== ' Subject: VGA BOUNCING LINES DEMO Date: 02-06-97 (14:05) ' Author: Dave Navarro, Jr. Code: PB ' Origin: dave@powerbasic.com Packet: GRAPHICS.ABC '=========================================================================== ' VGA bouncing lines demo for PowerBASIC ' by Dave Navarro, Jr. RANDOMIZE TIMER DEFINT A-Z SCREEN 12 z = 40 DIM x1(1:z), x2(1:z), y1(1:z), y2(1:z) DIM a1(1:z), a2(1:z), b1(1:z), b2(1:z) x1 = (RND * 640) : x2 = (RND * 640) y1 = (RND * 480) : y2 = (RND * 480) a1 = (RND * 640) : a2 = (RND * 640) b1 = (RND * 480) : b2 = (RND * 480) c1 = 9 : c2 = 14 xd1 = 9 : xd2 = 7 yd1 = 6 : yd2 = 10 ad1 = -11 : ad2 = 7 bd1 = 4 : bd2 = -13 DO ARRAY DELETE x1(1) : ARRAY DELETE x2(1) ARRAY DELETE y1(1) : ARRAY DELETE y2(1) ARRAY DELETE a1(1) : ARRAY DELETE a2(1) ARRAY DELETE b1(1) : ARRAY DELETE b2(1) LINE (x1, y1) - (x2, y2), c1 LINE (x1(1), y1(1)) - (x2(1), y2(1)), 0 LINE (a1, b1) - (a2, b2), c2 LINE (a1(1), b1(1)) - (a2(1), b2(1)), 0 x1(z) = x1 : x2(z) = x2 y1(z) = y1 : y2(z) = y2 a1(z) = a1 : a2(z) = a2 b1(z) = b1 : b2(z) = b2 INCR x1, xd1 : INCR x2, xd2 INCR y1, yd1 : INCR y2, yd2 INCR a1, ad1 : INCR a2, ad2 INCR b1, bd1 : INCR b2, bd2 IF (x1 < 1) OR (x1 > 638) THEN xd1 = 0 - xd1 END IF IF (x2 < 1) OR (x2 > 638) THEN xd2 = 0 - xd2 END IF IF (a1 < 1) OR (a1 > 638) THEN ad1 = 0 - ad1 END IF IF (a2 < 1) OR (a2 > 638) THEN ad2 = 0 - ad2 END IF IF (y1 < 1) OR (y1 > 478) THEN yd1 = 0 - yd1 END IF IF (y2 < 1) OR (y2 > 478) THEN yd2 = 0 - yd2 END IF IF (b1 < 1) OR (b1 > 478) THEN bd1 = 0 - bd1 END IF IF (b2 < 1) OR (b2 > 478) THEN bd2 = 0 - bd2 END IF INCR x IF x = 1000 THEN INCR c1 INCR c2 IF c1 = 16 THEN c1 = 9 IF c2 = 16 THEN c2 = 9 x = 0 END IF DELAY .08 LOOP UNTIL LEN(INKEY$) SCREEN 0