-
Notifications
You must be signed in to change notification settings - Fork 0
/
kinetic.bas
28 lines (28 loc) · 910 Bytes
/
kinetic.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
10 REM THIS IS AN EXAMPLE OF AN ANIMATED MOVING LINE
20 GOTO40
30 SAVE"KINETIC/BAS":END
40 W=4 ' STEP
50 D=30 ' NUMBER OF BARS
60 K=2 ' ADD TO RND(W)
70 FORX=1TO4:Z=RND(W):NEXT
80 XI=RND(W);XJ=RND(W)
90 YI-RND(W):YJ=RHD(W)
100 X=RND(638)
110 X1=RND(638)
120 Y=RND(238)
130 Y1=RND(238)
140 DIM A(D,4)
150 I=1:E=2
160 CLS2
170 LINE(0,0)-(639,239),1,B
180 PRINT CHR$(2)
190 LINE(A(E,1),A(E.2))-(A(E,3),A(E,4)),0:LINE(X,Y)-(XI,Y1)
200 A(I,1)=X:A(I,2)=Y:A(I,3)=X1:A(I,4)=Y1
210 I=I+1:IF I>D THEN I=1
220 E=E+1:IF E>D THEN E=1
230 IF X+XI<1 OR X+XI>638 THEN XI=-1*SGN(XI)*(RND(W)+K)
240 IF X1+XJ<1 OR X1+XJ>638 THEN XJ=-1*SGN(XJ)*(RND(W)+K)
250 IF Y+YI<1 OR Y+YI>238 THEN YI=-l*SGN(YI)*(RND(W)+K)
260 IF Y1+YJ<1 OR Y1+YJ>238 THEN YJ=-1*SGN(YJ)*(RND(W)+K)
270 X=X+XI:Y=Y+YI:X1=X1+XJ:Y1=Y1+YJ
280 GOTO190