'$DYNAMIC 'current library-timing.qlb DEFINT A-Z DECLARE SUB setmodex () DECLARE SUB copypage (BYVAL page1, BYVAL page2) DECLARE SUB setvispage (BYVAL page) DECLARE SUB drawsprite (pic(), pal(), BYVAL po, BYVAL X, BYVAL Y, BYVAL page) DECLARE SUB loadsprite (pic(), BYVAL X, BYVAL Y, BYVAL w, BYVAL h, BYVAL page) DECLARE SUB fadeto (palbuff(), BYVAL red, BYVAL green, BYVAL blue) DECLARE SUB fadetopal (pal(), palbuff()) DECLARE SUB setpal (pal()) DECLARE SUB clearpage (BYVAL page) DECLARE SUB setdiskpages (buf(), BYVAL h, BYVAL l) DECLARE SUB loadpage (fil$, BYVAL i, BYVAL p) DECLARE SUB setkeys () DECLARE SUB setfont (f()) DECLARE SUB printstr (s$, BYVAL X, BYVAL Y, BYVAL p) DECLARE SUB textcolor (BYVAL f, BYVAL b) DECLARE SUB setitup (fil$, buff(), BYVAL p) DECLARE SUB resetdsp DECLARE SUB playsnd (BYVAL n, BYVAL f) DECLARE SUB closefile DECLARE SUB setwait (a(), BYVAL t) DECLARE FUNCTION Keyseg () DECLARE FUNCTION keyoff () DECLARE FUNCTION keyval (BYVAL a) DECLARE FUNCTION getkey () TYPE Regtype ax AS INTEGER bx AS INTEGER cx AS INTEGER dx AS INTEGER bp AS INTEGER si AS INTEGER di AS INTEGER flags AS INTEGER ds AS INTEGER es AS INTEGER END TYPE DIM SHARED regs AS Regtype regs.ax = &H3509: CALL interruptx(&H21, regs, regs) off9 = regs.bx: seg9 = regs.es regs.ax = &H2509: regs.ds = Keyseg: regs.dx = keyoff CALL interruptx(&H21, regs, regs) 1 RANDOMIZE TIMER setmodex DIM tmr(1), map(-1 TO 22, -1 TO 14), pic(138), shot(138), plip(138), bug(138), shark(138), shrew(138), spid(138), bobpal(300), dir$(16), newpal(767), nme$(6), fadepal(1536), tmp(8000), voic(32000), txt(1024), mess$(14, 1), msz(14, 1), opt$(5, 2, _ 1), scln$(3) OPEN "LEVELS.DAT" FOR RANDOM ACCESS READ AS #1 LEN = 128 setitup "bobvoice.dat" + CHR$(0), voic(), 2 resetdsp FOR i = -1 TO 22: FOR j = -1 TO 14: map(i, j) = 14: NEXT j: NEXT i FOR i = 0 TO 3: READ scln$(i): NEXT i FOR i = 0 TO 10: FOR j = 0 TO 1: READ mess$(i, j): READ msz(i, j): NEXT j: NEXT i FOR j = 0 TO 4: FOR k = 0 TO 2: READ opt$(j, k, 0): NEXT k: NEXT j vlad = 0: hat = 0: bobpic = 0: invis = 0: lang = 0: dvc = 1: lvlb = 1: tspd = 2 LEFT = 75: RIGHT = 77: UP = 72: DOWN = 80: shoot = 57: ticks = 110 gn$ = "bobgraph.scr" + CHR$(0) setpal newpal() DEF SEG = VARSEG(newpal(0)) BLOAD "palette.sto", VARPTR(newpal(0)) DEF SEG = VARSEG(txt(0)) BLOAD "bobtext.fnt", VARPTR(txt(0)) setfont txt() setdiskpages tmp(), 200, 0 loadpage gn$, 0, 3 DEF SEG = VARSEG(bobpal(0)): BLOAD "bobgraph.pal", VARPTR(bobpal(0)) DIM ded(138), car(138), cabag(138), spm(138), sun(138), dirt(138), con(138), digup(138), dug(138), web(138), tore(138) GOSUB 1915 setvispage 0 220 fadeto fadepal(), 0, 0, 0 lives = 3: lvl = 1 nxlf& = 1500: sp = 1: sr = 20: scr& = 0 FIELD #1, 120 AS ld$, 8 AS dr$ 223 FOR i = 0 TO pl: pl(i) = 0: rp(i) = 10: NEXT i: FOR i = 1 TO cb: bt(i) = 0: rb(i) = 15: NEXT i dir = 1: raf = 0: pl = 0: rs = 0: rn = 0: cb = 0: sh = 0: bw = 0: sn = 0: wn = 0: xw = 0: wbx = 0 GET #1, lvl: t$ = dr$ FOR j = 1 TO 12: FOR i = 1 TO 10 map(i * 2 - 1, j) = ASC(MID$(ld$, i + (j - 1) * 10, 1)) AND 15: map(i * 2, j) = (ASC(MID$(ld$, i + (j - 1) * 10, 1)) AND 240) / 16 NEXT i: NEXT j 225 clearpage 2: cpage = 1: dpage = 0 GOSUB 1800 ct = 0 FOR i = 1 TO 12: FOR j = 1 TO 20 IF map(j, i) = 2 THEN X = j: Y = i IF map(j, i) = 3 THEN ct = ct + 1 IF map(j, i) = 6 THEN pl = pl + 1: PX(pl) = j: PY(pl) = i: rp(pl) = 20 IF map(j, i) = 7 THEN rs = 1: srx = j: srY = i IF map(j, i) = 8 THEN cb = cb + 1: bt(cb) = 0: bx(cb) = j: bY(cb) = i: rb(cb) = 15 IF map(j, i) = 9 THEN sh = 1: SX = j: SY = i IF map(j, i) = 10 THEN bw = 1: swx = j: swY = i NEXT j: NEXT i exd = 1: eyd = 0: smy = 1: smx = 0: xm = 0: ym = 0: nx = 0: ny = 0: a = X * 8 + 72: b = Y * 8 + 44 sp = 1: sr = 25: rg = sr: cs = 0: rc = 0: raf = 0: rst = 0: rdn = 0 mst = 0 copypage 2, cpage setvispage cpage fadetopal newpal(), fadepal() loadsprite pic(), vlad, 4, 16, 17, 3: smy = 1 setkeys 570 setwait tmr(), ticks: copypage 2, dpage: setkeys SWAP exd, eyd: eyd = -eyd IF keyval(1) > 1 THEN fadeto fadepal(), 0, 0, 0: GOTO 1999 IF keyval(29) > 0 THEN GOSUB 1940 IF keyval(74) > 1 THEN IF ticks < 200 THEN ticks = ticks + 10 IF keyval(78) > 1 THEN IF ticks > 30 THEN ticks = ticks - 10 IF keyval(25) > 1 THEN GOSUB 1920 nx = 0: ny = 0 IF keyval(UP) > 0 THEN nx = 0: ny = -1: smx = nx: smy = ny IF keyval(RIGHT) > 0 THEN nx = 1: ny = 0: smx = nx: smy = ny IF keyval(LEFT) > 0 THEN nx = -1: ny = 0: smx = nx: smy = ny IF keyval(DOWN) > 0 THEN nx = 0: ny = 1: smx = nx: smy = ny IF keyval(shoot) > 1 THEN IF rg > sr THEN playsnd 2 + whvc, 145 - sp * 10: cs = sp: XS = CINT((a - 72) / 8): YS = CINT((b - 44) / 8): mx = xd * dir: my = yd * dir: rg = 0: trn = 0 ELSE trn = 1 IF cs = 0 THEN rg = rg + 1: IF rg = sr THEN playsnd 1 + whvc, 131 IF a / 8 = INT(a / 8) AND (b - 4) / 8 = INT((b - 4) / 8) THEN bspd = tspd: X = (a - 72) / 8: Y = (b - 44) / 8: xm = nx: ym = ny: xd = smx: yd = smy: GOSUB 1960 IF X = 20 AND xm = 1 THEN xm = 0: nx = 0 ELSE IF Y = 12 AND ym = 1 THEN ym = 0: ny = 0 IF map(X + xm, Y + ym) = 4 AND rc = 0 THEN rca = (X + xm - 1) * 16: rcb = (Y + ym) * 16 - 9: rc = 1: rcxm = xm: rcym = ym IF map(X + xm, Y + ym) = 4 THEN xm = 0: ym = 0: nx = 0: ny = 0 IF map(X + xm, Y + ym) = 14 OR map(X + xm, Y + ym) = 12 THEN xm = 0: ym = 0 IF map(X, Y) = 0 THEN GOTO 640 IF map(X, Y) = 1 THEN map(X, Y) = 0: scr& = scr& + 1 IF map(X, Y) = 3 THEN map(X, Y) = 0: scr& = scr& + 10: ct = ct - 1: playsnd 8 + whvc, 131: IF ct = 0 THEN GOTO 1010 ELSE DC = 1 IF map(X, Y) = 5 THEN map(X, Y) = 0: scr& = scr& + 20: es = 1: sp = sp + 1: playsnd 9 + whvc, 131: IF sp > 3 THEN sp = 3: sr = sr - 1: IF sr < 10 THEN sr = 10 IF map(X, Y) = 11 THEN IF st = 30 THEN map(X, Y) = 0: Xwb = X: Ywb = Y: GOSUB 1970: st = 0: scr& = scr& + 5: ELSE st = st + 1: xw = X: yw = Y: a = (X - 1) * 16: b = (Y - 1) * 16 + 7: IF st = 1 THEN playsnd 10 + whvc, 131 IF map(X, Y) = 13 THEN scr& = scr& + 50: sp = 2: sr = 0: map(X, Y) = 0: playsnd 9 + whvc, 131 IF map(X, Y) = 15 THEN scr& = scr& + 25: lives = lives + 1: map(X, Y) = 0: msn = 0: mst = 25: playsnd 12 + whvc, 131 640 IF shdw = 1 AND (xm <> 0 OR ym <> 0) THEN textcolor 3, 0: printstr "&", a - 1, b, dpage a = a + xm * bspd: b = b + ym * bspd IF a < 80 THEN a = 80: ym = 0: xm = 0: nx = xm: ny = ym IF a > 232 THEN a = 232: ym = 0: xm = 0 IF b > 140 THEN b = 140: ym = 0: xm = 0 IF b < 52 THEN b = 52: ym = 0: xm = 0: nx = xm: ny = ym IF invis = 0 THEN textcolor 12, 0: printstr "&", a - 1, b, dpage textcolor 240, 0: printstr CHR$(15), a, b, 2 IF rc = 0 THEN GOTO 700 IF rc = 1 THEN rcx = rca / 16 + 1: rcy = (rcb + 9) / 16 q = map(rcx + rcxm, rcy + rcym) IF q > 10 OR (q > 0 AND q < 6) THEN rc = 0: GOTO 700 GOSUB 1850: rc = 2 rca = rca + rcxm * 8: rcb = rcb + rcym * 8 ELSE rca = rca + rcxm * 8: rcb = rcb + rcym * 8 rcx = rca / 16 + 1: rcy = (rcb + 9) / 16 GOSUB 1855: rc = 1 IF rcm = 0 THEN rc = 0 END IF drawsprite cabag(), bobpal(), 144 + vladp, rca, rcb, dpage 700 IF shield = 1 AND cs < 1 AND rg > sr THEN cs = -1: mx = exd: my = eyd: XS = CINT((a + 16) / 16): YS = CINT((b + 9) / 16) IF cs = 0 THEN GOTO 820 XS = XS + mx: YS = YS + my IF trn = 1 AND sp = 3 THEN XS = XS - mx: YS = YS - my: trn = 0: SWAP mx, my: bf = INT(RND(1) * 2) * 2 - 1: mx = mx * bf: my = my * bf: IF map(XS + mx, YS + my) <> 0 THEN mx = -mx: my = -my: IF map(XS + mx, YS + my) <> 0 THEN SWAP mx, my: mx = bf _ * mx: my = bf * my IF XS < 1 OR XS > 20 OR YS < 1 OR YS > 12 THEN cs = 0: GOTO 820 IF map(XS, YS) = 1 THEN cs = 0: IF sp > 1 THEN map(XS, YS) = 0: GOSUB 1990 IF map(XS, YS) = 15 THEN cs = 0: rg = sr: GOSUB 1860 IF map(XS, YS) = 4 THEN cs = 0: IF sp > 1 THEN map(XS, YS) = 0: scr& = scr& + 2: GOSUB 1990 IF map(XS, YS) = 3 OR map(XS, YS) = 5 OR map(XS, YS) = 14 THEN cs = 0 IF map(XS, YS) = 11 THEN cs = 0: map(XS, YS) = 0: Xwb = XS: Ywb = YS: GOSUB 1970: IF vlad > 0 THEN playsnd 5 + whvc, 131 IF map(XS, YS) = 13 THEN mx = mx * -1: my = my * -1 textcolor 7, 0: printstr CHR$(sp), XS * 8 + 72, YS * 8 + 44, dpage 820 FOR i = 1 TO pl IF pl(i) = 0 THEN IF rp(i) = 30 THEN pl(i) = 1: xp(i) = PX(i): yp(i) = PY(i): ap(i) = (xp(i) - 1) * 16: bp(i) = (yp(i) - 1) * 16 + 7: pxm(i) = 0: pym(i) = 0 ELSE rp(i) = rp(i) + 1: GOTO 910 IF ABS(ap(i) - a) < 17 AND ABS(bp(i) - b) < 17 AND rp(i) = 30 THEN GOTO 910 ELSE rp(i) = 0 IF map(xp(i), yp(i)) = 4 THEN plpdd(i) = 8: ppic(i) = 0: playsnd 3 + whvc, 131: scr& = scr& + 4 IF map(xp(i), yp(i)) = 11 THEN xw = xp(i): yw = yp(i): GOTO 890 q = map(xp(i) + pxm(i), yp(i) + pym(i)): IF q = 1 OR (q > 2 AND q < 6) OR q > 12 THEN GOTO 890 ap(i) = ap(i) + 2 * pxm(i): bp(i) = bp(i) + 2 * pym(i) 890 IF ap(i) / 16 = INT(ap(i) / 16) AND (bp(i) + 9) / 16 = INT((bp(i) + 9) / 16) THEN xp(i) = (ap(i) + 16) / 16: yp(i) = (bp(i) + 9) / 16 ELSE GOTO 900 DB1 = X - xp(i): DB2 = Y - yp(i): IF DB1 = 0 AND DB2 = 0 THEN GOTO 1950 ELSE IF ABS(DB1) > ABS(DB2) THEN pxm(i) = SGN(DB1): pym(i) = 0 ELSE pym(i) = SGN(DB2): pxm(i) = 0 900 IF (ap(i) + 16) / 16 - .51 < XS AND (ap(i) + 16) / 16 + .51 > XS AND (bp(i) + 9) / 16 + .51 > YS AND (bp(i) + 9) / 16 - .51 < YS AND cs <> 0 THEN plpdd(i) = 8: ppic(i) = 1: scr& = scr& + 2: playsnd 3 + whvc, 131: IF sp <> 2 THEN cs = 0: rg = 0 IF ABS(ap(i) - a) < 13 AND ABS(bp(i) - b) < 13 AND plpdd(i) = 0 THEN GOTO 1950 IF ABS(ap(i) - awb) < 5 AND ABS(bp(i) - bwb) < 5 AND bw = 1 THEN pl(i) = 0: rp(i) = 0: playsnd 3 + whvc, 131 IF rc > 0 AND ABS(ap(i) - rca) < 16 AND ABS(bp(i) - rcb) < 16 THEN plpdd(i) = 8: ppic(i) = 0: scr& = scr& + 4: playsnd 3 + whvc, 131 IF ppic(i) = 0 THEN ppic(i) = 1 ELSE ppic(i) = 0 IF pym(i) = -1 THEN loadsprite plip(), vlad, 16 + ppic(i) + plpdd(i), 16, 17, 3 IF pxm(i) = -1 THEN loadsprite plip(), vlad, 18 + ppic(i) + plpdd(i), 16, 17, 3 IF pym(i) = 1 THEN loadsprite plip(), vlad, 20 + ppic(i) + plpdd(i), 16, 17, 3 IF pxm(i) = 1 THEN loadsprite plip(), vlad, 22 + ppic(i) + plpdd(i), 16, 17, 3 IF plpdd(i) > 0 AND ppic(i) = 1 THEN pl(i) = 0: rp(i) = 0: plpdd(i) = 0 drawsprite plip(), bobpal(), 16 + vladp, ap(i), bp(i), dpage 910 NEXT i IF sh = 0 THEN GOTO 970 IF sn = 0 THEN IF rsh = 30 THEN sn = 1: shx = SX: shy = SY: ash = (shx - 1) * 16: bsh = (shy - 1) * 16 + 7 ELSE rsh = rsh + 1: GOTO 970 IF ABS(ash - a) < 17 AND ABS(bsh - b) < 17 AND rsh = 30 THEN GOTO 970 ELSE rsh = 0 IF shxm = 0 AND shym = 0 THEN DB1 = X - shx: DB2 = Y - shy: IF ABS(DB1) > ABS(DB2) THEN shxm = SGN(DB1): shym = 0 ELSE shym = SGN(DB2): shxm = 0 IF ash / 16 = INT(ash / 16) AND (bsh + 9) / 16 = INT((bsh + 9) / 16) THEN shx = (ash + 16) / 16: shy = (bsh + 9) / 16 ELSE GOTO 955 bf = shx + shxm: b2 = shy + shym: IF map(bf, b2) <> 1 AND (map(bf, b2) < 4 OR map(bf, b2) > 5) THEN shxm = (INT(RND(1) * 2) * 2 - 1) * (INT(RND(1) * 2) - 1): IF shxm = 0 THEN shym = INT(RND(1) * 2) * 2 - 1 ELSE shym = 0 DB1 = X - shx: DB2 = Y - shy: IF ABS(DB1) + ABS(DB2) < 3 THEN IF ABS(DB1) > ABS(DB2) THEN shxm = DB1: shym = 0 ELSE shym = DB2: shxm = 0 bf = shx + shxm: b2 = shy + shym: IF map(bf, b2) > 1 AND (map(bf, b2) < 4 OR map(bf, b2) > 5) THEN shxm = 0: shym = 0: GOTO 960 955 bf = shx + shxm: b2 = shy + shym: IF bf < 1 OR bf > 20 OR b2 < 1 OR b2 > 12 THEN shxm = 0: shym = 0 ELSE ash = ash + shxm * 2: bsh = bsh + shym * 2 960 IF map(shx, shy) = 11 THEN Xwb = shx: Ywb = shy: GOSUB 1970 IF map(shx, shy) = 3 THEN ct = ct - 1: IF ct = 0 THEN GOTO 1010 map(shx, shy) = 0: GOSUB 1830 IF ABS(ash - a) < 9 AND ABS(bsh - b) < 9 AND shdd = 0 THEN GOTO 1950 IF (ash + 16) / 16 - .51 < XS AND (ash + 16) / 16 + .51 > XS AND (bsh + 9) / 16 + .51 > YS AND (bsh + 9) / 16 - .51 < YS AND cs <> 0 THEN shdd = 8: shp = 1: scr& = scr& + 4: playsnd 4 + whvc, 131: cs = 0: rg = 0 IF rc > 0 AND ABS(ash - rca) < 16 AND ABS(bsh - rcb) < 16 THEN rc = 0 IF shp = 0 THEN shp = 1 ELSE shp = 0 IF shym < 0 THEN loadsprite shark(), vlad, 48 + shp + shdd, 16, 17, 3 IF shxm < 0 THEN loadsprite shark(), vlad, 50 + shp + shdd, 16, 17, 3 IF shym > 0 THEN loadsprite shark(), vlad, 52 + shp + shdd, 16, 17, 3 IF shxm > 0 THEN loadsprite shark(), vlad, 54 + shp + shdd, 16, 17, 3 drawsprite digup(), bobpal(), 224 + vladp, ash, bsh, 2 IF shdd > 0 AND shp = 1 THEN sn = 0: rsh = 0: shdd = 0 drawsprite shark(), bobpal(), 48 + vladp, ash, bsh, dpage 970 IF cb = 0 THEN GOTO 981 FOR i = 1 TO cb IF bt(i) = 0 THEN IF rb(i) = 40 THEN bugdd(i) = 0: bt(i) = 1: cbr(i) = 2: cbx(i) = bx(i): cby(i) = bY(i): abug(i) = (cbx(i) - 1) * 16: bbug(i) = (cby(i) - 1) * 16 + 7 ELSE rb(i) = rb(i) + 1: GOTO 980 IF ABS(abug(i) - a) < 21 AND ABS(bbug(i) - b) < 21 AND rb(i) = 40 THEN GOTO 980 ELSE rb(i) = 0 IF cbxm(i) = 0 AND cbym(i) = 0 THEN DB1 = X - cbx(i): DB2 = Y - cby(i): IF ABS(DB1) > ABS(DB2) THEN cbxm(i) = SGN(DB1): cbym(i) = 0 ELSE cbym(i) = SGN(DB2): cbxm(i) = 0 IF map(cbx(i), cby(i)) = 11 THEN xw = cbx(i): yw = cby(i): abug(i) = (cbx(i) - 1) * 16: bbug(i) = (cby(i) - 1) * 16 + 7 IF abug(i) / 16 = INT(abug(i) / 16) AND (bbug(i) + 9) / 16 = INT((bbug(i) + 9) / 16) THEN cbx(i) = (abug(i) + 16) / 16: cby(i) = (bbug(i) + 9) / 16 ELSE GOTO 975 bf = cbx(i) + cbym(i): b2 = cby(i) + cbxm(i): IF map(bf, b2) = 0 OR map(bf, b2) = 4 THEN cbxm(i) = (INT(RND(1) * 2) * 2 - 1) * (INT(RND(1) * 2) - 1): IF cbxm(i) = 0 THEN cbym(i) = INT(RND(1) * 2) * 2 - 1 ELSE cbym(i) = 0 bf = cbx(i) - cbym(i): b2 = cby(i) - cbxm(i): IF map(bf, b2) = 0 OR map(bf, b2) = 4 THEN cbxm(i) = (INT(RND(1) * 2) * 2 - 1) * (INT(RND(1) * 2) - 1): IF cbxm(i) = 0 THEN cbym(i) = INT(RND(1) * 2) * 2 - 1 ELSE cbym(i) = 0 DB1 = X - cbx(i): DB2 = Y - cby(i): IF ABS(DB1) < 3 AND ABS(DB2) < 3 THEN cbr(i) = 4: IF ABS(DB1) > ABS(DB2) THEN cbxm(i) = SGN(DB1): cbym(i) = 0 ELSE cbym(i) = SGN(DB2): cbxm(i) = 0 bf = cbx(i) + cbxm(i): b2 = cby(i) + cbym(i): IF (map(bf, b2) > 0 AND map(bf, b2) <> 4 AND map(bf, b2) < 6) OR map(bf, b2) > 12 THEN cbr(i) = 2: cbxm(i) = 0: cbym(i) = 0 975 bf = cbx(i) + cbxm(i): b2 = cby(i) + cbym(i): IF bf < 1 OR bf > 20 OR b2 < 1 OR b2 > 12 THEN cbxm(i) = 0: cbym(i) = 0 ELSE abug(i) = abug(i) + cbxm(i) * cbr(i): bbug(i) = bbug(i) + cbym(i) * cbr(i) IF map(cbx(i), cby(i)) = 4 THEN map(cbx(i), cby(i)) = 0: cbr(i) = 4: abug(i) = (cbx(i) - 1) * 16: bbug(i) = (cby(i) - 1) * 16 + 7: bst(i) = 1: GOSUB 1840 IF (abug(i) + 16) / 16 - .51 < XS AND (abug(i) + 16) / 16 + .51 > XS AND (bbug(i) + 9) / 16 + .51 > YS AND (bbug(i) + 9) / 16 - .51 < YS AND cs <> 0 THEN bugdd(i) = 8: cbp(i) = 1: scr& = scr& + 3: playsnd 5 + whvc, 131: IF sp <> 2 THEN cs = 0: _ rg = 0 IF rc > 0 AND ABS(abug(i) - rca) < 16 AND ABS(bbug(i) - rcb) < 16 THEN bugdd(i) = 8: cbp(i) = 0: scr& = scr& + 5: playsnd 5 + whvc, 131 IF ABS(abug(i) - a) < 5 AND ABS(bbug(i) - b) < 5 AND bugdd(i) = 0 THEN GOTO 1950 IF ABS(abug(i) - awb) < 5 AND ABS(bbug(i) - bwb) < 5 AND bw = 1 THEN bt(i) = 0: playsnd 5 + whvc, 131 IF cbp(i) = 0 THEN cbp(i) = 1 ELSE cbp(i) = 0 loadsprite bug(), vlad, 36, 16, 17, 3 IF cbym(i) = -1 THEN loadsprite bug(), vlad, 32 + cbp(i) + bugdd(i), 16, 17, 3 IF cbxm(i) = -1 THEN loadsprite bug(), vlad, 34 + cbp(i) + bugdd(i), 16, 17, 3 IF cbym(i) = 1 THEN loadsprite bug(), vlad, 36 + cbp(i) + bugdd(i), 16, 17, 3 IF cbxm(i) = 1 THEN loadsprite bug(), vlad, 38 + cbp(i) + bugdd(i), 16, 17, 3 IF bugdd(i) > 0 AND cbp(i) = 1 THEN bugdd(i) = 0: bt(i) = 0: rb(i) = 0: drawsprite bug(), bobpal(), 32 + vladp, abug(i), bbug(i), dpage 980 NEXT i 981 IF rs = 0 THEN GOTO 990 IF rn = 0 THEN IF rr = 35 THEN rst = 8: rn = 1: rX = srx: rY = srY: ar = (rX - 1) * 16: br = (rY - 1) * 16 + 7: rr = 0 ELSE rr = rr + 1: GOTO 1000 IF rxm = 0 AND rym = 0 THEN DB1 = X - rX: DB2 = Y - rY: IF ABS(DB1) > ABS(DB2) THEN rxm = SGN(DB1): rym = 0 ELSE rym = SGN(DB2): rxm = 0 IF rst > 0 THEN rst = rst - 1: GOTO 986 ELSE rdd = 0: rcab = 0 IF raf > 0 THEN IF INT(RND(1) * 40) = 1 THEN raf = raf - 1: rst = 1 IF map(rX, rY) = 11 THEN IF str = 35 THEN map(rX, rY) = 0: Xwb = rX: Ywb = rY: ar = ar + rxm * 4: br = br + rym * 4: GOSUB 1970: str = 0 ELSE str = str + 1: xw = rX: yw = rY: ar = (rX - 1) * 16: br = (rY - 1) * 16 + 7 IF ar / 16 = INT(ar / 16) AND (br + 9) / 16 = INT((br + 9) / 16) THEN rX = (ar + 16) / 16: rY = (br + 9) / 16: GOSUB 1820 ELSE GOTO 985 bf = rX + rym: b2 = rY + rxm: IF map(bf, b2) = 0 OR map(bf, b2) = 3 THEN rxm = (INT(RND(1) * 2) * 2 - 1) * (INT(RND(1) * 2) - 1): IF rxm = 0 THEN rym = INT(RND(1) * 2) * 2 - 1 ELSE rym = 0 bf = rX - rym: b2 = rY - rxm: IF map(bf, b2) = 0 OR map(bf, b2) = 3 THEN rxm = (INT(RND(1) * 2) * 2 - 1) * (INT(RND(1) * 2) - 1): IF rxm = 0 THEN rym = INT(RND(1) * 2) * 2 - 1 ELSE rym = 0 DB1 = X - rX: DB2 = Y - rY: IF ABS(DB1) < 2 + raf AND ABS(DB2) < 2 + raf THEN IF ABS(DB1) > ABS(DB2) THEN rxm = SGN(DB1): rym = 0 ELSE rym = SGN(DB2): rxm = 0 bf = rX + rxm: b2 = rY + rym: IF map(bf, b2) = 4 OR (map(bf, b2) = 1 AND raf = 0) OR map(bf, b2) > 12 THEN rxm = (INT(RND(1) * 2) * 2 - 1) * (INT(RND(1) * 2) - 1): IF rxm = 0 THEN rym = INT(RND(1) * 2) * 2 - 1 ELSE rym = 0 bf = rX + rxm: b2 = rY + rym: IF map(bf, b2) = 4 OR map(bf, b2) > 12 THEN rxm = 0: rym = 0 985 bf = rX + rxm: b2 = rY + rym: IF bf < 1 OR bf > 20 OR b2 < 1 OR b2 > 12 THEN rxm = 0: rym = 0 ELSE ar = ar + rxm * 4: br = br + rym * 4 IF map(rX, rY) = 3 THEN raf = raf + 1: rst = rst + 3: ct = ct - 1: playsnd 8 + whvc - vlad / 80, 131: IF ct = 0 THEN GOTO 1010 ELSE map(rX, rY) = 0: scr& = scr& - 15 IF map(rX, rY) = 4 THEN raf = 11: rst = 8: rdd = 8: map(rX, rY) = 0: playsnd 6 + whvc, 131 IF map(rX, rY) = 1 THEN map(rX, rY) = 0 IF map(rX, rY) = 12 THEN raf = raf + 4: rdn = 2: GOSUB 1825 IF ABS(ar - a) < 9 AND ABS(br - b) < 9 THEN GOTO 1950 IF ABS(ar - awb) < 5 AND ABS(br - bwb) < 5 AND bw = 1 THEN rn = 0: raf = 0: rr = 0: str = 0: scr& = scr& + 8: playsnd 6 + whvc, 131: GOSUB 1825 IF (ar + 16) / 16 - .51 < XS AND (ar + 16) / 16 + .51 > XS AND (br + 9) / 16 + .51 > YS AND (br + 9) / 16 - .51 < YS AND cs <> 0 THEN raf = raf + 6: rst = 16: rdd = 8: scr& = scr& + 18: playsnd 6 + whvc, 131: IF sp <> 2 THEN cs = 0: rg = 0 IF rc > 0 AND ABS(ar - rca) < 16 AND ABS(br - rcb) < 16 THEN raf = 11: rst = 8: rdd = 8: rc = 0: rcab = 1: scr& = scr& + 20: playsnd 6 + whvc, 131 986 IF rp = 0 THEN rp = 1 ELSE rp = 0 IF rym = -1 THEN loadsprite shrew(), vlad, 64 + rp + rdd, 16, 17, 3 IF rxm = -1 THEN loadsprite shrew(), vlad, 66 + rp + rdd, 16, 17, 3 IF rym = 1 THEN loadsprite shrew(), vlad, 68 + rp + rdd, 16, 17, 3 IF rxm = 1 THEN loadsprite shrew(), vlad, 70 + rp + rdd, 16, 17, 3 IF rn = 1 THEN drawsprite digup(), bobpal(), 224 + vladp, ar, br, 2 drawsprite shrew(), bobpal(), 64 + vladp, ar, br, dpage IF rcab = 1 THEN drawsprite cabag(), bobpal(), 144 + vladp, ar, br - 6, dpage 990 IF bw = 0 THEN GOTO 1000 IF wn = 0 THEN wn = 1: wbx = swx: wby = swY: awb = (wbx - 1) * 16: bwb = (wby - 1) * 16 + 7 IF wbxm = 0 AND wbym = 0 THEN DB1 = X - wbx: DB2 = Y - wby: IF ABS(DB1) > ABS(DB2) THEN wbxm = SGN(DB1): wbym = 0 ELSE wbym = SGN(DB2): wbxm = 0 IF wst > 0 THEN wst = wst - 1: GOTO 996 ELSE sdd = 0 IF awb / 16 = INT(awb / 16) AND (bwb + 9) / 16 = INT((bwb + 9) / 16) THEN wbx = (awb + 16) / 16: wby = (bwb + 9) / 16 ELSE GOTO 995 IF INT(RND(1) * 10) = 1 THEN map(wbx, wby) = 11: GOSUB 1810 bf = wbx + wbym: b2 = wby + wbxm: IF map(bf, b2) = 0 OR (map(bf, b2) > 5 AND map(bf, b2) < 13) THEN wbxm = (INT(RND(1) * 2) * 2 - 1) * (INT(RND(1) * 2) - 1): IF wbxm = 0 THEN wbym = INT(RND(1) * 2) * 2 - 1 ELSE wbym = 0 bf = wbx - wbym: b2 = wby - wbxm: IF map(bf, b2) = 0 OR (map(bf, b2) > 5 AND map(bf, b2) < 13) THEN wbxm = (INT(RND(1) * 2) * 2 - 1) * (INT(RND(1) * 2) - 1): IF wbxm = 0 THEN wbym = INT(RND(1) * 2) * 2 - 1 ELSE wbym = 0 IF xw <> 0 THEN bws = 8: DB1 = xw - wbx: DB2 = yw - wby: IF SGN(DB1) <> wbxm AND SGN(DB2) <> wbym THEN IF ABS(DB1) > ABS(DB2) THEN wbxm = SGN(DB1): wbym = 0 ELSE wbym = SGN(DB2): wbxm = 0 IF xw = 0 THEN bws = 2 ELSE IF (INT(wbx) = xw OR wbx = xw - .0625) AND wby = yw THEN xw = 0: wst = 3: awb = (wbx - 1) * 16: bwb = (wby - 1) * 16 + 7: IF map(wbx, wby) <> 12 THEN map(wbx, wby) = 0: GOSUB 1805 bf = wbx + wbxm: b2 = wby + wbym: IF (map(bf, b2) > 0 AND map(bf, b2) < 6) OR map(bf, b2) > 12 THEN wbxm = (INT(RND(1) * 2) * 2 - 1) * (INT(RND(1) * 2) - 1): IF wbxm = 0 THEN wbym = INT(RND(1) * 2) * 2 - 1 ELSE wbym = 0 bf = wbx + wbxm: b2 = wby + wbym: IF (map(bf, b2) > 0 AND map(bf, b2) < 6) OR map(bf, b2) > 12 THEN wbxm = 0: wbym = 0 995 bf = wbx + wbxm: b2 = wby + wbym: IF bf < 1 OR bf > 20 OR b2 < 1 OR b2 > 12 THEN wbxm = 0: wbym = 0 ELSE awb = awb + wbxm * bws: bwb = bwb + wbym * bws IF ABS(awb - a) < 9 AND ABS(bwb - b) < 9 THEN GOTO 1950 IF (awb + 16) / 16 - .51 < XS AND (awb + 16) / 16 + .51 > XS AND (bwb + 9) / 16 + .51 > YS AND (bwb + 9) / 16 - .51 < YS AND cs <> 0 THEN playsnd 7 + whvc, 131: sdd = 8: wst = 16: IF sp <> 2 THEN cs = 0: rg = 0 996 IF wbp = 0 THEN wbp = 1 ELSE wbp = 0 IF wbym = -1 THEN loadsprite spid(), vlad, 80 + wbp + sdd, 16, 17, 3 IF wbxm = -1 THEN loadsprite spid(), vlad, 82 + wbp + sdd, 16, 17, 3 IF wbym = 1 THEN loadsprite spid(), vlad, 84 + wbp + sdd, 16, 17, 3 IF wbxm = 1 THEN loadsprite spid(), vlad, 86 + wbp + sdd, 16, 17, 3 drawsprite spid(), bobpal(), 80 + vladp, awb, bwb, dpage 1000 textcolor 15, 0: printstr STR$(scr&), 48, 0, dpage printstr STR$(lvl), 184, 0, dpage IF scr& >= nxlf& THEN playsnd 13 + whvc, 131: lives = lives + 1: nxlf& = nxlf& * 2: msn = 0: mst = 25 IF lives > 9 + lang THEN l = 9 + lang ELSE l = lives printstr CHR$(48 + l + lang * 185), 280, 0, dpage IF hat > 0 THEN drawsprite spm(), bobpal(), 192 + vladp, a, b - 12, dpage IF mst > 0 THEN textcolor 15, 9: printstr mess$(msn, lang), msz(msn, lang), 96, dpage: mst = mst - 1 setvispage dpage: SWAP cpage, dpage WHILE tmr(0) = 0: WEND: GOTO 570 1010 fadeto fadepal(), 0, 0, 0 lvl = lvl + 1 playsnd 18 + lvlb + whvc, 160 lvlb = lvlb + 1: IF lvlb > 5 THEN lvlb = 1 GOTO 223 1800 'draw level clearpage 2 FOR i = 12 TO 1 STEP -1: FOR j = 20 TO 1 STEP -1 k = j * 8 + 72: l = i * 8 + 44: m = map(j, i) IF m = 1 THEN textcolor 6, 0: printstr "*", k, l, 2 IF m = 0 OR m = 2 OR (m > 5 AND m < 13) THEN textcolor 240, 0: printstr "*", k, l, 2 IF m = 3 THEN textcolor 14, 6: printstr "$", k, l, 2 IF m = 4 OR m = 13 THEN textcolor 10, 6: printstr CHR$(15), k, l, 2 IF m = 5 THEN textcolor 7, 6: printstr "+", k, l, 22 IF m = 11 THEN textcolor 7, 0: printstr CHR$(14), k, l, 2 IF m = 12 THEN textcolor 7, 6: printstr CHR$(6), k, l, 2 IF m = 14 THEN textcolor 7, 0: printstr "*", k, l, 2 NEXT j: NEXT i textcolor 15, 0 printstr scln$(lang + vlad / 80), 0, 0, 2 RETURN 1805 'spider ate drawsprite dug(), bobpal(), 224 + vladp, (wbx - 1) * 16, (wby - 1) * 16 + 7, 2 RETURN 1810 'spider web drawsprite web(), bobpal(), 208 + vladp, (wbx - 1) * 16, (wby - 1) * 16 + 7, 2 RETURN 1820 'digging shrew IF rdn > 0 THEN drawsprite dug(), bobpal(), 224 + vladp, (rX - 1) * 16, (rY - 1) * 16 + 7, 2 ELSE rdn = rdn - 1 RETURN 1825 'dead shrew drawsprite ded(), bobpal(), 128 + vladp, (rX - 1) * 16, (rY - 1) * 16 + 7, 2 map(rX, rY) = 12 RETURN 1830 'digging shark drawsprite dug(), bobpal(), 224 + vladp, (shx - 1) * 16, (shy - 1) * 16 + 7, 2 RETURN 1840 'EATING BEETLE drawsprite dug(), bobpal(), 224 + vladp, (cbx(i) - 1) * 16, (cby(i) - 1) * 16 + 7, 2 RETURN 1850 'erase cabbage drawsprite dug(), bobpal(), 224 + vladp, (rcx - 1) * 16, rcy * 16 - 9, dpage drawsprite dug(), bobpal(), 224 + vladp, (rcx - 1) * 16, rcy * 16 - 9, 2 map(rcx, rcy) = 0 RETURN 1855 'draw new cabbage drawsprite cabag(), bobpal(), 144 + vladp, (rcx - 1) * 16, rcy * 16 - 9, 2 map(rcx, rcy) = 4 RETURN 1860 'SPAM APPEARS!!!!!!!!!!!!!!!! sa = (XS - 1) * 16 drawsprite spm(), bobpal(), 192 + vladp, sa, (YS - 1) * 16 + 7, 2 playsnd 11 + whvc, 131 RETURN 1900 'delay of 1 second t = TIMER + 1: WHILE t > TIMER: WEND RETURN 1910 'graphics change IF vlad > 0 THEN vlad = 0 ELSE vlad = 160 IF vladp > 0 THEN vladp = 0 ELSE vladp = 240 whvc = ((whvc / 23) XOR 1) * 23 1915 loadsprite ded(), vlad, 124, 16, 17, 3 loadsprite cabag(), vlad, 125, 16, 17, 3 loadsprite car(), vlad, 126, 16, 17, 3 loadsprite sun(), vlad, 127, 16, 17, 3 loadsprite spm(), vlad, 128, 16, 17, 3 loadsprite web(), vlad, 129, 16, 17, 3 loadsprite tore(), vlad, 130, 16, 17, 3 loadsprite dirt(), vlad, 131, 16, 17, 3 loadsprite digup(), vlad, 132, 16, 17, 3 loadsprite dug(), vlad, 133, 16, 17, 3 loadsprite con(), vlad, 134, 16, 17, 3 RETURN 1920 'pause fadeto fadepal(), INT(RND(1) * 64), INT(RND(1) * 64), INT(RND(1) * 64) lk = getkey fadetopal newpal(), fadepal() RETURN 1940 IF keyval(16) > 1 THEN scr& = scr& + 100: GOTO 1950 IF keyval(59) > 1 THEN IF hat > 0 THEN hat = 0 ELSE msn = 1: mst = 35: hat = 1: playsnd 12 + whvc, 131 IF keyval(60) > 1 THEN IF invis > 0 THEN invis = 0 ELSE msn = 2: mst = 35: invis = 1 IF keyval(61) > 1 THEN IF bobpic < 96 THEN msn = 3: mst = 35: bobpic = bobpic + 16 ELSE bobpic = 0 IF keyval(62) > 1 THEN msn = 4: mst = 35: SWAP LEFT, RIGHT: SWAP UP, DOWN IF keyval(63) > 1 THEN msn = 5: mst = 35: X = INT(RND(1) * 20) + 1: Y = INT(RND(1) * 12) + 1: a = (X - 1) * 16: b = (Y - 1) * 16 + 7 IF keyval(64) > 1 THEN msn = 6: mst = 30: lang = -(lang = 0): GOSUB 1800 IF keyval(65) > 1 THEN IF scr& < 2000000 THEN scr& = scr& + 2000000: nxlf& = nxlf& + 2000000: msn = 7: mst = 35 IF keyval(66) > 1 THEN IF rcm = 0 THEN rcm = 1: msn = 8: mst = 35 ELSE rcm = 0 IF keyval(67) > 1 THEN IF shdw = 0 THEN shdw = 1: msn = 9: mst = 25 ELSE shdw = 0 IF keyval(68) > 1 THEN IF vladp > 0 THEN vladp = 0: GOSUB 1800 ELSE vladp = 240: msn = 10: mst = 35: GOSUB 1800 IF keyval(56) < 1 THEN RETURN 'cheater codes IF keyval(41) > 1 THEN GOSUB 1910: GOSUB 1800 IF keyval(12) > 1 AND tspd > 1 THEN tspd = tspd / 2 IF keyval(13) > 1 AND tspd < 8 THEN tspd = tspd * 2 IF keyval(43) > 1 THEN GOTO 1010 IF keyval(15) > 1 THEN IF dir = SGN(dir) THEN dir = dir * 2 ELSE dir = dir / 2 IF keyval(14) > 1 THEN dir = dir * -1 IF keyval(2) > 1 THEN sp = 1: sr = 0: cs = 0 IF keyval(3) > 1 THEN sp = 2: sr = 0: cs = 0 IF keyval(4) > 1 THEN sp = 3: sr = 0: cs = 0 IF keyval(31) > 1 THEN IF shield > 0 THEN shield = 0 ELSE shield = 1: playsnd 9 + whvc, 131 RETURN 1950 'death shield = 0 playsnd 13 + dvc + whvc, 160 dvc = dvc + 1: IF dvc > 5 THEN dvc = 1 fadeto fadepal(), 63, 0, 0 copypage 2, dpage textcolor 7, 0: printstr CHR$(6), a, b, dpage setvispage dpage: SWAP cpage, dpage: setvispage cpage fadetopal newpal(), fadepal() fadeto fadepal(), 0, 0, 0 lives = lives - 1 IF lives > 0 THEN GOTO 223 GOTO 1999 1960 'clear the background textcolor 240, 0: printstr "*", X * 8 + 72, Y * 8 + 44, 2 RETURN 1970 'torn web drawsprite dug(), bobpal(), 224 + vladp, (Xwb - 1) * 16, (Ywb - 1) * 16 + 7, 2 drawsprite tore(), bobpal(), 208 + vladp, (Xwb - 1) * 16, (Ywb - 1) * 16 + 7, 2 RETURN 1990 textcolor 240, 0: printstr "*", XS * 8 + 72, YS * 8 + 44, 2 RETURN 'top lines DATA "Score: Level: Bobs:" DATA " ’­Œ‚: ΚΤ~Ι: Υ~Σ~:" DATA "Money: Stage: Vlads:" DATA " …œ: ΏΕ΄Ύ~: ΅~ΗδΖ~:" 'codes DATA "1-up!",140,"κόφ!",144 DATA "Wear a Hat!",116,"’~‚‹¬ … ~–!",116 DATA "Invisible",124,"€ƒ™‰“š ™–",120 DATA "Be an Enemy",112,"ΪΰΏΒ_š ™–",120 DATA "Reverse Directions",88,"’„…~‡ž €‘~‰‘~š Œ–",92 DATA "Teleport",128,"“~‰…‘ ‡",128 DATA "Ά΄Ό~’~",136,"Japanese",128 DATA "2 MILLION POINTS!",92,"λϊϋ Υ`΄ΰΔ!",120 DATA "Frictionless Cabbages!",72,"ΉαΤ~Ğ “£”™",112 DATA "Shadow Hamster",104,"€ƒ™‰“š ™–",120 DATA "Funny Colors",112,"˜˜™ ˜",128 'options DATA "Bob &","Vlad #","Hero" DATA "On","Off","Voices" DATA "English","Japanese","Language" DATA "Normal","Custom","Levels" DATA "- +","- +","Speed" 1999 regs.ax = &H2509: regs.ds = seg9: regs.dx = off9 CALL interruptx(&H21, regs, regs) CLOSE #1 closefile SCREEN 13: SCREEN 0: CLS : SYSTEM: 'quit routine