Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
67 lines (59 sloc) 1.41 KB
DECLARE SUB WAITSYNC ()
RANDOMIZE TIMER
SCREEN 12
CIRCLE (4, 4), 2, 15
PAINT (4, 4), 14, 15
DIM A(7)
GET (1, 1)-(7, 7), A
LINE (1, 1)-(7, 7), 0, BF
BALLS = 100
DIM X(BALLS)
DIM Y(BALLS)
DIM XX(BALLS)
DIM YY(BALLS)
FOR I = 1 TO BALLS
X(I) = 320: Y(I) = 240
'X(I) = RND * 620 + 10
'Y(I) = RND * 460 + 10
XX(I) = RND * 2 - 1
YY(I) = RND * 2 - 1
NEXT I
LINE (0, 0)-(639, 479), 15, B
T = 50
DO WHILE INKEY$ = ""
T = T + 1
FOR I = 1 TO BALLS
'IF T MOD 10 = 0 THEN LOCATE 1, 1: PRINT T
IF T > 100 AND T < 200 THEN YY(I) = YY(I) + .01: IF YY(I) > 1 THEN YY(I) = 1
IF T > 200 AND T < 300 THEN XX(I) = XX(I) - .01: IF XX(I) < -1 THEN XX(I) = -1
IF T > 300 AND T < 400 THEN YY(I) = YY(I) - .01: IF YY(I) < -1 THEN YY(I) = -1
IF T > 400 AND T < 500 THEN XX(I) = XX(I) + .01: IF XX(I) > 1 THEN XX(I) = 1
IF T > 500 THEN T = 0
IF X(I) > 631 THEN XX(I) = -XX(I)
IF X(I) < 2 THEN XX(I) = -XX(I)
IF Y(I) > 471 THEN YY(I) = -YY(I)
IF Y(I) < 2 THEN YY(I) = -YY(I)
X(I) = X(I) + XX(I)
Y(I) = Y(I) + YY(I)
'PUT (X(I), Y(I)), A, PSET
P = P + 1: IF P = 8 THEN P = 1
PSET (X(I), Y(I)), P
NEXT I
C = C + 1
'X = INT(COS(C / 10) * 20 + 40)
'Y = INT(SIN(C / 20) * 10 + 40)
'Z = INT(SIN(C / 10) * 20 + 40)
'PALETTE 0, X * 65536 + X * 256 + X
'IF X = 50 THEN X = 0 ELSE X = 50
'WAITSYNC
'OUT &H3C8, 0
'OUT &H3C9, X
'OUT &H3C9, X
'OUT &H3C9, X
LOOP
SUB WAITSYNC
WAITS:
IF INP(&H3DA) AND 8 = 0 THEN GOTO WAITS
WAITS2:
IF INP(&H3DA) AND 8 = 0 THEN GOTO WAITS2
END SUB
You can’t perform that action at this time.