'=========================================================================== ' Subject: ROTATING PLANETS Date: 05-15-97 (10:04) ' Author: Davey W. Taylor Code: QB, QBasic, PDS ' Origin: audio.squad@mailbox.swipnet.se Packet: GRAPHICS.ABC '=========================================================================== 'Rotating PLANETS 'Davey W Taylor 'audio.squad@mailbox.swipnet.se '--- setup --- moonspin% = 16 earthspin% = 4 yflip% = 0 '-- program -- pi = 3.141593 a% = 1 yflip% = earthspin% + yflip% DO SWAP a%, v% SCREEN 9, , a%, v% WINDOW SCREEN (1, 1)-(640, 350) WAIT &H3DA, 8 CLS d% = (d% + earthspin%) MOD 360 r = d% * (pi / 180) di% = (di% + yflip%) MOD 360 ri = di% * (pi / 180) s = 10 + (COS(r) * 10) x = 320 + (200 * SIN(r)) y = 175 + (50 * SIN(ri)) d2% = (d2% + moonspin%) MOD 360 r2 = d2% * (pi / 180) s2 = 4 + (COS(r2) * 2) + (COS(r) * 2) t = 50 + (25 * COS(r)) x2 = x + (t * SIN(r2)) y2 = y + (4 * COS(r2)) IF (10 * COS(r)) >= 0 THEN CIRCLE (320, 175), 100, 14 PAINT (320, 175), 14, 14 END IF IF (10 * COS(r2)) <= 0 THEN CIRCLE (x2, y2), s2, 6 PAINT (x2, y2), 6, 6 END IF CIRCLE (x, y), s, 9 PAINT (x, y), 9, 9 IF (10 * COS(r2)) > 0 THEN CIRCLE (x2, y2), s2, 6 PAINT (x2, y2), 6, 6 END IF IF (10 * COS(r)) < 0 THEN CIRCLE (320, 175), 100, 14 PAINT (320, 175), 14, 14 END IF LOOP UNTIL INKEY$ <> ""