`,)6o;]É,]']8·d±>S3S3 0.49, -- randomly pick true/false color = starcolors[math.random(#starcolors)], t = 0, }) end end if particletype == 'rain' or particletype == 'snow' then for i = 0, numparticles do table.insert(particles, { x = math.random() * 240, y = math.random() * waterlevel, lastx = 0, lasty = -3, t = 0, vel = (math.random() * 3) + 1, }) end end end function particleupdate() if particletype == 'stars' then for i = 1,#particles do local p = particles[i] if not p.twinkle then goto continueTwinkle end ::continueTwinkle:: if t % 15 == 0 and math.random() > 0.1 then p.color = starcolors[math.random(#starcolors)] end end end if particletype == 'rain' then for i = 1,#particles do local p = particles[i] if p.lasty and p.lasty > 136 then p.y = 0 p.lasty = 0 color = 2 p.x = math.random() * 240 end p.lasty = p.y p.lastx = p.x p.y = p.y + p.vel end end if particletype == 'snow' then for i = 1,#particles do local p = particles[i] if p.y and p.y > 136 then p.y = 0 p.lasty = 0 color = 15 p.x = math.random() * 240 end p.x = p.x - (math.random() - 0.4) p.y = p.y + p.vel end end end function particledraw() if (particletype == 'rain') then for i = 1,#particles do local p = particles[i] line(p.x, p.y, p.lastx, p.lasty, color) end return end if (particletype == 'stars') then for i = 1,#particles do local p = particles[i] pix(p.x, p.y, p.color) end end if (particletype == 'snow') then for i = 1,#particles do local p = particles[i] pix(p.x, p.y, color) end end end particleinit(100) --TEXT WITH OUTLINE by jf1x's Bokdown -- Things that should be in lua function tIf(c,t,f) return c and t or f end -- Text function oprint(t,x,y,c,oc,sf,fw,sc,centre) local w=print(t,0,-40,c,fw,sc,sf)+1 local os=tIf(centre,w/2,0) for tx=x-1,x+1,1 do for ty=y-1,y+1,1 do print(t,tx-os,ty,oc,fw,sc,sf) end end --local w=print(t,0,-40,c,fw,sc,sf)+1 --rect(x-os-1,y-1,w,7*sc,12) return print(t,x-os,y,c,fw,sc,sf)+2 end --KONAMI CODE CHECK by qrq#9658 seq={0,0,1,1,2,3,2,3,5,4} --btn sequence id=1 --current btn check index function btnSeqCheck() local prsd=false for i=0,7 do if btnp(i) then prsd=true end end if prsd then if btnp(seq[id]) then id=id+1 else id=1 end if id>#seq then options = { --anything here music = false, debug = true, } id=1 end end end function contains(list, x) for _, v in pairs(list) do if v == x then return true end end return false end --LEVEL PROPERTIES (ANIMX/Y LIMITS(1-28,1-14)) function level(m) sync(4,0,false) c=0 f=0 px=255 aepx=255 anix=0 aniy=0 et=0 strig=0 sttrig=0 ftrig=0 pxtrig=-255 aepxtrig=-255 mpxtrig=-255 spxtrig=-255 popt=0 skx1x=-255 skx1y=-255 skx1f=0 skx2x=-255 skx2y=-255 skx2f=0 skx3x=-255 skx3y=-255 skx3f=0 skx4x=-255 skx4y=-255 skx4f=0 sky1x=-255 sky1y=-255 sky1f=0 sky2x=-255 sky2y=-255 sky2f=0 sky3x=-255 sky3y=-255 sky3f=0 sky4x=-255 sky4y=-255 sky4f=0 --CREDITS if m==0 then t=0 et=400 --TITLE SCREEN elseif m==1 then t=0 --LEVEL 1 --HELLO WORLD elseif m==2 then t=0 s=2 px=3 aepx=0 aeo=0 animx=21 animy=3 skx1x=104 skx1y=80 skx1f=0 --PROMENADE elseif m==3 then s=2 px=8 aepx=0 aeo=0 animx=5 animy=3 skx1x=120 skx1y=48 skx1f=0 skx2x=56 skx2y=88 skx2f=1 --BROKEN BRIDGE elseif m==4 then s=0 px=8 aepx=0 aeo=0 animx=11 animy=8 skx1x=184 skx1y=24 skx1f=1 skx2x=48 skx2y=104 skx2f=1 --PHANTOM PIXELS elseif m==5 then s=3 px=4 aepx=4 aeo=0 animx=14 animy=3 skx1x=104 skx1y=56 skx1f=0 skx2x=128 skx2y=56 skx2f=0 --ANOTHER PHANTOM elseif m==6 then s=4 px=13 aepx=0 aeo=1 animx=3 animy=10 skx1x=32 skx1y=48 skx1f=0 skx2x=200 skx2y=48 skx2f=1 --LEVEL 2 --SKULLS LAIR elseif m==7 then t=0 s=2 px=12 aepx=0 aeo=0 animx=17 animy=13 skx1x=104 skx1y=32 skx1f=1 skx2x=160 skx2y=32 skx2f=1 skx3x=208 skx3y=56 skx3f=1 skx4x=40 skx4y=80 skx4f=0 --ABRACADABRA elseif m==8 then s=2 px=6 aepx=6 aeo=0 animx=9 animy=10 skx1x=120 skx1y=16 skx1f=0 skx2x=104 skx2y=48 skx2f=1 --VERTICAL ILLUTIONS elseif m==9 then s=8 px=10 aepx=0 aeo=1 animx=4 animy=9 skx1x=120 skx1y=32 skx1f=1 --MIRRORS elseif m==10 then s=2 px=4 aepx=3 aeo=0 animx=26 animy=11 skx1x=128 skx1y=16 skx1f=0 skx2x=32 skx2y=40 skx2f=0 skx3x=168 skx3y=80 skx3f=0 --16 PIXELS elseif m==11 then s=4 px=16 aepx=0 aeo=0 animx=5 animy=9 skx1x=88 skx1y=48 skx1f=0 skx2x=96 skx2y=48 skx2f=1 --LEVEL 3 --PERFECT REFLECT elseif m==12 then t=0 s=1 px=16 aepx=0 aeo=0 animx=15 animy=10 skx1x=56 skx1y=16 skx1f=0 skx2x=176 skx2y=16 skx2f=0 skx3x=48 skx3y=104 skx3f=1 skx4x=184 skx4y=104 skx4f=1 --ICELANDS elseif m==13 then s=3 px=5 aepx=3 aeo=0 animx=15 animy=9 skx1x=88 skx1y=48 skx1f=0 skx2x=104 skx2y=48 skx2f=0 sky1x=72 sky1y=88 sky1f=0 sky2x=160 sky2y=72 sky2f=0 --MIDNIGHT elseif m==14 then s=2 px=5 aepx=0 aeo=0 animx=23 animy=12 skx1x=32 skx1y=64 skx1f=1 skx2x=168 skx2y=64 skx2f=0 sky1x=96 sky1y=40 sky1f=0 sky2x=112 sky2y=32 sky2f=0 sky3x=128 sky3y=40 sky3f=0 --ALONE SKULL elseif m==15 then s=3 px=3 aepx=2 aeo=0 animx=15 animy=2 skx1x=112 skx1y=88 skx1f=0 --MADE IN HEAVEN elseif m==16 then s=5 px=9 aepx=6 aeo=1 animx=4 animy=4 skx1x=64 skx1y=48 skx1f=1 sky1x=112 sky1y=72 sky1f=0 --LEVEL 4 --UNDERWATER elseif m==17 then t=0 s=2 px=3 aepx=5 aeo=0 animx=2 animy=9 skx1x=16 skx1y=104 skx1f=0 skx2x=48 skx2y=104 skx2f=0 skx3x=184 skx3y=104 skx3f=1 skx4x=216 skx4y=104 skx4f=1 --ZUPAPIXELS elseif m==18 then s=9 px=8 aepx=1 aeo=0 animx=3 animy=2 skx1x=104 skx1y=16 skx1f=1 sky1x=56 sky1y=48 sky1f=1 sky2x=136 sky2y=48 sky2f=1 sky3x=104 sky3y=80 sky3f=0 --SKULLOPEDIA elseif m==19 then s=4 px=12 aepx=0 aeo=0 animx=7 animy=12 skx1x=176 skx1y=48 skx1f=1 sky1x=40 sky1y=32 sky1f=1 sky2x=88 sky2y=32 sky2f=0 sky3x=152 sky3y=80 sky3f=1 sky4x=200 sky4y=80 sky4f=0 --AFTER THE WAR elseif m==20 then s=3 px=8 aepx=0 aeo=1 animx=3 animy=2 skx1x=120 skx1y=16 skx1f=0 skx2x=40 skx2y=64 skx2f=1 skx3x=152 skx3y=104 skx3f=1 sky1x=192 sky1y=40 sky1f=1 --VIRUS KVARTIRUS elseif m==21 then s=6 px=11 aepx=0 aeo=0 animx=24 animy=13 skx1x=96 skx1y=40 skx1f=0 skx2x=128 skx2y=64 skx2f=1 sky1x=176 sky1y=88 sky1f=1 sky2x=208 sky2y=88 sky2f=1 --LEVEL 5 --NEVERSKULL elseif m==22 then t=0 s=2 px=6 aepx=0 aeo=0 animx=9 animy=12 skx1x=88 skx1y=40 skx1f=1 skx2x=136 skx2y=40 skx2f=0 --OLD TOWER elseif m==23 then s=3 px=12 aepx=2 aeo=0 animx=8 animy=12 sky1x=56 sky1y=32 sky1f=1 sky2x=128 sky2y=32 sky2f=0 sky3x=32 sky3y=64 sky3f=0 sky4x=170 sky4y=64 sky4f=1 --STRANGE CHAMBER elseif m==24 then s=5 px=7 aepx=1 aeo=0 animx=6 animy=11 skx1x=72 skx1y=24 skx1f=1 skx2x=184 skx2y=24 skx2f=0 --LEVEL 24 elseif m==25 then s=6 px=6 aepx=0 aeo=1 animx=4 animy=10 skx1x=80 skx1y=56 skx1f=1 skx2x=96 skx2y=56 skx2f=1 skx3x=128 skx3y=56 skx3f=1 skx4x=144 skx4y=56 skx4f=1 sky1x=120 sky1y=80 sky1f=0 --FINAL CHAMBER elseif m==26 then s=0 px=16 aepx=0 aeo=0 animx=15 animy=12 skx1x=120 skx1y=24 skx1f=1 skx2x=32 skx2y=56 skx2f=0 skx3x=208 skx3y=56 skx3f=1 sky1x=80 sky1y=88 sky1f=1 sky2x=104 sky2y=96 sky2f=0 sky3x=136 sky3y=96 sky3f=1 sky4x=160 sky4y=88 sky4f=0 --END elseif m==27 then t=0 l=143 s=143 px=1 aepx=0 aeo=0 animx=-1 animy=-1 end end level(m) function TIC() --SCREEN UPDATE cls() --VFX if m==1 then particletype='stars' end if m>=2 and m<12 then particletype='rain' end if m>=12 then particletype='snow' end fade_in(t) fade_out(et) if not chk and (strig==0 or strig==1) and ptrig==0 and et==0 then particleupdate() end if m<27 then particledraw() end --CREDITS if m==0 then map(0,0,30,17) if et>48 and (keyp(50) or btnp(4)) then et=48 end if et==0 then m=m+1 t=0 end end --TITLE SCREEN if m==1 then --REMAP map(30*m%270,17*((m-1)//8),30,17,0,0,0,1, function(tile) if tile>=80 and tile<=111 and et==0 then return tile*(t%38//19) end if tile>=80 and tile<=111 and et>0 then return tile*(et%10//5) end return tile end) if t>40 and et==0 and (keyp(50) or btnp(4)) then music() if id~=10 then sfx(51,43,-1,0,15) else sync(16,0,false) music(7,-1,-1,false) end et=100 end --KONAMI CODE btnSeqCheck() if et==1 then m=m+1 level(m) else return end end --LEVEL DISPLAY if m>1 then rect(0,0,240,8,0) map(30*m%240,17*(m//8),30,17,0,0,0,1, function(tile) if tile>=80 and tile<=111 and px==0 and aepx==0 then return tile*(et%38//19) end if tile==6 or tile==22 or tile==38 or tile==54 then return tile+(t%38//19) else if tile~=6 and tile~=22 and tile~=38 and tile~=54 and not ((tile>=64 and tile<=79) or (tile>=160 and tile<=175)) then return tile end end end) if ptrig==1 then rect(0,0,240,8,0) end --PIXELS DISPLAY map(30*m%240,17*(m//8),30,17,0,0,0,1, function(tile) if tile==64 or tile==72 or tile==160 or tile==168 then return tile+(t%20//2.5) end if tile==65 or tile==73 or tile==161 or tile==169 then return tile+(((t+2.5)%20//2.5)-1) end if tile==66 or tile==74 or tile==162 or tile==170 then return tile+(((t+5)%20//2.5)-2) end if tile==67 or tile==75 or tile==163 or tile==171 then return tile+(((t+7.5)%20//2.5)-3) end if tile==68 or tile==76 or tile==164 or tile==172 then return tile+(((t+10)%20//2.5)-4) end if tile==69 or tile==77 or tile==165 or tile==173 then return tile+(((t+12.5)%20//2.5)-5) end if tile==70 or tile==78 or tile==166 or tile==174 then return tile+(((t+15)%20//2.5)-6) end if tile==71 or tile==79 or tile==167 or tile==175 then return tile+(((t+17.5)%20//2.5)-7) end end) --SKULLS DISPLAY --SKULL X1 if (m>=2 and m<=22) or (m>=24 and m<=26) then spr(288+skx1x%8//2,skx1x,skx1y,0,1,skx1f,0,1,2) --RIGHT COLLISION if mget((30*m%240)+(skx1x//8)+1,(17*(m//8))+(skx1y//8)+2)==0 or mget((30*m%240)+(skx1x//8)+1,(17*(m//8))+(skx1y//8)+2)==20 or mget((30*m%240)+(skx1x//8)+1,(17*(m//8))+(skx1y//8)+2)==155 or (mget((30*m%240)+(skx1x//8)+1,(17*(m//8))+(skx1y//8)+1)>0 and mget((30*m%240)+(skx1x//8)+1,(17*(m//8))+(skx1y//8)+1)<64 and mget((30*m%240)+(skx1x//8)+1,(17*(m//8))+(skx1y//8)+1)~=5 and mget((30*m%240)+(skx1x//8)+1,(17*(m//8))+(skx1y//8)+1)~=21 and mget((30*m%240)+(skx1x//8)+1,(17*(m//8))+(skx1y//8)+1)~=37 and mget((30*m%240)+(skx1x//8)+1,(17*(m//8))+(skx1y//8)+1)~=52 and mget((30*m%240)+(skx1x//8)+1,(17*(m//8))+(skx1y//8)+1)~=53) then skx1f=1 end --LEFT COLLISION if mget((30*m%240)+(skx1x//8),(17*(m//8))+(skx1y//8)+2)==0 or mget((30*m%240)+(skx1x//8),(17*(m//8))+(skx1y//8)+2)==19 or (mget((30*m%240)+(skx1x//8),(17*(m//8))+(skx1y//8)+1)>0 and mget((30*m%240)+(skx1x//8),(17*(m//8))+(skx1y//8)+1)<64 and mget((30*m%240)+(skx1x//8),(17*(m//8))+(skx1y//8)+1)~=5 and mget((30*m%240)+(skx1x//8),(17*(m//8))+(skx1y//8)+1)~=21 and mget((30*m%240)+(skx1x//8),(17*(m//8))+(skx1y//8)+1)~=37 and mget((30*m%240)+(skx1x//8),(17*(m//8))+(skx1y//8)+1)~=52 and mget((30*m%240)+(skx1x//8),(17*(m//8))+(skx1y//8)+1)~=53) then skx1f=0 end if skx1f==0 and t>(2*60) and (strig==0 or strig==1) and ptrig==0 and et==0 and not (mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+8)//8)==6 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==151 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==152 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==153) then skx1x=skx1x+0.445 end if skx1f==1 and t>(2*60) and (strig==0 or strig==1) and ptrig==0 and et==0 and not (mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+8)//8)==6 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==151 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==152 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==153) then skx1x=skx1x-0.445 end end --SKULL X2 if (m>=3 and m<=8) or (m>=10 and m<=14) or (m==17) or (m>=20 and m<=22) or (m>=24 and m<=26) then spr(288+skx2x%8//2,skx2x,skx2y,0,1,skx2f,0,1,2) if mget((30*m%240)+(skx2x//8)+1,(17*(m//8))+(skx2y//8)+2)==0 or mget((30*m%240)+(skx2x//8)+1,(17*(m//8))+(skx2y//8)+2)==20 or (mget((30*m%240)+(skx2x//8)+1,(17*(m//8))+(skx2y//8)+1)>0 and mget((30*m%240)+(skx2x//8)+1,(17*(m//8))+(skx2y//8)+1)<64 and mget((30*m%240)+(skx2x//8)+1,(17*(m//8))+(skx2y//8)+1)~=5 and mget((30*m%240)+(skx2x//8)+1,(17*(m//8))+(skx2y//8)+1)~=21 and mget((30*m%240)+(skx2x//8)+1,(17*(m//8))+(skx2y//8)+1)~=37 and mget((30*m%240)+(skx2x//8)+1,(17*(m//8))+(skx2y//8)+1)~=52 and mget((30*m%240)+(skx2x//8)+1,(17*(m//8))+(skx2y//8)+1)~=53) then skx2f=1 end if mget((30*m%240)+(skx2x//8),(17*(m//8))+(skx2y//8)+2)==0 or mget((30*m%240)+(skx2x//8),(17*(m//8))+(skx2y//8)+2)==19 or (mget((30*m%240)+(skx2x//8),(17*(m//8))+(skx2y//8)+1)>0 and mget((30*m%240)+(skx2x//8),(17*(m//8))+(skx2y//8)+1)<64 and mget((30*m%240)+(skx2x//8),(17*(m//8))+(skx2y//8)+1)~=5 and mget((30*m%240)+(skx2x//8),(17*(m//8))+(skx2y//8)+1)~=21 and mget((30*m%240)+(skx2x//8),(17*(m//8))+(skx2y//8)+1)~=37 and mget((30*m%240)+(skx2x//8),(17*(m//8))+(skx2y//8)+1)~=52 and mget((30*m%240)+(skx2x//8),(17*(m//8))+(skx2y//8)+1)~=53) then skx2f=0 end if skx2f==0 and t>(2*60) and (strig==0 or strig==1) and ptrig==0 and et==0 and not (mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+8)//8)==6 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==151 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==152 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==153) then skx2x=skx2x+0.445 end if skx2f==1 and t>(2*60) and (strig==0 or strig==1) and ptrig==0 and et==0 and not (mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+8)//8)==6 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==151 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==152 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==153) then skx2x=skx2x-0.445 end end --SKULL X3 if m==7 or m==10 or m==12 or m==17 or m==20 or (m>=25 and m<=26) then spr(288+skx3x%8//2,skx3x,skx3y,0,1,skx3f,0,1,2) if mget((30*m%240)+(skx3x//8)+1,(17*(m//8))+(skx3y//8)+2)==0 or mget((30*m%240)+(skx3x//8)+1,(17*(m//8))+(skx3y//8)+2)==20 or (mget((30*m%240)+(skx3x//8)+1,(17*(m//8))+(skx3y//8)+1)>0 and mget((30*m%240)+(skx3x//8)+1,(17*(m//8))+(skx3y//8)+1)<64 and mget((30*m%240)+(skx3x//8)+1,(17*(m//8))+(skx3y//8)+1)~=5 and mget((30*m%240)+(skx3x//8)+1,(17*(m//8))+(skx3y//8)+1)~=21 and mget((30*m%240)+(skx3x//8)+1,(17*(m//8))+(skx3y//8)+1)~=37 and mget((30*m%240)+(skx3x//8)+1,(17*(m//8))+(skx3y//8)+1)~=52 and mget((30*m%240)+(skx3x//8)+1,(17*(m//8))+(skx3y//8)+1)~=53) then skx3f=1 end if mget((30*m%240)+(skx3x//8),(17*(m//8))+(skx3y//8)+2)==0 or mget((30*m%240)+(skx3x//8),(17*(m//8))+(skx3y//8)+2)==19 or (mget((30*m%240)+(skx3x//8),(17*(m//8))+(skx3y//8)+1)>0 and mget((30*m%240)+(skx3x//8),(17*(m//8))+(skx3y//8)+1)<64 and mget((30*m%240)+(skx3x//8),(17*(m//8))+(skx3y//8)+1)~=5 and mget((30*m%240)+(skx3x//8),(17*(m//8))+(skx3y//8)+1)~=21 and mget((30*m%240)+(skx3x//8),(17*(m//8))+(skx3y//8)+1)~=37 and mget((30*m%240)+(skx3x//8),(17*(m//8))+(skx3y//8)+1)~=52 and mget((30*m%240)+(skx3x//8),(17*(m//8))+(skx3y//8)+1)~=53) then skx3f=0 end if skx3f==0 and t>(2*60) and (strig==0 or strig==1) and ptrig==0 and et==0 and not (mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+8)//8)==6 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==151 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==152 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==153) then skx3x=skx3x+0.445 end if skx3f==1 and t>(2*60) and (strig==0 or strig==1) and ptrig==0 and et==0 and not (mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+8)//8)==6 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==151 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==152 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==153) then skx3x=skx3x-0.445 end end --SKULL X4 if m==7 or m==12 or m==17 or m==25 then spr(288+skx4x%8//2,skx4x,skx4y,0,1,skx4f,0,1,2) if mget((30*m%240)+(skx4x//8)+1,(17*(m//8))+(skx4y//8)+2)==0 or mget((30*m%240)+(skx4x//8)+1,(17*(m//8))+(skx4y//8)+2)==20 or (mget((30*m%240)+(skx4x//8)+1,(17*(m//8))+(skx4y//8)+1)>0 and mget((30*m%240)+(skx4x//8)+1,(17*(m//8))+(skx4y//8)+1)<64 and mget((30*m%240)+(skx4x//8)+1,(17*(m//8))+(skx4y//8)+1)~=5 and mget((30*m%240)+(skx4x//8)+1,(17*(m//8))+(skx4y//8)+1)~=21 and mget((30*m%240)+(skx4x//8)+1,(17*(m//8))+(skx4y//8)+1)~=37 and mget((30*m%240)+(skx4x//8)+1,(17*(m//8))+(skx4y//8)+1)~=52 and mget((30*m%240)+(skx4x//8)+1,(17*(m//8))+(skx4y//8)+1)~=53) then skx4f=1 end if mget((30*m%240)+(skx4x//8),(17*(m//8))+(skx4y//8)+2)==0 or mget((30*m%240)+(skx4x//8),(17*(m//8))+(skx4y//8)+2)==19 or (mget((30*m%240)+(skx4x//8),(17*(m//8))+(skx4y//8)+1)>0 and mget((30*m%240)+(skx4x//8),(17*(m//8))+(skx4y//8)+1)<64 and mget((30*m%240)+(skx4x//8),(17*(m//8))+(skx4y//8)+1)~=5 and mget((30*m%240)+(skx4x//8),(17*(m//8))+(skx4y//8)+1)~=21 and mget((30*m%240)+(skx4x//8),(17*(m//8))+(skx4y//8)+1)~=37 and mget((30*m%240)+(skx4x//8),(17*(m//8))+(skx4y//8)+1)~=52 and mget((30*m%240)+(skx4x//8),(17*(m//8))+(skx4y//8)+1)~=53) then skx4f=0 end if skx4f==0 and t>(2*60) and (strig==0 or strig==1) and ptrig==0 and et==0 and not (mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+8)//8)==6 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==151 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==152 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==153) then skx4x=skx4x+0.445 end if skx4f==1 and t>(2*60) and (strig==0 or strig==1) and ptrig==0 and et==0 and not (mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+8)//8)==6 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==151 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==152 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==153) then skx4x=skx4x-0.445 end end --SKULL Y1 if (m>=13 and m<=14) or (m==16) or (m>=18 and m<=21) or (m==23) or (m>=25 and m<=26) then if t<=120 then spr(292,sky1x,sky1y,0,1,0,0,1,2) end if t>120 then spr(292+t%72//18,sky1x,sky1y,0,1,0,0,1,2) end --DOWN COLLISION if (mget((30*m%240)+(sky1x//8),(17*(m//8))+(sky1y//8)+2)>0 and mget((30*m%240)+(sky1x//8),(17*(m//8))+(sky1y//8)+2)<64) then sky1f=1 end --UP COLLISION if (mget((30*m%240)+(sky1x//8),(17*(m//8))+(sky1y//8)+1)>0 and mget((30*m%240)+(sky1x//8),(17*(m//8))+(sky1y//8)+1)<64 and mget((30*m%240)+(sky1x//8),(17*(m//8))+(sky1y//8)+1)~=3 and mget((30*m%240)+(sky1x//8),(17*(m//8))+(sky1y//8)+1)~=4 and mget((30*m%240)+(sky1x//8),(17*(m//8))+(sky1y//8)+1)~=35 and mget((30*m%240)+(sky1x//8),(17*(m//8))+(sky1y//8)+1)~=36 and mget((30*m%240)+(sky1x//8),(17*(m//8))+(sky1y//8)+1)~=60 and mget((30*m%240)+(sky1x//8),(17*(m//8))+(sky1y//8)+1)~=61) or mget((30*m%240)+(sky1x//8),(17*(m//8))+(sky1y//8)+1)==146 then sky1f=0 end if sky1f==0 and t>(2*60) and (strig==0 or strig==1) and ptrig==0 and et==0 and not (mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+8)//8)==6 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==151 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==152 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==153) then sky1y=sky1y+0.85 end if sky1f==1 and t>(2*60) and (strig==0 or strig==1) and ptrig==0 and et==0 and not (mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+8)//8)==6 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==151 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==152 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==153) then sky1y=sky1y-0.85 end end --SKULL Y2 if (m>=13 and m<=14) or (m>=18 and m<=19) or (m==21) or (m==23) or (m==26) then if t<=120 then spr(292,sky2x,sky2y,0,1,0,0,1,2) end if t>120 then spr(292+t%72//18,sky2x,sky2y,0,1,0,0,1,2) end if (mget((30*m%240)+(sky2x//8),(17*(m//8))+(sky2y//8)+2)>0 and mget((30*m%240)+(sky2x//8),(17*(m//8))+(sky2y//8)+2)<64) then sky2f=1 end if (mget((30*m%240)+(sky2x//8),(17*(m//8))+(sky2y//8)+1)>0 and mget((30*m%240)+(sky2x//8),(17*(m//8))+(sky2y//8)+1)<64 and mget((30*m%240)+(sky2x//8),(17*(m//8))+(sky2y//8)+1)~=3 and mget((30*m%240)+(sky2x//8),(17*(m//8))+(sky2y//8)+1)~=4 and mget((30*m%240)+(sky2x//8),(17*(m//8))+(sky2y//8)+1)~=35 and mget((30*m%240)+(sky2x//8),(17*(m//8))+(sky2y//8)+1)~=36 and mget((30*m%240)+(sky2x//8),(17*(m//8))+(sky2y//8)+1)~=60 and mget((30*m%240)+(sky2x//8),(17*(m//8))+(sky2y//8)+1)~=61) or mget((30*m%240)+(sky1x//8),(17*(m//8))+(sky1y//8)+1)==146 then sky2f=0 end if sky2f==0 and t>(2*60) and (strig==0 or strig==1) and ptrig==0 and et==0 and not (mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+8)//8)==6 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==151 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==152 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==153) then sky2y=sky2y+0.85 end if sky2f==1 and t>(2*60) and (strig==0 or strig==1) and ptrig==0 and et==0 and not (mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+8)//8)==6 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==151 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==152 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==153) then sky2y=sky2y-0.85 end end --SKULL Y3 if (m>=14 and m<=14) or (m>=18 and m<=19) or (m==23) or (m==26) then if t<=120 then spr(292,sky3x,sky3y,0,1,0,0,1,2) end if t>120 then spr(292+t%72//18,sky3x,sky3y,0,1,0,0,1,2) end if (mget((30*m%240)+(sky3x//8),(17*(m//8))+(sky3y//8)+2)>0 and mget((30*m%240)+(sky3x//8),(17*(m//8))+(sky3y//8)+2)<64) or (mget((30*m%240)+(sky3x//8),(17*(m//8))+(sky3y//8)+2)==152) then sky3f=1 end if (mget((30*m%240)+(sky3x//8),(17*(m//8))+(sky3y//8)+1)>0 and mget((30*m%240)+(sky3x//8),(17*(m//8))+(sky3y//8)+1)<64 and mget((30*m%240)+(sky3x//8),(17*(m//8))+(sky3y//8)+1)~=3 and mget((30*m%240)+(sky3x//8),(17*(m//8))+(sky3y//8)+1)~=4 and mget((30*m%240)+(sky3x//8),(17*(m//8))+(sky3y//8)+1)~=35 and mget((30*m%240)+(sky3x//8),(17*(m//8))+(sky3y//8)+1)~=36 and mget((30*m%240)+(sky3x//8),(17*(m//8))+(sky3y//8)+1)~=60 and mget((30*m%240)+(sky3x//8),(17*(m//8))+(sky3y//8)+1)~=61) then sky3f=0 end if sky3f==0 and t>(2*60) and (strig==0 or strig==1) and ptrig==0 and et==0 and not (mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+8)//8)==6 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==151 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==152 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==153) then sky3y=sky3y+0.85 end if sky3f==1 and t>(2*60) and (strig==0 or strig==1) and ptrig==0 and et==0 and not (mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+8)//8)==6 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==151 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==152 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==153) then sky3y=sky3y-0.85 end end --SKULL Y4 if (m==19) or (m==23) or (m==26) then if t<=120 then spr(292,sky4x,sky4y,0,1,0,0,1,2) end if t>120 then spr(292+t%72//18,sky4x,sky4y,0,1,0,0,1,2) end if (mget((30*m%240)+(sky4x//8),(17*(m//8))+(sky4y//8)+2)>0 and mget((30*m%240)+(sky4x//8),(17*(m//8))+(sky4y//8)+2)<64) then sky4f=1 end if (mget((30*m%240)+(sky4x//8),(17*(m//8))+(sky4y//8)+1)>0 and mget((30*m%240)+(sky4x//8),(17*(m//8))+(sky4y//8)+1)<64 and mget((30*m%240)+(sky4x//8),(17*(m//8))+(sky4y//8)+1)~=3 and mget((30*m%240)+(sky4x//8),(17*(m//8))+(sky4y//8)+1)~=4 and mget((30*m%240)+(sky4x//8),(17*(m//8))+(sky4y//8)+1)~=35 and mget((30*m%240)+(sky4x//8),(17*(m//8))+(sky4y//8)+1)~=36 and mget((30*m%240)+(sky4x//8),(17*(m//8))+(sky4y//8)+1)~=60 and mget((30*m%240)+(sky4x//8),(17*(m//8))+(sky4y//8)+1)~=61) then sky4f=0 end if sky4f==0 and t>(2*60) and (strig==0 or strig==1) and ptrig==0 and et==0 and not (mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+8)//8)==6 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==151 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==152 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==153) then sky4y=sky4y+0.85 end if sky4f==1 and t>(2*60) and (strig==0 or strig==1) and ptrig==0 and et==0 and not (mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+8)//8)==6 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==151 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==152 or mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)==153) then sky4y=sky4y-0.85 end end --LEVEL CLEAR if px==0 and aepx==0 and mpx==0 and spx==0 then if et==0 then sfx(52,36,90,0) for i=0,29 do mset((30*m%240)+i,(17*(m//8)),0) end for i, item in ipairs({91,84,101,84,91,0,82,91,84,80,97}) do mset((30*m%240)+(i+9),(17*(m//8)),item) end et=200 end if et>0 then spr(257+(f*3),animx*8+(anix//10),animy*8+(aniy//10),0,1,f,0,1,2) spr(265,aex,aey,0,1,0,0,1,2) end if et==1 then if m==6 or m==11 or m==16 or m==21 then l=l+1 end m=m+1 t=1 level(m) else return end end --STATUS DISPLAY mset((30*m%240)+3,(17*(m//8)),112+l) mset((30*m%240)+7,(17*(m//8)),112+s) end --DEATH chk=(mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+8)//8)==6 or contains({151,152,153},mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)) or (skx1x>=animx*8+(anix//10) and skx1x=(animy*8+(aniy//10)+8) and skx1y+8<(animy*8+(aniy//10)+8)+8) or (((skx2x>=(animx*8+(anix//10)) and (skx2x<((animx*8+(anix//10))+8))) and (skx2y+8>=((animy*8+(aniy//10))+8) and skx2y+8<(((animy*8+(aniy//10))+8)+8)))) or (((skx3x>=(animx*8+(anix//10)) and (skx3x<((animx*8+(anix//10))+8))) and (skx3y+8>=((animy*8+(aniy//10))+8) and skx3y+8<(((animy*8+(aniy//10))+8)+8)))) or (((skx4x>=(animx*8+(anix//10)) and (skx4x<((animx*8+(anix//10))+8))) and (skx4y+8>=((animy*8+(aniy//10))+8) and skx4y+8<(((animy*8+(aniy//10))+8)+8)))) or (((sky1x>=(animx*8+(anix//10)) and (sky1x<((animx*8+(anix//10))+8))) and (sky1y+8>=((animy*8+(aniy//10))+8) and sky1y+8<(((animy*8+(aniy//10))+8)+8)))) or (((sky2x>=(animx*8+(anix//10)) and (sky2x<((animx*8+(anix//10))+8))) and (sky2y+8>=((animy*8+(aniy//10))+8) and sky2y+8<(((animy*8+(aniy//10))+8)+8)))) or (((sky3x>=(animx*8+(anix//10)) and (sky3x<((animx*8+(anix//10))+8))) and (sky3y+8>=((animy*8+(aniy//10))+8) and sky3y+8<(((animy*8+(aniy//10))+8)+8)))) or (((sky4x>=(animx*8+(anix//10)) and (sky4x<((animx*8+(anix//10))+8))) and (sky4y+8>=((animy*8+(aniy//10))+8) and sky4y+8<(((animy*8+(aniy//10))+8)+8))))) if chk and (strig==0 or strig==1) then if et==0 then sfx(56,45,-2,0) sfx(60,45,-2,1) et=100 end if et>0 then spr(302+et%8//4,animx*8+(anix//10),animy*8+(aniy//10),0,1,0,0,1,2) spr(270+et%8//4,aex,aey,0,1,0,0,1,2) end if et==40 then music() end if et==1 then ftrig=0 l=l-1 t=0 level(m) else return end end --GAME OVER if l==-1 then map(210,119,30,17) if t==0 then et=480 end if et==1 then l=5 m=1 level() t=0 else return end end --FALL if contains({0,6,19,20,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175},mget((30*m%240)+(animx*8+(anix/10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)) and anix==0 and aniy==0 and strig==0 then if m>1 and ftrig==0 and l>=0 then sfx(57,82,-1,0) end ftrig=1 animy=animy+1 aniy=-80 spr(263+t%8//4,animx*8+(anix//10),animy*8+(aniy//10),0,1,0,0,1,2) end --NOTHING if anix==0 and aniy==0 and t>(2*60) then if ftrig==1 and strig==0 then sfx(58,24,-1,0);sttrig=0 end if strig==0 then --STANDING if sttrig+64>=t then spr(257+((1-f)*3),animx*8+(anix//10),animy*8+(aniy//10),0,1,f,0,1,2) else spr(256+c,animx*8+(anix//10),animy*8+(aniy//10),0,1,f,0,1,2) end else if aeo==0 then spr(300+(animx*8+(anix//10))%16//8,animx*8+(anix//10),animy*8+(aniy//10),0,1,f,0,1,2) end if aeo==1 then spr(300+((animy*8+(aniy//10))+8)%16//8,animx*8+(anix//10),animy*8+(aniy//10),0,1,f,0,1,2) end end ftrig=0 btrig=0 end if t<(2*60) then spr(256+((t%20//10)*13),animx*8+(anix//10),animy*8+(aniy//10),0,1,f,0,1,2) end if m>1 then --CONTROLS, COLLISION and SFX --UP(0),DOWN(1),LEFT(2),RIGHT(3) if strig==0 and t>(2*60) and ptrig==0 and (m>=2 and m<=26) then if btn(0) and contains({5,21,37,52,53},mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10))//8)) and anix==0 and aniy==0 then ftrig=0 sttrig=0 sfx(63,84,-1,3) animy=animy-1 aniy=80 end if btn(1) and contains({5,21,37,52,53},mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)) and anix==0 and aniy==0 then ftrig=0 sttrig=0 sfx(63,84,-1,3) animy=animy+1 aniy=-80 end if btn(2) and contains({0,3,4,5,21,35,36,37,47,50,51,52,53,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175},mget((30*m%240)+(animx*8+(anix//10)-8)//8,(17*(m//8))+(animy*8+(aniy//10)+8)//8)) and anix==0 and aniy==0 then ftrig=0 sttrig=t --BRIDGE if contains({50,51},mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)) then sfx(61,0,-1,3) mset((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+((animy*8+(aniy//10))//8)+2,0) btrig=1 else sfx(62,0,-1,3) end animx=animx-1 anix=80 end if btn(3) and anix==0 and aniy==0 and contains({0,3,4,5,21,35,36,37,47,50,51,52,53,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175},mget((30*m%240)+(animx*8+(anix//10)+8)//8,(17*(m//8))+(animy*8+(aniy//10)+8)//8)) then ftrig=0 sttrig=t --BRIDGE if contains({50,51},mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8)) then sfx(61,0,-1,3) mset((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+((animy*8+(aniy//10))//8)+2,0) btrig=1 else sfx(62,0,-1,3) end animx=animx+1 anix=-80 end --A/Z(4),B/X(5),X/A(6),Y/S(7) if (btnp(4) or btnp(5)) and (m>=2 and m<=26) then if s>0 and contains({0,3,4,5,21,35,36,37,47,50,51,52,53,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175},mget((30*m%240)+aex//8,(17*(m//8))+((aey+8)//8))) then sfx(53,50,-1,3) s=s-1 strig=1 else if s==0 then sfx(55,31,-1,2) else sfx(59,60,-1,3) end end end end --PAUSE OPTIONS if t>=2*60 and (m>=2 and m<=26) then if ptrig==1 then if btnp(0) and popt==1 then sfx(47,48) popt=0 end if btnp(1) and popt==0 and l>0 then sfx(47,48) popt=1 end if et==1 then ptrig=0 ftrig=0 l=l-1 t=0 level(m) end end if keyp(50) then if ptrig==0 then sfx(51,43,-1,0,15) ptrig=1 pal(0.5) must=peek(0x13ffc) musf=peek(0x13ffd) musr=peek(0x13ffe) musl=peek(0x13fff) music() else if popt==0 then sfx(51,43,-1,0,15) ptrig=0 pal(1) music(must,musf,musr,musl) elseif popt==1 then sfx(51,43,-1,0,15) et=24 end end end end --MOVEMENT PROPERTIES AND HERO DISPLAY if strig==1 and anix==0 and aniy==0 then if aeo==0 then strig=(aex)-(animx*8+(anix//10)) end if aeo==1 then strig=(aey)-(animy*8+(aniy//10)) end end if strig~=1 then if strig<0 and ptrig==0 then if aeo==0 then animx=animx-0.5 end if aeo==1 then animy=animy-0.5 end strig=strig+4 end if strig>0 and ptrig==0 then if aeo==0 then animx=animx+0.5 end if aeo==1 then animy=animy+0.5 end strig=strig-4 end end if anix>0 then if btrig==1 then if (m>=2 and m<=11) or (m>=22 and m<=26) then spr(50,(animx*8)+8,(animy*8+(aniy//10))+16+(8-(math.abs(anix//10))),0) end if (m>=12 and m<=21) then spr(51,(animx*8)+8,(animy*8+(aniy//10))+16+(8-(math.abs(anix//10))),0) end end c=0 f=0 if ptrig==0 then anix=anix-8 end spr(257+t%8//2,animx*8+(anix//10),animy*8+(aniy//10),0,1,f,0,1,2) end if anix<0 then if btrig==1 then if (m>=2 and m<=11) or (m>=22 and m<=26) then spr(50,(animx*8)-8,(animy*8+(aniy//10))+16+(8-(math.abs(anix//10))),0) end if (m>=12 and m<=21) then spr(51,(animx*8)-8,(animy*8+(aniy//10))+16+(8-(math.abs(anix//10))),0) end end c=0 f=1 if ptrig==0 then anix=anix+8 end spr(257+t%8//2,animx*8+(anix//10),animy*8+(aniy//10),0,1,f,0,1,2) end if aniy>0 then c=5 if ptrig==0 then aniy=aniy-8 end spr(261+((animy*8+(aniy//10))+8)%6//3,animx*8+(anix//10),animy*8+(aniy//10),0,1,0,0,1,2) end if aniy<0 then c=5 if ptrig==0 then aniy=aniy+8 end --FALL-CLIMB $C (BUG FIXES) if ((mget((30*m%240)+(animx*8+(anix/10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8))==0 or (mget((30*m%240)+(animx*8+(anix/10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8))==6 or (mget((30*m%240)+(animx*8+(anix/10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8))==19 or (mget((30*m%240)+(animx*8+(anix/10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8))==20 or ((mget((30*m%240)+(animx*8+(anix/10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8))>=64 and (mget((30*m%240)+(animx*8+(anix/10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8))<=79) or (mget((30*m%240)+(animx*8+(anix/10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8))>=160 and (mget((30*m%240)+(animx*8+(anix/10))//8,(17*(m//8))+(animy*8+(aniy//10)+16)//8))<=175) then spr(263+t%8//4,animx*8+(anix//10),animy*8+(aniy//10),0,1,0,0,1,2) else if ftrig==1 then c=0 end spr(261+((animy*8+(aniy//10))+8)%14//7,animx*8+(anix//10),animy*8+(aniy//10),0,1,0,0,1,2) end end --PIXEL COLLISION (PINK) if contains({64,65,66,67,68,69,70,71},mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+8)//8)) and strig==0 then px=px-1 sfx(54,72,-1,0) mset((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+((animy*8+(aniy//10))//8)+1,0) pxtrig=t pxposxtrig=(animx*8) pxposytrig=(animy*8) end --PHANTOM PIXEL COLLISION (BLUE) if contains({72,73,74,75,76,77,78,79},mget((30*m%240)+aex//8,(17*(m//8))+((aey+8)//8))) and strig==0 then aepx=aepx-1 sfx(54,69,-1,0) mset((30*m%240)+aex//8,(17*(m//8))+((aey+8)//8),0) aepxtrig=t if aeo==0 then --120=ZX spectrum Mirrored, 116=NES Mirrored aepxposxtrig=120-((animx*8)-120) aepxposytrig=animy*8 end if aeo==1 then aepxposxtrig=animx*8 aepxposytrig=64-((animy*8)-64) end end --MIRROR PIXEL COLLISION (YELLOW) if contains({160,161,162,163,164,165,166,167},mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+8)//8)) and strig==0 then sfx(54,72,-1,0) mset((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+((animy*8+(aniy//10))//8)+1,0) if aeo==0 then aeo=1 else aeo=0 end mpxtrig=t mpxposxtrig=(animx*8) mpxposytrig=(animy*8) end --SWAP PIXEL COLLISION (RED) if contains({168,169,170,171,172,173,174,175},mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+8)//8)) and strig~=0 then sfx(54,72,-1,0) mset((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+((animy*8+(aniy//10))//8)+1,0) spxtrig=t spxposxtrig=(animx*8) spxposytrig=(animy*8) end --PIXEL ANIMATION (PINK) if pxtrig+16>=t then spr(64,pxposxtrig,pxposytrig-((t-pxtrig)*2)+8,0) end --PHANTOM PIXEL ANIMATION (BLUE) if aepxtrig+16>=t then spr(72,aepxposxtrig,aepxposytrig-((t-aepxtrig)*2)+8,0) end --MIRROR PIXEL ANIMATION (YELLOW) if mpxtrig+16>=t then spr(160,mpxposxtrig,mpxposytrig-((t-mpxtrig)*2)+8,0) end --SWAP PIXEL ANIMATION (RED) if spxtrig+16>=t then spr(168,spxposxtrig,spxposytrig-((t-spxtrig)*2)+8,0) end --ALTER EGO DISPLAY if aeo==0 then --120=ZX spectrum Mirrored, 116=NES Mirrored aex=120-((animx*8+(anix//10))-120) aey=animy*8+(aniy//10) end if aeo==1 then aex=animx*8+(anix//10) aey=64-((animy*8+(aniy//10))-64) end if t>(2*60) then if (strig==0 or strig==1) then spr(265+t%8//2,aex,aey,0,1,0,0,1,2) else if aeo==0 then spr(296+aex%32//8,aex,aey,0,1,0,0,1,2) end if aeo==1 then spr(296+aey%32//8,aex,aey,0,1,0,0,1,2) end end elseif (t%20//10)==0 then spr(265+t%8//2,aex,aey,0,1,0,0,1,2) end end end --[[ function SCN(x) if m==0 then if (x>=0 and x<32) then --PALETTE VARIABLES basepalette = { 0x1a1c2c, 0x29366f, 0x3b5dc9, 0x1a1c2c, 0x5d275d, 0x38b764, 0xb13e53, 0x333c57, 0x41a6f6, 0xef7d57, 0x3b5dc9, 0xa7f070, 0xe06f8b, 0x73eff7, 0xffcd75, 0x41a6f6 } pal(1) elseif (x>=32 and x<40) then --PALETTE VARIABLES basepalette = { 0x1a1c2c, 0xb13e53, 0x3b5dc9, 0x1a1c2c, 0x5d275d, 0x38b764, 0xb13e53, 0x333c57, 0x41a6f6, 0xef7d57, 0xef7d57, 0xa7f070, 0xe06f8b, 0x73eff7, 0xffcd75, 0xffcd75 } pal(1) elseif (x>=48 and x<56) then --PALETTE VARIABLES basepalette = { 0x1a1c2c, 0x29366f, 0x3b5dc9, 0x1a1c2c, 0x5d275d, 0x38b764, 0xb13e53, 0x333c57, 0x41a6f6, 0xef7d57, 0x3b5dc9, 0xa7f070, 0xe06f8b, 0x73eff7, 0xffcd75, 0x41a6f6 } pal(1) elseif (x>=56 and x<64) then --PALETTE VARIABLES basepalette = { 0x1a1c2c, 0xb13e53, 0x3b5dc9, 0x1a1c2c, 0x5d275d, 0x38b764, 0xb13e53, 0x333c57, 0x41a6f6, 0xef7d57, 0xef7d57, 0xa7f070, 0xe06f8b, 0x73eff7, 0xffcd75, 0xffcd75 } pal(1) elseif (x>=72 and x<80) then --PALETTE VARIABLES basepalette = { 0x1a1c2c, 0x29366f, 0x3b5dc9, 0x1a1c2c, 0x5d275d, 0x38b764, 0xb13e53, 0x333c57, 0x41a6f6, 0xef7d57, 0x3b5dc9, 0xa7f070, 0xe06f8b, 0x73eff7, 0xffcd75, 0x41a6f6 } pal(1) elseif (x>=80 and x<88) then --PALETTE VARIABLES basepalette = { 0x1a1c2c, 0xb13e53, 0x3b5dc9, 0x1a1c2c, 0x5d275d, 0x38b764, 0xb13e53, 0x333c57, 0x41a6f6, 0xef7d57, 0xef7d57, 0xa7f070, 0xe06f8b, 0x73eff7, 0xffcd75, 0xffcd75 } pal(1) elseif (x>=96 and x<104) then --PALETTE VARIABLES basepalette = { 0x1a1c2c, 0x29366f, 0x3b5dc9, 0x1a1c2c, 0x5d275d, 0x38b764, 0xb13e53, 0x333c57, 0x41a6f6, 0xef7d57, 0x3b5dc9, 0xa7f070, 0xe06f8b, 0x73eff7, 0xffcd75, 0x41a6f6 } pal(1) elseif (x>=104 and x<120) then --PALETTE VARIABLES basepalette = { 0x1a1c2c, 0xb13e53, 0x3b5dc9, 0x1a1c2c, 0x5d275d, 0x38b764, 0xb13e53, 0x333c57, 0x41a6f6, 0xef7d57, 0xef7d57, 0xa7f070, 0xe06f8b, 0x73eff7, 0xffcd75, 0xffcd75 } pal(1) else --PALETTE VARIABLES basepalette = { 0x1a1c2c, 0x29366f, 0x3b5dc9, 0x1a1c2c, 0x5d275d, 0x38b764, 0xb13e53, 0x333c57, 0x41a6f6, 0xef7d57, 0x94b0c2, 0xa7f070, 0xe06f8b, 0x73eff7, 0xffcd75, 0xf4f4f4 } pal(1) end end end --]] function OVR() if ptrig==1 then map(60,0,30,17,0,0,0,1, --REMAP function(tile) if tile>=144 and tile<=156 then return tile end end) font("PAUSE",188,0,0) if time()%600//300==0 then font("[",8,0,0) end if popt==0 then font("RESUME",16,0,0) else font("RESTART",16,0,0) end end --MUSIC if options.music then --TITLE SCREEN if m==1 and t==0 then music(0,-1,-1,false) end --LEVELS 1-5 if m>=2 and m<=6 and t==0 then music(1,-1,-1,false) end --LEVELS 6-10 if m>=7 and m<=11 and t==0 then sync(16,1,false) music(0,-1,-1,false) end --LEVELS 11-15 if m>=12 and m<=16 and t==0 then sync(16,0,false) music(2,-1,-1,false) end --LEVELS 16-20 if m>=17 and m<=21 and t==0 then sync(16,1,false) music(1,-1,-1,true) end --LEVELS 21-25 if m>=22 and m<=26 and t==0 then sync(16,1,false) music(2,-1,-1,true) end --LEVELS 26-??? if m>=27 and t==0 then sync(16,0,false) music(7,-1,-1,false) end if l==-1 and t==0 then sync(16,0,false) music(6,-1,-1,false) end end --DEBUG DISPLAY if options.debug then oprint("DEBUG",1,1,15,0,true,true,1,false) --TIMER oprint(t,1,7,15,0,true,true,1,false) --SWAP ACTION INPUT if btn(4)==true or btn(5)==true then oprint("true",1,13,15,0,true,true,1,false) else oprint("false",1,13,15,0,true,true,1,false) end --MAP SCREEN oprint(m,1,19,15,0,true,true,1,false) --SWAP TRIGGER oprint(string.format("%d",strig),17,19,15,0,true,true,1,false) --MAP HERO SPR POSITION oprint(string.format("%d",(30*m%240)+(animx*8+(anix//10))//8),1,31,15,0,true,true,1,false) oprint(string.format("%d",(17*(m//8))+((animy*8+(aniy//10))//8)+1),1,37,15,0,true,true,1,false) --MAP ALTER EGO SPR POSITION oprint(string.format("%d",(30*m%240)+aex//8),17,31,15,0,true,true,1,false) oprint(string.format("%d",(17*(m//8))+((aey+8)//8)),17,37,15,0,true,true,1,false) --SCREEN HERO ANIMATION oprint(anix//10,1,49,15,0,true,true,1,false) oprint(aniy//10,1,55,15,0,true,true,1,false) --PIXEL AND PHANTOM PIXEL COUNTER oprint(px,17,49,15,0,true,true,1,false) oprint(aepx,17,55,15,0,true,true,1,false) --SCREEN HERO SPR POSITION oprint(string.format("%d",(animx*8+(anix//10))),(animx*8+(anix//10)),(animy*8+(aniy//10))-8,15,0,true,true,1,false) oprint(string.format("%d",(animy*8+(aniy//10))+8),(animx*8+(anix//10)),(animy*8+(aniy//10))-2,15,0,true,true,1,false) --SCREEN ALTER EGO SPR POSITION oprint(string.format("%d",aex),aex,aey-8,15,0,true,true,1,false) oprint(string.format("%d",aey+8),aex,aey-2,15,0,true,true,1,false) --SCREEN SKULLS SPR POSITION oprint(string.format("%.f",skx1x),skx1x,skx1y-8,15,0,true,true,1,false) oprint(string.format("%.f",skx1y),skx1x,skx1y-2,15,0,true,true,1,false) oprint(string.format("%.f",skx2x),skx2x,skx2y-8,15,0,true,true,1,false) oprint(string.format("%.f",skx2y),skx2x,skx2y-2,15,0,true,true,1,false) oprint(string.format("%.f",skx3x),skx3x,skx3y-8,15,0,true,true,1,false) oprint(string.format("%.f",skx3y),skx3x,skx3y-2,15,0,true,true,1,false) oprint(string.format("%.f",skx4x),skx4x,skx4y-8,15,0,true,true,1,false) oprint(string.format("%.f",skx4y),skx4x,skx4y-2,15,0,true,true,1,false) oprint(string.format("%.f",sky1x),sky1x,sky1y-8,15,0,true,true,1,false) oprint(string.format("%.f",sky1y),sky1x,sky1y-2,15,0,true,true,1,false) oprint(string.format("%.f",sky2x),sky2x,sky2y-8,15,0,true,true,1,false) oprint(string.format("%.f",sky2y),sky2x,sky2y-2,15,0,true,true,1,false) oprint(string.format("%.f",sky3x),sky3x,sky3y-8,15,0,true,true,1,false) oprint(string.format("%.f",sky3y),sky3x,sky3y-2,15,0,true,true,1,false) oprint(string.format("%.f",sky4x),sky4x,sky4y-8,15,0,true,true,1,false) oprint(string.format("%.f",sky4y),sky4x,sky4y-2,15,0,true,true,1,false) --MGET HERO --print(mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10))//8),22,78,15,true,1,true) oprint(mget((30*m%240)+(animx*8-8)//8,(17*(m//8))+(animy*8+8)//8),animx*8-8,(animy*8)+8,15,0,true,true,1,false) --print(mget((30*m%240)+(animx*8+(anix//10))//8,(17*(m//8))+(animy*8+(aniy//10)+8)//8),22,84,15,true,1,true) oprint(mget((30*m%240)+(animx*8+8)//8,(17*(m//8))+(animy*8+8)//8),animx*8+8,(animy*8)+8,15,0,true,true,1,false) oprint(mget((30*m%240)+(animx*8)//8,(17*(m//8))+(animy*8+16)//8),animx*8,(animy*8)+16,15,0,true,true,1,false) --MGET ALTER EGO oprint(mget((30*m%240)+aex//8,(17*(m//8))+((aey+8)//8)),(aex//8)*8,((aey//8)+1)*8,15,0,true,true,1,false) spr(384+(btn(0) and 1 or 0),8,104,0) spr(386+(btn(1) and 1 or 0),8,120,0) spr(388+(btn(2) and 1 or 0),0,112,0) spr(390+(btn(3) and 1 or 0),16,112,0) spr(392+(btn(4) and 1 or 0),32,120,0) spr(394+(btn(5) and 1 or 0),40,112,0) spr(396+(btn(6) and 1 or 0),24,112,0) spr(398+(btn(7) and 1 or 0),32,104,0) oprint("BUILD 230901",192,130,15,0,true,true,1,false) --[[ --MUSIC SPEED (0-7) print(peek(0x13e96),0,102) print(peek(0x13ec9),22,102) print(peek(0x13efc),0,108) print(peek(0x13f2f),22,108) print(peek(0x13f62),0,114) print(peek(0x13f95),22,114) print(peek(0x13fc8),0,120) print(peek(0x13ffb),22,120) --MUSIC POSITION print(string.format("track: %d",peek(0x13ffc)),0,102,15,true,1,true) print(string.format("frame: %d",peek(0x13ffd)),0,108,15,true,1,true) print(string.format("row : %d",peek(0x13ffe)),0,114,15,true,1,true) print(string.format("loop : %d",peek(0x13fff)//4),0,120,15,true,1,true) --]] end --if options.debug --TIMER if not chk and (strig==0 or strig==1) and ptrig==0 and (px>0 or aepx>0) then t=t+1 end if et>0 then et=et-1 end end