-
Notifications
You must be signed in to change notification settings - Fork 0
/
ferrariluis.bas
64 lines (64 loc) · 3.36 KB
/
ferrariluis.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
10 REM ******************************
20 REM * AGON LIGHT 2 *
30 REM * BBC BASIC MODE 0 *
40 REM * 320 X 240 *
50 REM * DRAW LUIS FERRARI *
60 REM * *
70 REM * BY STEVE LOVEJOY *
80 REM * A HUGE THANKS TO MILTONW *
90 REM ******************************
95 :
100 VDU 22,0 : REM SET SCREEN MODE.
110 VDU 23,1,0 : REM DISABLE CURSOR.
120 VDU 12 : REM SAME AS CLS (clear text from screen).
130 VDU 16 : REM SAME AS CLG (clear graphics from screen).
140 VDU 18,0,9 : REM SAME AS GCOL (set colour of graphics).
150 SW% = 1280 : REM SCREEN WIDTH IN GRAPHICAL UNITS.
160 SH% = 1024 : REM SCREEN HEIGHT IN GRAPHICAL UNITS.
170 DX% = SW% / 2 - 400 : REM DEFAULT X START COORDS (center of screen -400).
180 DY% = SH% / 2 - 50 : REM DEFAULT Y START COORDS (center of screen -50).
190 SC = 5.0 : REM ASSIGN FLOAT FOR SCALE (LUIS PLAY WITH THIS #).
200 :
210 PROC_DRAW : REM CALL THE DRAW PROCESS.
220 :
230 END : REM **** END OF PROGRAM ****
240 :
1000 REM **** DRAW FERRARI ****.
1010 DEF PROC_DRAW : REM DRAW PROCESS.
1020 DIM XY% (1024) : REM ARRY BIG ENOUGH NUMBER TO HOLD ALL DATA.
1030 :
1040 REPEAT : REM START OF LOOP
1050 READ X%,Y% : REM GET DATA FOR X & Y.
1060 IF X% >= 0 GOTO 1140 : REM IF X% IS 0 OR ABOVE DRAW.
1070 REM SPECIAL VALUES, EITHER MOVE OR END.
1080 IF X% = -12345 GOTO 1150 : REM IF X IS END MARKER.
1090 X% = ABS(X%) : REM IF X IS A MINUS # MOVE (NOT DRAW), ABS CONVERTS TO POSITIVE #.
1100 Y% = ABS(Y%) : REM IF X IS A MINUS # MOVE (NOT DRAW), ABS CONVERTS TO POSITIVE #.
1110 MOVE DX% + (X% * SC), DY% + (Y% * SC) : REM **** MOVE ****
1120 GOTO 1150
1130 REM ELSE
1140 DRAW DX% + (X% * SC), DY% + (Y% * SC) : REM **** DRAW ****
1150 REM ENDIF
1160 UNTIL X% = -12345 AND Y% = -12345 : REM LOOP UNTIL END MARKERS ARE READ.
1170 :
1180 ENDPROC : REM END DRAW PROCESS.
1200 :
1210 DATA -5,-1,7,4,1,11,18,17,11,20,11,16,-18,-17,43,23
1220 DATA 55,25,-49,-24,60,22,-55,-25,60,23,-55,-25,53,16,53,12
1230 DATA 54,6,55,1,49,1,47,9,43,12,39,14,36,14,35,14
1240 DATA 30,12,27,9,23,1,5,1,-15,-11,19,11,19,13,15,13
1250 DATA 15,11,-3,-9,25,9,-55,-1,97,1,99,5,100,9,101,14
1260 DATA 101,19,100,23,60,23,86,34,85,36,54,25,-47,-9,52,9
1270 DATA 100,9,-74,-18,111,12,112,14,112,17,111,20,74,18,-75,-23
1280 DATA 83,31,-101,-23,136,23,113,35,104,37,101,23,-104,-37,125,27
1290 DATA 124,23,-122,-23,123,28,-119,-23,120,27,-117,-23,118,26,-115,-23
1300 DATA 116,27,-111,-23,114,29,-109,-23,111,30,-107,-23,109,31,-105,-23
1310 DATA 107,32,-103,-23,105,33,-136,-23,159,25,113,35,-159,-25,162,27
1320 DATA 162,14,160,11,157,6,146,2,142,9,158,9,-157,-12,157,14
1340 DATA 153,14,153,12,157,12,-142,-9,138,13,134,14,131,14,128,14
1350 DATA 123,13,119,11,117,9,114,1,49,1,-117,-9,100,9,-110,-7
1370 DATA 103,7,102,5,110,5,110,7,-95,-23,96,25,97,26,98,26
1380 DATA 99,25,100,23,-130,-10,
1390 :
1400 DATA -12345, -12345 : REM END MARKERS.
1380 :