UFO 2068
This first little “ditty,” creates a UFO that you can add to your games and play around with. A few BASIC tricks are incorporated in this listing. Lines 120 to 150 control the direction, using the 1, 2, 3, Q, E, A, S and D keys. Line 1 changes the BORDER to magenta and the colors of the edit lines with the use of RUN 10. Line 10 takes the place of 24 lines of “POKE USR “a”+1, BIN 00100000,” etc. By using the loop to poke the bit patterns, it is much faster.
1 BORDER 3: RUN 10: REM UFO
4 PRINT AT r,c;CHR$ 144: RETURN
5 PRINT AT r,c;" ": RETURN
10 FOR i=65368 TO 65391: READ d: POKE i,d: NEXT i: DATA 0,66,24,36,36,24,66,0,32,16,45,34,68,180,8,4,4,8,180,68,34,45,16,32
100 LET r=9: LET c=15: GO SUB 4
110 LET z=CODE INKEY$: GO SUB 4
120 IF r>0 AND (z=49 OR z=50 OR z=51) THEN GO SUB 5: LET r=r-1
130 IF r<21 AND (z=97 OR z=115 OR z=100) THEN GO SUB 5: LET r=r+1
140 IF c<31 AND (z=51 OR z=101 OR z=100) THEN GO SUB 5: LET c=c+1
150 IF c>0 AND (z=49 OR z=113 OR z=97) THEN GO SUB 5: LET c=c-1
160 PRINT AT r,c;CHR$ 145;AT r,c;CHR$ 146: GO TO 110
BITS
Speaking of bit patterns, here’s another little ditty that will print out all of the possible bit patterns (0 to 255). This listing is taken from Graphics A to Z, and has been converted for the 2068. It takes about 30 seconds to generate all the patterns. If you would like a listing, then change all of the PRINTs (80, 100, 110, 120 and 130) to LPRINT and hook up your printer. This list will be very useful if you do any user defined graphics.
1 REM List of 256 bit patterns
10 LET a=0: LET b=65368: LET c=b+167: LET d=164: LET e=1
20 GO SUB 300
30 DIM l(2049)
40 GO SUB 170
50 LET c=b+87: LET d=154
60 GO SUB 300: GO SUB 170
70 LET h=0: CLS
80 FOR f=1 TO e STEP 8: PRINT h;TAB 6;
90 FOR g=f TO f+7
100 IF l(g)=0 THEN PRINT "*";
110 IF l(g)=1 THEN PRINT "▒";
120 NEXT g: PRINT " ";
130 FOR t=f TO f+7: PRINT l(t);: NEXT t: LET h=h+1: PRINT "": PRINT ""
140 IF h=256 THEN STOP
150 NEXT f
170 FOR f=144 TO d: PRINT AT 0,0;CHR$ f
180 FOR y=175 TO 168 STEP -1
190 FOR x=0 TO 7: LET l(e)=POINT (x,y): LET e=e+1: NEXT x
200 NEXT y: NEXT f: RETURN
300 FOR t=b TO c: POKE t,a: LET a=a+1: NEXT t: RETURN
TEST TIME
For a little project, incorporate Tom Wood‘s 2068 Decimal to Hex conversion (see last issue) before LPRINTing and add a column of Hex numbers next to the decimal numbers. Use this in conjunction with Basil‘s character builder too. This task will really get your feet wet with your own graphics.
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.