Animation morphs from one shape to the other.
Content
Image Gallery
Source Code
1 REM triangle to square
2 REM By John Bell-May/June 1986 T-S Horizons
100 DATA 20,4
105 REM DATA statements contain the coordinates of the PLOT and DRAW statements
110 DATA 70,40,100,0,0,100,-100,0,0,-100
120 DATA 70,40,100,0,-50,87,-25,-44,-25,-43
130 REM set up M/C
140 GO SUB 520
150 REM DUAL SCREEN MODE
160 RANDOMIZE USR 60000: OUT 255,1
170 RESTORE 100
180 REM Initalizes variables
190 READ frames
200 READ points
205 LET points=points+1
210 DIM a(points,2)
220 DIM b(points,2)
230 FOR a=1 TO points
240 READ a(a,1): READ b(a,2)
250 NEXT a
260 FOR a=1 TO points
270 READ b(a,1): READ b(a,2)
280 NEXT a
290 REM Makes the "B" array contain the offset of offset of each PLOT-DRAW point
300 FOR a=1 TO points
310 LET b=(b(a,1)-a(a,1))
320 LET b(a,1)=b/(frames-1)
330 LET b=(b(a,2)-a(a,2))
340 LET b(a,2)=b/(frames-1)
350 NEXT a
360 REM Draws each frame of the picture
370 FOR a=1 TO frames
380 CLS
390 PLOT a(1,1),a(1,2)
400 FOR c=2 TO points
410 DRAW a(c,1),a(c,2)
420 NEXT c
430 OUT 255,0: RANDOMIZE USR 60041: OUT 255,1
440 REM Changes coordinates for next frame
450 FOR b=1 TO points
460 LET a(b,1)=a(b,1)+b(b,1)
470 LET a(b,2)=a(b,2)+b(b,2)
480 NEXT b
490 NEXT a
500 OUT 255,0
510 STOP
520 REM POKEs M/C
530 RESTORE 600
540 LET c=0
550 FOR a=60000 TO 60052
560 READ b: POKE a,b
570 LET c=c+b
580 NEXT a
590 IF c<>7805 THEN STOP
600 RETURN
610 DATA 62,128,243,245,219,255,203,255,211,255,219,244,50,72,238,62,1,211,244,241,205,142,14,62,128,50,194,92,58,72,238,211,244,219,255,203,191,211,255,251,0,33,0,64,17,0,96,1,0,27,237,176,201
9998 STOP
9999 SAVE "ANIM" LINE 1