0]']}WuLm08d%qy)6o;]AsVl3???????????b x   `     cc c cc c ccc c cccc cc c cc c ccc c cccc cccccc cc ccc c c c c c c cc c cc c ccc c cccc################# # # # # # # ###################### # # # # # # # # # # ######### # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ###### # # # # #### # # # # # # # # # # #########d d d# # #$$$d Pt?"  """""  """ """""""""   " ""  " " ""  "" """ " """" """"" """" """"""  " "  "" """"    " "   " " """  """""  """" """"""" "" """"""""""""""""""""" """"""""""" """"""""""" """"""""""""""""""""""""""""B$""""""""""""DDD$""""""""""""""""" ""BDDDDDDDD$" ""BDDDDD$" """"DDDDDDDDDDD" "BDDDDDDDDD$" ""DDDDDDDD"""BDDDDDDDDDDDDD"" ADDDDDDDDDD"""2DDDDDDDD""""BDDDDDDDDDDDDD$" ADDDDDDDDDD" ""CDDDDDDDD$""ADDDDDDDDDDDDD$" ADDDDDDD""""DDDDDDDDDD$""!DDDDDDDDDDDDDD" ADDDDD!"""" "2DDDDDDDDDDD"""BDDDDDDDDDDDDD" ADDDDD""""""""CDDDDDDBDDDD""BDDDDD""33"BDDDDDDDDDD"" "2DDDDDD$!DDDD"" """"""""B"""30D"DDDDDDDDDDD$"""BDDDDDD"DDDD$"""""BDDDD""""""0$ "DDDDDDDDDDD$"""DDDDDD$"DDDD$" ""BDDDDDD"""""#@ #"DDDDDDDDDDD$""BDDDDDD""DDDD$" !DDDDDD""""3C4CD"DDDDDDDD"""DDDDDDDD""DDDDD" "DDDDDD$"3D"30D0"DDDDDD""""""DDDDDDDDDDDDDDD"""DDDDDD$"C$333#04"DDDDDD""""D$"DDDDDDDDDDDDDDD$""BDDDDD$"C203004"DDDDDDDDDDD$"DDDDDDDDDDDDDDD$""ADDDDD$"f02 3#30D"DDDDDDDDDDDD"DDDDD!DDDDDDD$" !DDDDD""f2 30C"BDDDDDDDDDDD"DDDD$""!DDDD$" "DDDDD"`f 3C"ADDDDDDDDDDD$BDD$""""""BDDD$""BDDDD"`f0C4 !DDDDD!""!"""""""$""AD!""3#ff 3C4 """"""""""""""""""""""""" !""""0CDff 3C4""""""""""""""""""""""""" """"""0CD4`f`CD """"""""""" """ """""""""" 03DD `f`CD"""""" ""233CD40fCD"323D4#"CD2423 33D3f0#CD4 "" CD03" 3DDf04CD4"""""""" """""""""""0DD3#2CD4304CD4"""""""""" """""""""" """""""""""2D43203DD4D$""""""DD"""" """"""""" """""""""" """""""@D0D420#" 3CD#0$ @04D""""BDDDDDD$" """"DDD$""""""""" """B$"""BDDDD"#BD#002" 3C40#C004$""BDDDDDDDDD"" """DDDDDDD""" ""BD$"""DDD$"""BDDDDD""C4D3 32" 3D#3DC3D""DDDDDDDDDDD$""""DDDDDDDDD""""BDD$""DDDD"""ADDDDD$"03240##2C4CD3$""DDDDDDDDDDD$" ""DDDDDDDDDDD""ADDD" """"DDDD""BDDDDD$""C033" 3DD#00DC$"ADDDDDDDDDDDD"""DDDDDDDDDDDD$"ADDD"""""""DDDD$"DDDDDDD"B02CD4C4C""BDDDDDDDDDDDD""""DDDDDDDDDDDDD$ADDD$""""""!DDDD""DDDDDDD"0D20D4$""DDDDDDDBDDDD$""ADDDDDDDDDDDDD$!DDD$""DD$"ADDDD""DDDDDDD"@ 343CDC$"ADDDDDD$!D!"""BDDDDD!DDDDDDD"DDD$BDDDD"ADDDD$"DDDDDD$"2CDD4D$"ADDDDDD"""""""""DDDDD$"BDDDDD"DDDDDDDDD$BDDDD$"BDDDDD$" 3CDDD$"!DDDDD$"""""""""ADDDDD"""!DDDDD"BDDDDDDDDDDDDDD""ADDDDD""23DDD$"DDDDD"""""""""BDDDD$""""DDDDD"ADDDDDDDDDDDDDD""!DDDDD" 3CCDD"BDDDD""""""B$"ADDDD"""""!DDDD$"ADDDDDDDDDDDDDD"""DDDDD"234DD""ADDDD$"""DDDD"ADDDD"""""ADDDD$"!DDDDDDDDDDDDD$""BDD"" 33DD$"!DDDDD$""DDDD"!DDDD""""BDDDD"""DDDDDDDDDDDDD$" "!D"""23CD$"DDDDDDDDDDDD$"DDDDD""""DDDDD""BDDDDD$DDDDDD$""""""DD" 33C4"BDDDDDDDDDDD$"BDDDDDDDDDDDD$""ADDDDDDDDDDD""""DDDDD"""333""ADDDDDDDDDDD""!DDDDDDDDDDDD$" !DDDD$BDDDDD"""BDDDDD$""3# "!DDDDDDDDDD""""BDDDDDDDDDDD"" "DDD!"ADDDDD""!DDDDD$" "BDDDDDDD""""!DDDDDDDDD""""""!DDD""""DDDDDD"""BDDDD!""" "BD!"""""""""""#""""CD#"" """""""""""""""""" """"""""""""""#""""""""""""""" """""""""""""""" """""" """"""" """""""""""""""""""""""""""" """"" "" "" `ff fof fof ff fof fof off ,0]']}WuLm08d%qy)6o;]AsVl30 then music(0) tik=0 TIC=Game else tik=0 TIC=GameOver end end function TIC() attract_init() --title_init() --game_init() end function Game() tik=tik+1 if tik%120==0 then spawn(math.random(1,2)) end cls() rect(0,16,240,80,8) map(0,0,30,17,0,0,7) alexas_up() robots_up() drones_up() explodes_up() if not dead then fred_up() else fred_shoc() end hud() end function GameOver() tik=tik+1 if tik==1 then music(1,-1,-1,false) end cls() rect(56,32,120,48,1) map(30,1,15,6,56,32,7) text("YABADA..",10,11,12) if tik>60 and lives==0 then text("GAME OVER",10,13,2) end if tik>60 and lives>0 then text("LOSE ONE LIVE!",7,13,3) end if tik>360 and lives>0 then game_init() end if tik>360 and lives==0 then title_init() end hud() end function Title() tik=tik+1 if tik>360 then attract_init() end cls() if tik>0 and tik<60 then spr(112,8,16,7,1,0,0,7,6) spr(384,52,24,0,1,0,0,16,4) end if tik>=60 then spr(119,8,16,7,1,0,0,7,6) text("@2022 LOSTCADESOFT\n BY BGELAIS",6,13,9) spr(384,52,24,0,1,0,0,16,8) end hud() Pstart() end function Attract() tik=tik+1 if tik>360 then title_init() end c=tik/8%15+1 cls() map(0,17,30,16,0,0,7) text("-1 UP",21,8,c) text("50",8,8,c) text("100",11,8,c) text("80",11,4,c) text("DEFEND YOUR HOUSE AGAINST\nABUSIVE WELMA'S BOUGHS\n OF ALEXA AI UNITS!",2,10,12) text("BEWARE ELECTRIC CONTACT\nWITH DELIVERY ROBOTS!",4,14,4) hud() Pstart() end function Start() tik=tik+1 if tik==1 then sfx(5) end if tik>180 then game_init() end cls() map(32,7,17,9,48,24,7) text("- CONTROLS -",9,4,12) text("PLAYER START",9,14,tik/2%15) hud() end function fred_up() if btn(2) and not fred.punch then fred.x=fred.x-2 fred.flp=1 fred.t=fred.t+1 elseif btn(3) and not fred.punch then fred.x=fred.x+2 fred.flp=0 fred.t=fred.t+1 end if btnp(4) and not fred.punch then sfx(0) fred.t=0 fred.punch=true end fred.x=math.min(fred.x,200) fred.x=math.max(fred.x,48) if fred.punch then fred.t=fred.t+1 fred.frame=math.floor(fred.t/16) spr(112+7*(fred.frame%2),fred.x-28,fred.y-40,7,1,fred.flp,0,7,6) spr(226+2*(fred.frame%2),fred.x,fred.y-48,7,1,0,0,2,2) if math.floor(fred.t/16)>1 then fred.punch=false end else fred.frame=math.floor(fred.t/8) spr(fred.s+4*(fred.frame%2),fred.x-16,fred.y-32,7,1,fred.flp,0,4,5) end end function fred_shoc() tik=tik+1 if tik==1 then music(-1) sfx(2) end if tik>120 then lives=lives-1 game_init() end poke4 (0x3ff0*2+12,tik/2%16) spr(42,fred.x-16,fred.y-32,7,1,fred.flp,0,4,5) poke4 (0x3ff0*2+12,12) end function spawn(type) if type==1 then t=robots o={x=-16+240*math.random(0,1),y=123,xd=0,yd=0,gotalexa=false} if o.x<0 then o.xd=1 else o.xd=-1 end elseif type==2 then t=drones o={x=-16+240*math.random(0,1), y=16+math.random(80), xd=0,yd=0,gotalexa=false} if #alexas<=1 then o.gotalexa=true end if o.x<0 then o.xd=1 else o.xd=-1 end end table.insert(t,o) end putAlexa=function(_x,_y) table.insert(alexas,{x=_x,y=_y}) end function alexas_up() for id,o in pairs(alexas) do spr(104,o.x,110,7,1,tik/10%2) end end function robots_up() for id,o in pairs(robots) do o.x=o.x+o.xd o.y=o.y+o.yd o.y=math.max(108,o.y) if hit_fred(o) and not dead and not o.gotalexa then o.xd=0 tik=0 dead=true end if o.x<-16 or o.x>256 then table.remove(robots,id) end if get_alexa(o) then o.gotalexa=true end if fred_hit(o) and not o.gotalexa then explode_in(o.x,o.y-16) score=score+50 table.remove(robots,id) end spr(40,o.x-8,o.y-32,7,1,0,0,2,4) if o.gotalexa then spr(105,o.x-4,o.y-16,7,1,tik/10%2) o.yd=-.5 if o.x<120 then o.xd=.5 else o.xd=-.5 end if math.floor(o.y)==96 then o.yd=0 end if math.abs(120-o.x)<4 and o.y==108 then lives=lives-1 tik=0 TIC=GameOver end end end end function get_alexa(ob) for id,alexa in pairs(alexas) do if math.abs(ob.x-alexa.x)<8 then ob.gotalexa=true table.remove(alexas,id) end end end function drones_up() for id,o in pairs(drones) do o.x=o.x+o.xd o.y=o.y+o.yd if math.abs(o.x-fred.x)<8 and o.gotalexa then o.xd=0 o.yd=.5 end if o.x<-16 or o.x>256 then table.remove(drones,id) end if o.y>=120 and o.yd>0 then putAlexa(o.x,o.y) o.yd=-1 o.gotalexa=false end if o.y<0 and o.yd<0 then table.remove(drones,id) end if fred_hit(o) then explode_in(o.x,o.y-16) score=score+80 table.remove(drones,id) elseif fred_hit(o) and o.gotalexa then explode_in(o.x,o.y-16) score=score+100 table.remove(drones,id) end spr(210+2*math.floor(tik/2%2),o.x-8,o.y-8,7,1,0,0,2,1) if o.gotalexa then spr(105,o.x-4,o.y,7,1,tik/10%2) end end end function explode(_x,_y) for i=1,4 do xr=_x+math.random(-8,8) yr=_y+math.random(-8,0) r=math.random(4) spr(158,xr,yr,7,1,r,0,2,2) xr=_x+math.random(-8,8) yr=_y+math.random(-24,0) r=math.random(1,4) spr(126,xr,yr,7,1,r,0,2,2) end end function explodes_up() for id,o in pairs(xplods) do o.t=o.t-1 if o.t>0 then explode(o.x,o.y) else table.remove(xplods,id) end end end function explode_in(_x,_y) sfx(1,30,-1,1) table.insert(xplods,{x=_x,y=_y,t=30}) end function hit_fred(ob) if math.abs(fred.x-ob.x)<16 and ob.y>=fred.y-40 then return true end end function fred_hit(ob) if math.abs(ob.x-fred.x)<32 and ob.y>=fred.y-40 and fred.punch and fred.frame>=1 then if (ob.xfred.x+16 and fred.flp==0) then return true end end end function Pstart() if time()%1000<=500 then text("a TO START",10,16,12) end if btnp(4) then score=0 lives=3 start_init() end end function text(str,x,y,c) poke4 (0x3ff0*2+12,c) font(str,x*8,(y*8),0,8,8,true,1) poke4 (0x3ff0*2+12,12) end function hud() rect(0,0,240,16,0) if TIC==Game then text("SCORE",0,0,2) text(string.sub("000000"..tonumber(score),-6),0,1,12) spr(32,186,-4,7,1,0,0,4,2) text("* "..lives,27,0,12) end text("HIGH SCORE",10,0,2) if score>pmem(0) then pmem(0,score) end text(string.sub("000000"..tonumber(pmem(0)),-6),12,1,12) end