rem Follow Me Adventure rem A Two Player Adventure rem by Fort Apocalypse set kernel multisprite include div_mul.asm set smartbranching on init const screenheight = 80 pfheight = 7 COLUPF = 146 gosub room1 COLUBK = 8 dim p0x = a dim p0y = b dim p1x = c dim p1y = d dim p2x = e dim p2y = f dim tempx = temp1 dim tempy = temp2 rem *** inventory rem *** bit 0 = shovel dim p0inventory = g dim p1inventory = h dim shovelx = i dim shovely = j dim shovelroom = k dim timer = l p0x = 50 : p0y = 50 p1x = 50 : p1y = 60 p2x = 50 : p2y = 70 AUDV0 = 0 : AUDV1 = 0 rem *** players player0: %00001111 %00001111 %00001111 %00001111 end rem *** shovel player1: %00000110 %00001111 %00001111 %00000110 %00000110 %00000110 %00000110 end rem *** shovel player2: %00000110 %00001111 %00001111 %00000110 %00000110 %00000110 %00000110 end mainloop if joy0left then p0x = p0x - 2 : temp1 = 6 : gosub carryp0 : gosub p0xcoll if joy0right then p0x = p0x + 2 : temp1 = 249 : gosub carryp0 : gosub p0xcoll if joy0down then p0y = p0y - 2 : temp1 = 6 : gosub carryp0 : gosub p0ycoll if joy0up then p0y = p0y + 2 : temp1 = 249 : gosub carryp0 : gosub p0ycoll if collision(player0,player1) then p2x = p2x - 6 : gosub p0hasshovel rem if collision(player0,player1) then p2x = p2x - 6 : gosub p1hasshovel if p0x < 12 then p0x = 136 : gosub room2 if p0x > 136 then p0x = 12 : gosub room2 if p0y < 10 then p0y = 87 : gosub room1 if p0y > 87 then p0y = 10 : gosub room1 if p1x < p0x then tempx = p0x - 4 else tempx = p0x + 19 if p1x > tempx then p1x = p1x - 1 : temp1 = 6 : gosub carryp1 : gosub p1xcoll if p1x < tempx then p1x = p1x + 1 : temp1 = 249 : gosub carryp1 : gosub p1xcoll if p1y > p0y then p1y = p1y - 1 : temp1 = 6 : gosub carryp1 : gosub p1ycoll if p1y < p0y then p1y = p1y + 1 : temp1 = 249 : gosub carryp1 : gosub p1ycoll if p1x < 12 then p1x = 136 if p1x > 136 then p1x = 12 if p1y < 10 then p1y = 87 if p1y > 87 then p1y = 10 if s > 0 then s = s - 1 : AUDV0 = s : AUDC0 = s : AUDF0 = s : AUDV1 = s : AUDC1 = s : AUDF1 = s player0x = p0x : player0y = p0y player1x = p2x : player1y = p2y drawscreen rem player0x = p1x : player0y = p1y rem player1x = p2x : player1y = p2y rem drawscreen goto mainloop p0xcoll if collision(player0,playfield) then p0x = p0x + temp1 return p0ycoll if collision(player0,playfield) then p0y = p0y + temp1 return p1xcoll if collision(player0,playfield) then p1x = p1x + temp1 return p1ycoll if collision(player0,playfield) then p1y = p1y + temp1 return carryp0 if p0inventory{0} then p2x = p0x : p2y = p0y return carryp1 if p1inventory{0} then p2x = p1x : p2y = p1y return p0hasshovel p0inventory{0} = 1 p1inventory{0} = 0 return p1hasshovel p0inventory{0} = 0 p1inventory{0} = 1 return room1 playfield: XXXXXXXXXXXXXXX. X............... X............... X............... ................ ................ X............... X............... X............... XXXXXXXXXXXXXXX. end return room2 playfield: XXXXXXXXXXXXXXX. X..X.....X...... X..X..X..X..XXX. X..X..X..X..X... ...X..X..X..X.XX ...XXXX..X..X..X X........X.....X X..XXXXXXXXX..XX X............... XXXXXXXXXXXXXXX. end return