'=========================================================================== ' Subject: MOVING INTO STAR FIELD EFFECT Date: 02-27-97 (07:06) ' Author: Kevin Fowlks Code: QB, QBasic, PDS ' Origin: kfowlks@sojourn.com Packet: GRAPHICS.ABC '=========================================================================== SCREEN 13: DEFINT A-Z: CLS : RANDOMIZE TIMER 'Star Field programmed by Kevin Fowlks ' Displays up to 599 stars DIM screenx(600) AS LONG DIM screeny(600) AS LONG DIM z(600) AS LONG DIM x(600) AS LONG DIM y(600) AS LONG numofstars% = 400 o = 255 FOR p% = 1 TO 255 OUT &H3C6, &HFF OUT &H3C8, p% OUT &H3C9, o OUT &H3C9, o OUT &H3C9, o o = o - 1 NEXT FOR a = 0 TO numofstars% z&(a) = INT(RND * 256) + 1 NEXT DO FOR i = 0 TO numofstars% z&(i) = z&(i) - 1 IF z&(i) <= 0 THEN z&(i) = 256 IF screenx&(i) >= 320 OR screenx&(i) <= 0 OR screenx&(i) = 160 THEN x&(i) = INT((160 - -160 + 1) * RND + -160) screenx&(i) = ((x&(i) * 256) / z&(i)) + 160 END IF IF screeny&(i) >= 200 OR screeny&(i) <= 0 OR screeny&(i) = 100 THEN y&(i) = INT((100 - -100 + 1) * RND + -100) screeny&(i) = ((y&(i) * 256) / z&(i)) + 100 END IF screenx&(i) = ((x&(i) * 256) / z&(i)) + 160 screeny&(i) = ((y&(i) * 256) / z&(i)) + 100 PSET (screenx&(i), screeny&(i)), 15 NEXT FOR b = 0 TO numofstars% PSET (screenx&(b), screeny&(b)), 0 NEXT LOOP UNTIL INKEY$ = CHR$(27)