'=========================================================================== ' Subject: BOX ENLARGES AS BALL BOUNCES Date: 04-14-96 (14:42) ' Author: Andrew Jones Code: QB, QBasic, PDS ' Origin: FidoNet QUIK_BAS Echo Packet: GRAPHICS.ABC '=========================================================================== 'Sorry about that profanity in BOB.BAS, just saw it as I was cruising 'through my programs..eek.. here's an EGA demonstration:) DEFINT A-Z CONST numstars = 30 apage = 0 vpage = 1 x = 0 y = 0 bx = 6 by = 7 d = 1 b = 1 q = 4 DIM sx(numstars) DIM sy(numstars) DIM sc(numstars) SCREEN 7 FOR t = 0 TO numstars sx(t) = INT(RND * 320) sy(t) = INT(RND * 320) sc(t) = INT(RND * 3) + 1 IF sc(t) = 1 THEN sc(t) = 8 IF sc(t) = 2 THEN sc(t) = 7 IF sc(t) = 3 THEN sc(t) = 15 NEXT DO SCREEN 7, , apage, vpage DRAW "TA" + STR$(b) + "S" + STR$(q) DRAW "c15bm160,100u20r20c8d20l20c15c8u20c15e10r20e-10d20e10u20" FOR t = 0 TO numstars IF sx(t) = 0 AND sy(t) = 0 THEN sx(t) = INT(RND * 20) + 300 sy(t) = INT(RND * 200) sc(t) = INT(RND * 3) + 1 IF sc(t) = 1 THEN sc(t) = 8 IF sc(t) = 2 THEN sc(t) = 7 IF sc(t) = 3 THEN sc(t) = 15 END IF PSET (sx(t), sy(t)), sc(t) sx(t) = sx(t) - sc(t) IF sx(t) < 0 THEN sx(t) = 0: sy(t) = 0 NEXT x = x + bx y = y + by IF x > 320 THEN bx = -bx: x = 320 IF y > 200 THEN by = -by: y = 200 IF x < 0 THEN bx = ABS(bx) IF y < 0 THEN by = ABS(by) CIRCLE (x, y), 2, 4 CIRCLE (x, y), 1, 12 CIRCLE (x + 1, y), 2, 4 CIRCLE (x + 1, y), 1, 12 SWAP apage, vpage SCREEN 7, , apage, vpage CLS 1 b = b + 10 q = q + d IF q >= 22 THEN d = -1 IF q = 4 THEN d = 1 IF b >= 360 THEN b = 1 LOOP