'=========================================================================== ' Subject: BOUNCING WORM Date: 04-14-96 (14:40) ' Author: Andrew Jones Code: QB, QBasic, PDS ' Origin: FidoNet QUIK_BAS Echo Packet: GRAPHICS.ABC '=========================================================================== 'Here's a trippy VGA screensaver of a WORM moving on a VGA background. He 'moves and is animated... One problem is he starts leaving black spots 'after awhile, you'll see it DECLARE SUB animate (qq%) DEFINT A-Z SCREEN 13 RANDOMIZE TIMER d = 8 v = 1 q = 1 x = 160 y = 100 xd = INT(RND * 4) + 2 yd = INT(RND * 4) + 2 IF INT(RND * 10) > 5 THEN xd = -xd ELSE xd = ABS(xd) IF INT(RND * 10) > 5 THEN yd = -yd ELSE yd = ABS(yd) FOR t = 0 TO 100 LINE (0, t)-(319, t), 200 - t LINE (0, 200 - t)-(319, 200 - t), t LINE (t, t)-(319 - t, t), t LINE (t, 200 - t)-(319 - t, 200 - t), 200 - t NEXT DO IF INT(RND * 30) + 1 = 15 AND xd < 0 THEN xd = xd - 1 IF xd = -1 THEN xd = 2 IF xd = -6 THEN xd = -5 IF INT(RND * 30) + 1 = 15 AND xd > 0 THEN xd = xd + 1 IF xd = 1 THEN xd = -2 IF xd = 6 THEN xd = -5 IF INT(RND * 30) + 1 = 15 AND yd > 0 THEN yd = yd + 1 IF yd = 1 THEN yd = -2 IF yd = -6 THEN yd = -5 IF INT(RND * 30) + 1 = 15 AND yd < 0 THEN yd = yd - 1 IF yd = -1 THEN yd = 2 IF yd = 6 THEN yd = 5 FOR t = 1 TO 8 CIRCLE (x, y), 15 - t, q + t CIRCLE (x + 1, y), 15 - t, q + t NEXT x = x + xd y = y + yd IF x < 3 AND xd < 0 THEN xd = ABS(xd) IF x > 316 AND xd > 0 THEN xd = -xd IF y < 3 AND yd < 0 THEN yd = ABS(yd) IF y > 196 AND yd > 0 THEN yd = -yd q = q + 1 IF q = 255 THEN q = 1 v = v + d IF v = 400 THEN d = -8 IF v = 0 THEN d = 8 animate v LOOP SUB animate (qq) OUT &H3C8, 1 FOR t = 1 TO 255 OUT &H3C9, (t + qq) OUT &H3C9, (t + qq) \ 2 OUT &H3C9, (t + qq) \ 4 NEXT END SUB