A downloadable game

Hey guys, nothing to download, but if you copy this code into the emulator for the Commander X16 release R45 or onto your real life Commander x16 8-bit computer it'll start up an Etch-a-Sketch style program in BASIC! Use it to learn how to make your own programs in BASIC on the Commander x16!

01 SCREEN$80
10 PX = 0 : PY = 0 : CL = 8 : S = $9F23 : I = 0
20 POKE $9F25, 0
30 REM POKE $9F2A, 64 : POKE $9F2B, 64
40 POKE $9F2D, %00000111
50 POKE $9F29, %0110001
60 POKE $9F20, PX : POKE $9F21, PY : POKE $9F22, %00000000
70 GET A$: IF A$="" THEN 70
80 A=ASC(A$)
90 IF A=17 THEN I = 320 : GOTO 8000
100 IF A=29 THEN I = 1 : GOTO 8000
110 IF A=145 THEN I = -320 : GOTO 8000
120 IF A=157 THEN I = -1 : GOTO 8000
130 IF A=48 THEN CL = 0
140 IF A=49 THEN CL = 1
150 IF A=50 THEN CL = 2
160 IF A=51 THEN CL = 3
170 IF A=52 THEN CL = 4
180 IF A=53 THEN CL = 5
190 IF A=54 THEN CL = 6
200 IF A=55 THEN CL = 7
210 IF A=56 THEN CL = 8
220 IF A=56 THEN CL = 9
230 GOTO 70
8000 PX = PX + I
8010 IF PX > 255 THEN GOSUB 9000
8011 IF PX < 0 THEN GOSUB 9040
8012 IF PY > 255 THEN GOSUB 9071
8013 IF PY < 0 THEN GOSUB 9080
8020 POKE $9F20, PX : POKE $9F21, PY : POKE S, CL
8030 GOTO 70
9000 PY = PY + 1
9010 PX = PX - 256
9020 IF PX > 255 THEN GOTO 9000
9030 RETURN
9040 PY = PY - 1
9050 PX = PX + 256
9060 IF PX < 0 THEN GOTO 9040
9070 RETURN
9071 POKE $9F22, 1 : PY = 0 : GOTO 8010
9080 IF PEEK($9F22) = 1 THEN POKE $9F22, 0 : PY = 255 : GOTO 9100
9090 PY = 0
9100 RETURN


Leave a comment

Log in with itch.io to leave a comment.