Adventure
Games - Part III
by Peter Ellison
by Peter Ellison
This issue was suppose to contain the entire listing to "Black Knight". Since I didn't want to make a lousy job on what the monsters look and move like, I have extended this column for two more issues(Sorry). In this issue I have created Lancelot with sword in hand and the movement with a joystick. A short assembly-language subroutine was made to move Lancelot up and down smoothly. Lancelot moves left, right, up and down, similar to the movement in Ali Baba(TM). This short program below won't have to be changed at all in order to continue with the next installment of 'Adventure Games'.
00018 *ASSEMBLER UPCODE
00020 VP0S .EQ $601
00030 PMBASE .EQ $7800
00040 PLA
00050 LDA VPOS
00060 SEC
00070 SBC #9
00080 STA VP0S
00090 LDY VPOS
00100 LDA #0
00110 STA PMBASE+$209,Y
00120 STA PMBASE+$20A,Y
00130 STA PMBASE+$20B,Y
0010) STA PMBASE+$20C,Y
00150 STA PMBASE+$20D,Y
00160 STA PMBASE+$20E,Y
00170 STA PMBASE+$20F,Y
00180 STA PMBASE+$210,Y
00190 STA PMBASE+$211,Y
00200 LDA #19
00210 STA PMBASE+$200,Y
00220 LDA #50
00230 STA PMBASE+$201,Y
00240 LDA #36
00250 STA PMBASE+$202,Y
00260 LDA #56
00270 STA PMBASE+$203,Y
00280 LDA #32
00290 STA PMBASE+$204,Y
00300 LDA #32
00310 STA PMBASE+$205,Y
00320 LDA #56
00330 STA PMBASE+$206,Y
00310 LDA #232
00350 STA PMBASE+$207,Y
00360 LDA #148
00370 STA PMBASE+$208,Y
00380 RTS
Ok.
00005 *ASSEMBLER DOWNCODE
00010 VPOS .EQ $601
00020 PMBASE .EQ $7800
00030 PLA
000q0 LDA VPOS
00050 CLC
00060 ADC #9
00070 STA VPOS
00080 LDY VPOS
00090 LDA #0
00100 STA PMBASE+$1F7,Y
00110 STA PMBASE+$1F8,Y
00120 STA PMBASE+$1F9,Y
00130 STA PMBASE+$1FA,Y
00140 STA PMBASE+$1FB,Y
00150 STA PMBASE+$1FC,Y
00160 STA PMBASE+$1FD,Y
00170 STA PMBASE+$1FE,Y
00180 STA PMBASE+$1FF,Y
00190 LDA #19
00200 STA PMBASE+$200,Y
00210 LDA #50
00220 STA PMBASE+$201,Y
00230 LDA #36
00210 STA PMBASE+$202,Y
00250 LDA #56
00260 STA PMBASE+$203,Y
00270 LDA #32
00280 STA PMBASE+$204,Y
00290 LDA #32
00300 STA PMBASE+$205,Y
00310 LDA #56
00320 STA PMBASE+$206,Y
00330 LDA #232
00310 STA PMDASE+$207,Y
00350 LDA #110
00360 STA PMBASE+$208,Y
00370 RTS
Ok.
4900 GRAPHICS 0:SETCOLOR 2,16,1
4950 REM PLAYER POSITION
5000 X=100:Y=60
5050 REM SET UP PLAYER/MISSILE ADDRESS
5100 I=PEEK(106)-8:POKE 54279,I:PMBASE=I*256
5200 FOR Z=PMBASE+512 TO PMBASE+640
5300 POKE Z,0
5400 NEXT Z
5500 POKE 559,46:POKE 53277,3
5600 POKE 53248,X
5700 POKE 704,135
5800 FOR Z=0 TO 8;READ W:POKE PMBASE+512+Y+Z,W
5900 NEXT Z
5950 REM CHARACTER DATA
6000 DATA 49,50,36,56,32,32,56,232,140
6100 GOTO 6800
6200 A=STICK(0):IF A=11 THEN Y=Y-9:POKE 53279,0
6250 REM JOYSTICK FOR PLAYER MOVEMENT
6300 IF A=11 THEN X=X-9:POKE 53279,0:POKE 53248,X:A=15:FOR P=1 TO 100:NEXT P:IF A=15 THEN MOVE=MOVE-1:GOTO 6300
6400 IF A=7 THEN X=X+9:POKE 53279,0:POKE 53248,X:A=15:FOR P=1 TO 100:NEXT P:IF A=15 THEN MOVE=MOVE-1:GOTO 6400
6500 IF A=13 THEN R=USR(1700):POKE 53279,0:A=15:FOR D=1 TO 100:NEXT D:IF A=15 THEN MOVE=MOVE-1:GOTO 6500
6600 IF A=14 THEN Q=USR(1600):POKE 532?9,0:A=15:FOR E=1 TO 100:NEXT E:IF A=15 THEN MOVE=MOVE-1:GOTO 6200
6670 GOTO 6200
6800 FOR Q=1 TO 88:READ W:POKE 1600+Q-1:NEXT Q.
6850 REM UPCODE
6900 POKE 1537,Y
7000 DATA 104,173,1,6,56,233,9,141,1,6,172,1,6,169,0,153,9,154,153,10,154,153,11,154,153,12,154,153,13,154
7100 DATA 153,14,154,153,15,154, 153,16,154,153,17,154,169,49,153,0,154,169,50,153,1,154,169,36,153,2,154,169,56
7200 DATA 153,3,154,169,32,153,4,154,169,32,153,5,154
7300 DATA 169,56,153,6,154,169,232,153,7,154,169,140,153,8,154,96
7400 FOR R=1 TO 88::READ S:POKE 1700+R-1,S:NEXT R
7450 REM DOWNCODE
7500 DATA 104,173,1,6,24,105,9,141,1,6,172,1,6,169,0,153,247,153,153,248,153,153,249,153,153,250,153,153,251,153
7600 DATA 153,252,153,153,253,153,153,254,153,153,255,153,169,49,153,0,154,169,50,153,1,154,169,36,153,2,154,169,56
7700 DATA 153,3,154,169,32,153,4,154,169,32,153,5,154
7800 DATA 169,56,l53,6,154,169,232,153,7,154,169,140,153,8,154,96
7900 GOTO 6200