ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff̙ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff""""""""""""""""""""""""""""""""̙""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ̙̜̜̜""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""`fff`fff`fff """ """ """ffffffffffff""""""""""""fffffffff"""""""""  """ """ """ """ """ """ """ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" ̪    `fff`fff`fff """ """ """fffffffff"""""""""  ̙̜̜        eeePVVVpxxx 3"3 3"3"3"eeeeVVVVxxxx"3"3"3"33"3"eeeVVVxxx"3""3"3"3  #" "" pp ppppp"3" 3"3 3"3"3""3" 3"3 3"3"3"3"3""3"3"3"33"3"3"3""3"3"3"33"3"3"3"3""3"3"33"3"3""3"3"3 홙 L P 0C3       eeePVVVpxxx 3"3 3"3"3"eeeVVVxxx"3""3"3"3     00   ̙̜̌      \U,"\,""\"\!UU\UUUUUUUU  ! !" !/o4//"$ !2C"4# !B"  " PUUUUUUUUU UU\UU\UU\UU\UU\UUUUUUUUUUUUUUUUUUUUUUeffUflVflflfflfffeffUP%""U",,R",,""",,",,%""UPU^UP UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU\UU\UU\UU\UU\UU\UU\UU\UUUUUUUUUUUUUUUUUUUUUUUUUU̥UʪZ ̬ UP533U3>>>>>>>..;<..>>>>>>>>;<>>>>>;<......;<>>>>>;<>>>>>>>>........>>>>>>>>;<>>>>>>>>........>>>>>>>>;<::::::::''''::::::::''5 5 ::::::::''''::;<::'''';<::::::;<''''::::::::''''::::::::''''::::::::--::::::::--;5 55 ::::::::::''::''::::::''::::::::::::::::::::::::!!::::::::!!; :::::::::::..:::::::::::::::::::::::::::::::::::::::::::;::::::::::::::::::::::::::::::::::::::::::::::::::::::::; ::::::::::::::::::::::::::::::::::::::::::::::::::!!!!::; ::::::::::::::::::::::::::::::::::::::::::::::::::::::::; ::::::::::::::::::::::::::::::::::::::::::::::::::::::::; ::::::::::::::::::::::::::::::::::2222::::::::::!!!!::::::::!! 6666::::::::::::::::::::::::::::::::::::::::::::::::;<::::::::; ::::::::!!!!:======:!!!!----==::::==----!!!!:======:!!!!::::::::!!!!::::::::;<::::::::;::::::::;<:!!!!:;<!!!!::::!!!!;<:!!!!:;<::::::::;<::::::::;<::::::::; !!!!!! ::::::::;<:;<:;<;<::::;<;<:;<:;<::::::::;<::::::::;<----!::::::::!----;5 ----;<------;<---- 5 :::89:::;<--------=;<=--------;<----;<====;<----;<--------=;<=--------;<--------========--------;<--------========--------;>?????????????????+             9<>???????????????????????????8 ; <==>>>???????????????????689;<<==>>>??????????????????? """""""""$$$$$$$''''6                ttt t tt tt t t tt t t t ttӘttt t tt tt t t tt t t t ttt tt tttt tttt t tt                   p`P@0 =    pp pp pp ppt ttt tttt ttt t001A1A101A1 A1   @@@@@@@@? ppp L p p0C3 ppp ppppPppeeeeeeeeeeeeeee eeeeeeeeeeeeeeeVVVVVVVVVVVVVVV PVVVVVVVVVVVVVVVxxxxxxxxxxxxxxxpppxxxxxxxxxxxxxxxpp"3"3"3"3"3"3"3" p p 3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"pppp 3"3"3"3"3"3"3"33"3"3"3"3"3"3"3pppp"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3""3"3"3"3"3"3"3" eeeeee eeeeee 3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"PVVVVVV PVVVVVV 3"3"3"3"3"3"3"33"3"3"3"3"3"3"3pxxxxxxpppppppxxxxxx"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3 #"pp L p L p pp #""3"3"3"3"3"3"3""3"3"3"3"3"3"3" 3"3"3" "" p p p0C3 p0C3 p p "" 3"3"3" 3"3"3"3"3"3"3"3"3"3"3"3"3"3"3" 3"3"3" pppp pp pp pppp 3"3"3" 3"3"3"3"3"3"3"33"3"3"3"3"3"3"3"3"3"3 ppppPppPpppppp "3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3""3"3"3"3"3"3"3" 3"3"3" eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee 3"3"3" 3"3"3"3"3"3"3"3"3"3"3"3"3"3"3" 3"3"3"PVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV 3"3"3" 3"3"3"3"3"3"3"33"3"3"3"3"3"3"3"3"3"3pxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3""3"3"3"3"3"3"3" 3"3"3" 3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3" 3"3"3" 3"3"3"3"3"3"3"3"3"3"3"3"3"3"3" 3"3"3" 3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3" 3"3"3" 3"3"3"3"3"3"3"33"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3""3"3"3"3"3"3"3" 3"3"3" 3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3" 3"3"3" 3"3"3"3"3"3"3"3"3"3"3"3"3"3"3" 3"3"3" 3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3" 3"3"3" 3"3"3"3"3"3"3"33"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3""3"3"3"3"3"3"3" 3"3"3" 3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3" 3"3"3" 3"3"3"3"3"3"3"3"3"3"3"3"3"3"3" 3"3"3" 3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3" 3"3"3" 3"3"3"3"3"3"3"33"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"3"X-- title: Searching for Pixel -- author: MFauzan -- desc: Devindo Game Jam 2 -- script: lua -- saveid: devindo2 --pmem(0,1)pmem(1,3)pmem(2,52*8)pmem(3,115*8) local str=tostring local remove=table.remove local flr=math.floor local rnd=math.random local rad=math.rad local sin=math.sin local cos=math.cos local sqrt=math.sqrt local t=0 shake=0 local cam={--camera mx=0,my=0, x=0,y=0, a=1, ll=0,lr=0,lu=0,ld=0, shake=false } local p={--player area=0, x=0,y=0, vx=0,vy=0,spd=0.7, sp=256,flip=0,offs=1, coyT=0,isCoy=false, health=3, tiInv=0,isInv=false, isOver=false, isPause=false, isDust=false, } local disMode=0 local colIndex={ {1,2,3,4},--merah {8,9,10,11},--biru {15,14,13,12},--putih {0,7,6,5},--hijau } --thnaks vadim local glitch=0 local d=4 function scanline(row) if glitch>0 then poke(0x3FF9,math.random(-d,d)) end end local function effGlitch() if glitch>0 then --poke(0x3FF9+1,math.random(-d,d)) glitch=glitch-1 if glitch==0 then memset(0x3FF9,0,2) end end end local function camShake() if cam.shake then local f=2 if shake>0 then poke(0x3FF9,rnd(-f,f))poke(0x3FF9+1,rnd(-f,f)) shake=shake-1 if shake==0 then memset(0x3FF9,0,2)cam.shake=false end end end end local function pal(c0,c1) if(c0==nil and c1==nil)then for i=0,15 do poke4(0x3FF0*2+i,i)end else poke4(0x3FF0*2+c0,c1)end end local dialText={ "good job! let's find another graphic cards!", "great! I've also added a shooting feature", "AWESOME! the graphics are already perfect!", "use [arrow] to move and [Z] to jump" } local dialText2={ "","use [X] key to shoot", "Now you can also jump in mid air" } local dial={} local function dialog(mtxt,mtxt2) local d={ x=0,y=48, w=240,h=48, text=mtxt,text2=mtxt2, act=false, }dial[#dial+1]=d end local function drawDialog() for i,d in pairs(dial)do p.isPause=true rect(d.x,d.y,d.w,d.h,14) local txtLength=print(d.text,0,-16,0,false,1,true) local txtLength2=print(d.text2,0,-16,0,false,1,true) print(d.text,120-txtLength/2,60,12,false,1,true) print(d.text2,120-txtLength2/2,68,5,false,1,true) spr(221,220,84,5) if btnp(4)then p.isPause=false remove(dial,i)end end end local cir={} local function fade(mrad,mz) local f={ x=0,y=0, z=mz,rad=mrad, min=-10,max=32, toScene=scn } cir[#cir+1]=f end local function drawFade() for i,f in pairs(cir) do f.rad=f.rad+f.z for x=0,240,30 do for y=0,136,17 do circ(x,y,f.rad,0) end end if f.radf.max then remove(cir,i)end end end local function tileSolid(x,y) return fget(mget(x//8,y//8),1) end local function tileSave(x,y) return fget(mget(x//8,y//8),6) end local function tileSpike(x,y) return fget(mget(x//8,y//8),7) end local function changeMap(i) for x=0,239 do for y=0,118 do mset(x,y,mget(x,y)+i) end end end local function newGame() pmem(0,0) p.x=280 p.y=624 fade(32,-1) dialog(dialText[4],"") end local isLoad=false local function loadGame() disMode=pmem(1) p.x=pmem(2)p.y=pmem(3) fade(32,-1) if disMode==1 then changeMap(64)end if disMode>=2 then changeMap(128)end end local isSave=false local function saveGame() p.health=3 pmem(0,1) pmem(1,disMode) pmem(2,flr(p.x))pmem(3,flr(p.y)) end local notif={y=-2,t=0,act=false} function notif:draw(text) local txt=print(text,0,-16) rect(0,notif.y-2,240,10,2) print(text,120-txt/2,notif.y,12) --animation if notif.act then notif.t=notif.t+1 if notif.t<55 then notif.y=notif.y+0.2 elseif notif.t>95 then notif.y=notif.y-0.2 if notif.y<-2 then notif.act=false end end end end -------- --effect local eGun={}--asap gun local function effGun(mx,my) local e={x=mx,y=my,t=0} eGun[#eGun+1]=e end local function drawEffGun() for i,e in pairs(eGun) do e.t=e.t+1 pix(e.x+cam.x,e.y+cam.y,12) if e.t==5 then remove(eGun,i)end end end local eSmoke={} local function effSmoke(mx,my) local e={ x=mx,y=my, vx=-(rnd(-2,2)/10),vy=-0.8, r=2,t=0 } eSmoke[#eSmoke+1]=e end local function drawEffSmoke() local c=cam for i,e in pairs(eSmoke) do e.t=e.t+1 if e.t%8==0 then e.r=e.r-1 end --draw circ(e.x+c.x,e.y+c.y,e.r,12+e.r%2) --move e.x=e.x+e.vx e.y=e.y+e.vy --hapus if e.t==40 then remove(eSmoke,i)end end end local dm={} local function effDam(mx,my,mdeg,mc) local e={ x=mx,y=my, deg=mdeg,spd=rnd(2,7)/10, t=0,r=3,col=mc } dm[#dm+1]=e end local function drawEffDam() local c=cam for i,e in pairs(dm) do e.t=e.t+1 if e.t%8==0 then e.r=e.r-1 end --draw circ(e.x+c.x,e.y+c.y,e.r,e.col-e.r%2) --move local dir=rad(e.deg) e.x=e.x+sin(dir)*e.spd e.y=e.y-cos(dir)*e.spd --delete if e.t==32 then remove(dm,i)end end end local eFly={} function effFly(mx,my) local e={x=mx,y=my,t=0} eFly[#eFly+1]=e end function drawEffFly() local c=cam for i,e in pairs(eFly) do e.t=e.t+1 pix(e.x+c.x,e.y+c.y,12) --delete if e.t==90 then remove(eFly,i) end end end local eup={} local function effUp(mc,mx,my) local e={x=mx,y=my,c=mc,r=16} eup[#eup+1]=e end local function drawEffUp() for i,e in pairs(eup) do e.r=e.r-1 circb(e.x+cam.x,e.y+cam.y,e.r,e.c) if e.r<0 then p.eup=false remove(eup,i)end end end local b={}--bullet local function bul(mx,my,mvx) local pel={x=mx,y=my,vx=mvx,t=0} b[#b+1]=pel end local function drawBul() for i,pel in pairs(b) do pel.x=pel.x+pel.vx*5 spr(280,pel.x+cam.x,pel.y+cam.y,5,1,(pel.vx==1 and 0 or 1)) --asap effGun(pel.x,pel.y+2) --hapus if tileSolid(pel.x+3,pel.y+2) or pel.xp.x+120 then remove(b,i) end end end local card={} local function grapCard(mx,my,mt) local e={x=mx*8,y=my*8,tipe=mt,tim=0} card[#card+1]=e end local function drawGrapCard() local c=cam local d=dialog for i,e in pairs(card) do --draw spr(193,e.x+c.x,e.y+c.y,12,1,0,0,2,2) --asap e.tim=e.tim+1 if e.tim==20 then effSmoke(e.x+8,e.y+4)e.tim=0 end --hapus if e.tipe~=disMode+1 or p.isOver then remove(card,i)end --interaksi if p.x+4>e.x+2 and p.x+4e.y+2 and p.y+8l and g.x+2u and g.y+2l and p.x+4u and p.y+8e.x-136 and p.x10 and bos.tAtt<40 then if bos.tAtt%10==0 then effUp(4,bos.x+16,bos.y+7)end end if bos.tAtt>40 then if bos.idAtt==0 then--peluru if bos.tAtt%60==0 then enemySpySh(bos.x+13,bos.y+5)end if bos.tAtt==60*5 then bos.tAtt=-120 end elseif bos.idAtt==1 then--big BALL if bos.tAtt==45 then enemyBalBig(bos.x+16,bos.y+7,-1,1)enemyBalBig(bos.x+16,bos.y+8,1,1)end if bos.tAtt==200 then enemyBalBig(bos.x+16,bos.y+7,-1,-1)enemyBalBig(bos.x+16,bos.y+8,1,-1)end if bos.tAtt==600 then bos.tAtt=-120 end elseif bos.idAtt==2 then--meteor if bos.tAtt%30==0 then enemyMeteor(rnd(1,28)*8,800)end if bos.tAtt==600 then bos.tAtt=-120 end end end --draw spr(448+t%50//25*2,bos.x+cam.x,bos.y+cam.y,11,1,0,0,2,4) spr(448+t%50//25*2,bos.x+16+cam.x,bos.y+cam.y,11,1,1,0,2,4) end --jika belum aktif else if p.x<120 and p.area==15 and not bos.isLife then bos.isLife=true end end end local spawner={} local function enemySpawn(mx,my,mt,mar) local e={ x=mx*8,y=my*8, t=mt,area=mar, init=false } spawner[#spawner+1]=e end local function drawEnemySpawn() for i,e in pairs(spawner) do --change init if e.area~=p.area then e.init=false end if not e.init and e.area==p.area then --spawn entities if e.t==0 then enemyShell(e.x,e.y,e.area) elseif e.t==1 then enemyFlyerSpawn(e.x,e.y,e.area) elseif e.t==2 then enemyWaller(e.x,e.y,e.area) elseif e.t==3 then enemySpy(e.x,e.y,e.area) end --- e.init=true end --delete if p.isOver then remove(spawner,i)end end end -------- local gun={ sp=264,t=0 } --gun function gun:draw() --nembak if btnp(5)and gun.t==0 then sfx(2,'C-5') bul(p.x+(6*p.offs),p.y+6,p.offs)gun.t=5 end --draw if gun.t>0 then gun.sp=265 gun.t=gun.t-1 else gun.sp=264 end spr(gun.sp,p.x+(4*p.offs)+cam.x-(p.anim*p.offs),p.y+6+cam.y,5,1,p.flip) end --player function p:body() if disMode>=2 then gun.draw()end spr((p.sp+disMode*2)+p.anim,p.x+cam.x,p.y+cam.y,5,1,p.flip,0,1,2) end function p:draw() --collision local u=p.y+p.vy+4 local d=p.y+p.vy+14 local l=p.x+p.vx+1 local r=p.x+p.vx+7 --controls if btn(2) and not tileSolid(l+1,u+1)and not tileSolid(l,d-1)and not p.isPause then p.vx=-1 p.offs=-1 p.flip=1 p.anim=t%20//10 elseif btn(3) and not tileSolid(r-1,u+1)and not tileSolid(r,d-1)and not p.isPause then p.vx=1 p.offs=1 p.flip=0 p.anim=t%20//10 else p.vx=0 p.anim=0 end --collision down if tileSolid(l+2,d) or tileSolid(r-2,d) then p.vy=0 if p.isDust then --effDust(l+2,d-3,p.offs*-1)effDust(l+2,d-3,p.offs) p.isDust=false p.isCoy=false end else p.isDust=true p.vy=p.vy+0.1 if not p.isCoy then p.coyT=13 p.isCoy=true end end --jump if (p.vy==0 or p.coyT>0)then if btnp(4)then sfx(1,'A-3') p.vy=-2.2 p.isCoy=true p.coyT=0 end else if btnp(4)and disMode==3 then sfx(1,'A-3')p.vy=-2 end end --collision up if p.vy<0 and (tileSolid(l+2,u) or tileSolid(r-2,u)) then p.vy=0 end --coyote jump time p.coyT=p.coyT-1 if p.coyT<0 then p.coyT=0 end --update movement if p.health>0 then p.x=p.x+p.vx*p.spd p.y=p.y+p.vy end --draw if p.isInv then p.tiInv=p.tiInv+1 if time()%200>100 then p.body()end if p.tiInv==60*1 then p.tiInv=0 p.isInv=false end else p.body()end --kena duri if not p.isInv and tileSpike(l+4,u+8)then enemySpike()end end local isDoor=false local aX={0,240,480,720,960,1200,1440,1680,1920} local aY={0,136,272,408,544,680,816,952} local function checkArea() local c=cam --main port if p.x>aX[2]and p.xaY[5]and p.yaX[7]and p.xaY[4]and p.yaX[2]and p.xaY[6]and p.yaX[3]and p.xaY[4]and p.yaX[2]and p.xaY[3]and p.yaX[3]and p.xaY[3]and p.yaX[1]and p.xaY[2]and p.yaX[2]and p.xaY[2]and p.yaX[8]and p.xaY[1]and p.yaX[1]and p.xaY[1]and p.yaX[6]and p.xaY[3]and p.yaX[8]and p.xaY[3]and p.yaX[2]and p.xaY[7]and p.yaX[1]and p.xaY[7]and p.yc.ll then c.x=c.ll end if c.xc.lu then c.y=c.lu end if c.y0 then isStart=true isLoad=true end end else if btnp(4)then sfx(4,'F-5')iszPress=true end if time()%1000<500 then print("PRESS TO START!",75,97,0) print("PRESS TO START!",74,96,12) spr(221,108,95,5) end end end rect(6,16+offsTitleY,230,52,0) --map(0,119,30,17,0,0,5) spr(224,62,24+offsTitleY,0,2,0,0,8,1) spr(240,68,44+offsTitleY,0,2,0,0,3,1) spr(243,116,44+offsTitleY,0,2,0,0,4,1) end local isInit=false local function init() music(0) grapCard(193,76,1)grapCard(134,44,2)grapCard(8,12,3) --grapCard(45,80,1)grapCard(47,80,2)grapCard(49,80,3) enemySpawn(90,76,0,1)enemySpawn(145,81,0,1)enemySpawn(114,60,0,3)enemySpawn(44,48,0,4)enemySpawn(163,95,0,6)enemySpawn(117,94,0,6)enemySpawn(78,95,0,6)enemySpawn(69,95,0,6)enemySpawn(14,92,0,7)enemySpawn(2,75,0,7)enemySpawn(27,75,0,7)enemySpawn(14,54,0,7)enemySpawn(43,27,0,9)enemySpawn(93,31,0,9)enemySpawn(210,30,0,9)enemySpawn(171,10,0,11)enemySpawn(143,10,0,11)enemySpawn(114,13,0,11)enemySpawn(47,14,0,11) enemySpawn(89,56.5,1,3)enemySpawn(44.5,37,1,4)enemySpawn(104.5,37,1,5)enemySpawn(14.5,47,1,7)enemySpawn(108.5,19.5,1,9)enemySpawn(224.5,94.5,1,13)enemySpawn(134.5,106.5,1,14) enemySpawn(48.5,95,2,6) enemySpawn(24.5,61.5,3,7)enemySpawn(4.5,61.5,3,7)enemySpawn(2.5,38.5,3,7)enemySpawn(26.5,38.5,3,7)enemySpawn(14.5,21.5,3,7)enemySpawn(58.5,19.5,3,9)enemySpawn(68.5,19.5,3,9)enemySpawn(88.5,19.5,3,9)enemySpawn(148.5,19.5,3,9)enemySpawn(168.5,19.5,3,9)enemySpawn(208.5,19.5,3,9)enemySpawn(224.5,57.5,3,13)enemySpawn(224.5,75.5,3,13)enemySpawn(224.5,104.5,3,13)enemySpawn(164.5,106.5,3,14)enemySpawn(104.5,106.5,3,14) end local function scnGame() if not isInit then init()isInit=true end camShake()effGlitch() world() drawEffGun()drawEffSmoke()drawEffFly() drawEnemyFlyerSpawn()drawEnemySpy()bos:draw() p.draw() drawEnemySpawn()drawEnemyShell()drawEnemyFlyer()drawEnemyWaller()drawEnemySpySh()drawEnemyBalBig()drawEnemymeteor() drawBul()drawEffDam()drawEffUp() drawDialog() end local tiOver=0 local function scnOver() pal()cls() print("YOU DIED!",73,52,2,false,2) if time()%1000>500 then spr(221,90,79,5)print("CONTINUE",104,80,12) end if btnp(4) then sfx(4,'F-5') if pmem(0)>0 then p.x=pmem(2)p.y=pmem(3) else newGame() end --reset pintu isDoor=false for y=109,114 do mset(29,y,128)end --reset bos bos.tAtt=-60 bos.hl=30 bos.isLife=false --kembali ke game isInit=false fade(32,-1)p.isOver=false p.health=3 tiOver=0 scene=2 end end local function scnManager() if scene==0 then scnTitle() elseif scene==1 then scnStory() elseif scene==2 then scnGame() elseif scene==3 then scnOver() elseif scene==4 then scnEnd() end end local function drawHealth() for x=1,p.health do spr(192,(-x+29)*8,8,5)end --meninggal if p.health<=0 then tiOver=tiOver+1 if tiOver==30 then fade(1,1)p.isOver=true end if tiOver==60 then music(1)scene=3 end end end --debug local function debug() --glitch if keyp(28)then glitch=30 disMode=1 end if keyp(29)then glitch=30 disMode=2 end --health if btnp(0)then p.health=p.health+1 end if btnp(7)then p.health=p.health-1 end --player print(p.health,8,8,6) --[[ print("playerX: "..p.x,0,0,12) print("playerY: "..p.y,0,8,12) print("offset: "..p.offs,0,16,12) print("camX: "..cam.x,0,24,12) print("camY: "..cam.y,0,32,12) print("area: "..p.area,0,40,12) print("peluru: "..#b,0,56,12) print("efGun: "..#eGun,0,64,12)]] end --game loop local isDebug=false function TIC() t=t+1 scnManager() end function OVR() if disMode==2 then pal()end --objek yang tidak terpengaruh pal() drawGrapCard() if scene==2 then drawHealth()end drawFade() --save game if tileSave(p.x+4,p.y+8) then if not isSave then effUp(11,p.x+4,p.y+8) notif.act=true notif.t=0 notif.y=-2 saveGame()isSave=true end else isSave=false end if notif.act then notif:draw("GAME SAVED! :)")end --frame map(0,119,30,17,0,0,5) --debug if keyp(17)then isDebug=not isDebug end if isDebug then debug()end end