DEMO.BAS  ·  BAS  ·  1.7 KB  ·  1988-03-15  ·  from Compute-PC-Magazine-Disk_July-1988_Volume-2_No.4_Issue-6
10  'Copyright 1988 COMPUTE! Publications. All rights reserved.
20 SCREEN 1,0:COLOR 17,0:CLS:LOCATE 12,14:PRINT"Please wait...";
30 DEFINT S:DIM SHAPE1(300),SHAPE2(300),SHAPE3(300),SHAPE4(300) 'FOUR SHAPES
40 OPEN"I",#1,"DEMO.SHP":SHAPENUM=4
50 FOR T=1 TO SHAPENUM
60 INPUT #1,E,X,Y                     '	input x and y shape dimensions for each
70 Z=INT(((INT(((X+3)/4)*Y)*2)+6))    ' formula calculates # of numbers to read
80 ON T GOSUB 270,280,290,300	      ' fill each of four shape arrays
90 NEXT T
100 CLOSE #1
110 CLS:LINE(0,190)-(319,199),1,BF:LINE(100,189)-(100,180),2:LINE-(110,170),2:LINE-(120,180),2:LINE-(120,189),2:CIRCLE(300,50),20,3:PAINT(300,50),3,3
120 PRINT"This is a demostration on how to use the":PRINT"shapes created by the Shape Edit Program"
130 X=0:Z=0
140 WHILE INKEY$=""         'start of animation loop
150 GOSUB 220               'erase old image with XOR (PUT default)
160 X=X+5:IF X>295 THEN X=0 'increase value of horizontal screen placement
170 Z=Z+1:IF Z>4 THEN Z=1   'Z picks which shape to draw
180 GOSUB 220               'print new shape
190 FOR T=1 TO 100:NEXT     'delay loop
200 WEND                    'end of animation loop
210 SCREEN 0:WIDTH 80:END
220 ON Z GOSUB 230,240,250,260:RETURN 'draw which shape?
230 PUT(X,100),SHAPE1:RETURN 'draw shapes
240 PUT(X,100),SHAPE2:RETURN
250 PUT(X,100),SHAPE3:RETURN
260 PUT(X,100),SHAPE4:RETURN
270 SHAPE1(0)=X*2:SHAPE1(1)=Y:FOR I=2 TO Z-2:INPUT #1,SHAPE1(I):NEXT:RETURN
280 SHAPE2(0)=X*2:SHAPE2(1)=Y:FOR I=2 TO Z-2:INPUT #1,SHAPE2(I):NEXT:RETURN
290 SHAPE3(0)=X*2:SHAPE3(1)=Y:FOR I=2 TO Z-2:INPUT #1,SHAPE3(I):NEXT:RETURN
300 SHAPE4(0)=X*2:SHAPE4(1)=Y:FOR I=2 TO Z-2:INPUT #1,SHAPE4(I):NEXT:RETURN