'=========================================================================== ' Subject: BOUNCING BALL W/STARS Date: 02-04-97 (10:10) ' Author: Shaun Burnette Code: QB, QBasic, PDS ' Origin: shaun_burnette@hotmail.com Packet: GRAPHICS.ABC '=========================================================================== '=================================== 'Ballz.bas 'By:Shaun Burnette '2-4-97 'Email:shaun_burnette@hotmail.com '=================================== DEFINT A-Z DIM BallZ(1093) 'Diminish an array large enough to hold BallZ(1093) DECLARE SUB DrawBallZ () 'Draws BallZ X = 0 'Starting point for X Y = 0 'Starting point for Y DOWN = 2 'How many pixels to drop each time ACROSS = 1 'How many pixels to go across each time '=======>Draw and get BallZ<======== SCREEN 13 CLS 'Clear screen DrawBallZ 'Draw BallZ GET (0, 0)-(32, 32), BallZ 'Get BallZ '===>Loop that makes Ballz bounce<=== DO C = RND * 256 'Random color B = INT((280 - 20 + 1) * RND + 20) 'Random X point D = INT((170 - 20 + 1) * RND + 20) 'Random Y point PSET (B, D), C 'Turn on the pixel at (B,D) on color C FOR A = 1 TO 15000: NEXT A 'This can be taken out if it is too slow X = X + DOWN 'Increase X value to make BallZ move Y = Y + ACROSS 'Increase Y value to make BallZ move IF (X < 1 OR X > 280) THEN DOWN = -DOWN 'Make BallZ reverse IF (Y < 1 OR Y > 160) THEN ACROSS = -ACROSS 'Make Ballz reverse PUT (X, Y), BallZ, PSET 'Puts BallZ on screen LOOP WHILE INKEY$ = "" 'Loop until a key is pressed SUB DrawBallZ FOR Size = 1 TO 14 Colo = Colo + 1 CIRCLE (16, 16), Size, Colo 'Draw a circle NEXT END SUB