`(]']±>Sï}WÿÍu§ğp8·d%qy)6o;]ÉA¦ösï÷ôôô”°ÂVl†3Sï}WÿÍu§ğp8·d%qy)6o;]ÉA¦ösï÷ôôô”°ÂVl†30 do spr((n%10)+1024,x-i*9,y,0,1,0,0,1,2) n=n//10 i=i+1 end poke4(2*0x03FFC,2) palmap() end function money(m) if not m then return pmem(0) else return pmem(0,pmem(0)+m) end end function palmap(pmap) for i=0,15 do poke4(0x03FF0*2+i,(pmap and pmap[i]) or i) end end function palpor(pal,por) por=por or 1 for i=cero and 1 or 4,#pal do if por>1 then poke(0x03fc0+i-1,min(pal[i]*por,255)) -- poke(0x03fc0+i-1,pal[i]+(por-1)*(255-pal[i])) else poke(0x03fc0+i-1,pal[i]*por) end end end function linea(x0,y0,x1,y1,col,tam) local dx=x1-x0 local dy=y1-y0 local step=math.abs(dx)>math.abs(dy) and math.abs(dx) or math.abs(dy) local xinc=dx/step local yinc=dy/step local x=x0 local y=y0 for i=0,step do circ(x,y,tam,col) x=x+xinc y=y+yinc end end function menu() if money()==0 then money(100) end poke(0x03FF9,0) poke(0x03FFA,0) local function mTIC() poke4(2*0x03FFC,4) palmap({9,10,12}) map(60,0) poke4(2*0x03FFC,2) palmap() x,y,pre=mouse() cli=click(pre) if cli then if x>101 and y>45 and x<138 and y<82 then TIC,SCN,OVR=slot() end if x>101 and y>85 and x<138 and y<122 then TIC,SCN,OVR=bingo() end end t=t+1 end local function mSCN(li) palpor(palt,(sen((li/68)*pi+t/30)/3)+1) end local function mOVR() poke(0x03FF8, 4) cls(4) number(money(),167,17) printf("CREDITS:",48,22) spr(268,104,48,0,2,0,0,2,2) spr(266,104,88,0,2,0,0,2,2) -- printf(x.." "..y) end return mTIC,mSCN,mOVR end function slot()------------- t=0 local win={300,150,66,33,22,15,10} local win2={7,4,3,2,2,2,1} local com={7,3} --local win={600,300,150,75,50,30,20} --local win2={10,6,5,4,3,2,1} --local com={10,5} local chril={1,1,1} local posr={0,0,0} local bet=1 local filas=1 local stat=0 local lastwin=0 local ril={ { {sm=1,pro=1},{sm=0,pro=0}, {sm=2,pro=2},{sm=0,pro=0}, {sm=3,pro=2},{sm=0,pro=0}, {sm=4,pro=2},{sm=0,pro=0}, {sm=5,pro=2},{sm=0,pro=0}, {sm=6,pro=2},{sm=0,pro=0}, {sm=7,pro=3},{sm=0,pro=0}}, { {sm=1,pro=1},{sm=0,pro=0}, {sm=4,pro=2},{sm=0,pro=0}, {sm=6,pro=3},{sm=0,pro=0}, {sm=3,pro=2},{sm=0,pro=0}, {sm=2,pro=1},{sm=0,pro=0}, {sm=7,pro=3},{sm=0,pro=0}, {sm=5,pro=2},{sm=0,pro=0}}, { {sm=1,pro=1},{sm=0,pro=0}, {sm=3,pro=1},{sm=0,pro=0}, {sm=7,pro=3},{sm=0,pro=0}, {sm=6,pro=3},{sm=0,pro=0}, {sm=5,pro=3},{sm=0,pro=0}, {sm=4,pro=2},{sm=0,pro=0}, {sm=2,pro=1},{sm=0,pro=0}, }, } --[[{ {sm=1,pro=1},{sm=0,pro=1}, {sm=2,pro=2},{sm=0,pro=1}, {sm=3,pro=2},{sm=0,pro=1}, {sm=4,pro=2},{sm=0,pro=1}, {sm=5,pro=2},{sm=0,pro=1}, {sm=6,pro=2},{sm=0,pro=1}, {sm=7,pro=3},{sm=0,pro=1}}, { {sm=1,pro=1},{sm=0,pro=1}, {sm=4,pro=2},{sm=0,pro=1}, {sm=6,pro=3},{sm=0,pro=1}, {sm=3,pro=2},{sm=0,pro=1}, {sm=2,pro=1},{sm=0,pro=1}, {sm=7,pro=3},{sm=0,pro=1}, {sm=5,pro=2},{sm=0,pro=1}}, { {sm=1,pro=1},{sm=0,pro=1}, {sm=3,pro=1},{sm=0,pro=1}, {sm=7,pro=3},{sm=0,pro=1}, {sm=6,pro=3},{sm=0,pro=1}, {sm=5,pro=3},{sm=0,pro=1}, {sm=4,pro=2},{sm=0,pro=1}, {sm=2,pro=1},{sm=0,pro=1}, }, } ]]-- local dray=52 local off={0,8,12,14} local firstime=true local paloy=16 local function palo() local x1,y1=233,dray+16 local x2,y2=213-10*sen(pi*(paloy-16)/104),paloy linea(x1,y1,x2,y2,0,6) linea(x1,y1,x2,y2,15,4) linea(x1+3,y1-1,x2+3,y2-1,14,1) line(x1+3,y1-1,x2+3,y2-1,13) circ(x2,y2,15,0) circ(x2,y2,13,1) circ(x2-1,y2-1,11,2) circ(x2-7,y2-7,3,3) end local function palred(pal) for i=cero and 1 or 4,#pal-1,3 do poke(0x03fc0+i-1,min(pal[i]*2,255)) poke(0x03fc0+i,min(pal[i+1]*0.5,255)) poke(0x03fc0+i+1,min(pal[i+2]*0.5,255)) end end local function test() local wi=0 local fi={0,-1,1} for i=1,filas do local si={} for j=1,3 do si[j]=ril[j][(chril[j]-1+fi[i])%14+1].sm end local sim=si[1] local cant={0,0,0,0,0,0,0} cant[0]=0 for j=1,3 do cant[si[j]]=cant[si[j]]+1 or 1 end for j=1,7 do if cant[j]==3 then wi=wi+win[j]*bet elseif cant[j]==2 then if j>3 and cant[j+(j%2==0 and 1 or -1)]==1 then wi=wi+com[j//3]*bet else wi=wi+win2[j]*bet end end end end return wi end local function sSCN(li) if stat>=0 then -----curve local hof,vof=0,0 for i,j in pairs(off)do hof=hof-(lidray+32+j and 1 or 0) vof=vof-(lidray+32+j and li-(dray+32+j) or 0) end if lidray+51 then--103 then vof=135-li end poke(0x03FF9,hof) poke(0x03FFA,vof) --esto cambia cada version ----shadows if li>dray-16 and lidray-5-2 and lidray+32 and li0 then--67 palred(palt) elseif li==dray-3 and filas>1 then--50 palred(palt) elseif li==dray+35 and filas>2 then--86 palred(palt) end else poke(0x03FF9,0) poke(0x03FFA,0) end end local function spin() local function aux(r,n) for k,s in pairs(r) do if n16 then paloy=paloy-3 paloy=paloy<16 and 16 or paloy end ------------------------- if stat==0 then if clic then if x<14 and y<14 then TIC,SCN,OVR=menu() end if x>39 and y>105 and x<72 and y<126 then bet=bet<9 and bet+1 or 1 end if x>110 and y>105 and x<142 and y<126 then -- filas=filas<3 and filas+1 or 1 bet=bet>1 and bet-1 or 9 end if x>134 and y>9 and x<190 and y<31 then stat=-1 end end if x>200 then if pre then paloy=max(16,min(120,y)) end if clic and paloy>80 then if money()>=filas*bet then money(-filas*bet) spin() lastwin=0 stat=1 aux=40 firstime=false end end end elseif stat>=1 and stat<=3 then aux=aux>0 and aux-1 or 0 for i=stat,3 do posr[i]=posr[i]+4 end if aux==0 and posr[stat]%of>(chril[stat]-1)*24 and posr[stat]%of<(chril[stat]-1)*24+5 then posr[stat]=(chril[stat]-1)*24 stat=stat+1 end elseif stat==4 then lastwin=test() money(lastwin) stat=0 if lastwin>0 then sfx(15,"A-5",150) end elseif stat==-1 then if clic then if x<14 and y<14 then stat=0 end end end t=t+1 end local function sOVR(li) poke(0x03FF8, 4) cls(4) if stat>=0 then rect(0,0,240,4,8) rect(216,0,24,136,8) poke4(2*0x03FFC,4) palmap({9,10,12}) map(30,135,30,18,0,-4,0) if stat==0 then palmap({12,13,14}) else palmap({13,14,15}) end map(35,13,4,2,40,108) map(35,13,4,2,112-2,108) poke4(2*0x03FFC,2) palmap() number(lastwin,183,13) printf("WIN:",135,18) number(money(),119,13) printf("Credits:",17,18) -- number(filas,156,109) number(bet,84,109) -- printf("Line",118,113,stat==0 and 5 or 6) printf("BET-",118-2,113,stat==0 and 5 or 6) printf("BET+",48-2,113,stat==0 and 5 or 6) palo() else poke(0x03FF8, 11) -- cls(13) local perm={0,0,1,1,0,1,0,0} poke4(2*0x03FFC,4) palmap({9,10,12}) map(90,0) poke4(2*0x03FFC,2) palmap() map(91,1,28,15,8,8) for i=1,3 do for j=0,1 do spr(8+j*4+perm[(t//60)%6+i]*2,176+(i-1)*16,16+j*32,-1,1,0,0,2,2) end end for i=1,7 do printf("= "..win[i],62,21+(i-1)*16) printf("= "..win2[i],143,21+(i-1)*16) end for i=1,2 do printf("=",143+23,21+(i-1)*32) end end spr(270,-1,-1,15,1,0,0,2,2) -- printf(x.." "..y) if firstime then local k=16+(t//1)%100 if k<85 then linea(212,k,212,k+15,6,3) linea(212,k+15,212-6,k+15-6,6,3) linea(212,k+15,212+6,k+15-6,6,3) linea(212,k,212,k+15,5,1) linea(212,k+15,212-6,k+15-6,5,1) linea(212,k+15,212+6,k+15-6,5,1) elseif k<100 then local j=(k-85)/2 local di={{-1,-1},{-1,1},{1,-1},{1,1}} for i=1,4 do linea(212+(j+5)*di[i][1],105+(j+5)*di[i][2],212+(j+10)*di[i][1],105+(j+10)*di[i][2],6,3) linea(212+(j+5)*di[i][1],105+(j+5)*di[i][2],212+(j+10)*di[i][1],105+(j+10)*di[i][2],5,1) end end end end return sTIC,sSCN,sOVR end-- slot ---------------- function ruleta() local function rTIC() end local function rSCN(li) end local function rOVR() end return rTIC,rSCN,rOVR end function bingo() palpor(palt) local bing={{"B",2},{"I",3},{"N",6},{"G",9},{"O",4}} local sali={} sali[0]=true local nume={} local last=0 for i=1,75 do ins(nume,i) end local function carton() local car={} for i=1,5 do car[i]={} local num={} for n=1,15 do num[n]=n+(i-1)*15 end for j=1,5 do if i==3 and j==3 then ins(car[i],{0,true}) else ins(car[i],{rem(num,rnd(1,#num)),false}) end end end return car end local carts={} for i=1,4 do ins(carts,carton()) end local play={} for i=1,5 do ins(play,carton()) end local function chekbng(car) for i=1,5 do local fil,col,dig=true,true,true for j=1,5 do if not car[i][j][2]or not sali[car[i][j][1]] then col=false end if not car[j][i][2]or not sali[car[j][i][1]] then fil=false end if i==1 then if not car[j][j][2]or not sali[car[j][j][1]] then dig=false end elseif i==5 then if not car[j][6-j][2]or not sali[car[j][6-j][1]] then dig=false end else dig=false end end if dig or col or fil then return true end end return false end local function cheknum(car,num) local col=((num-1)//15)+1 for f,n in pairs(car[col])do if n[1]==num then n[2]=true end end end local function drawcart(cart,x,y,small,size) if small then for c,col in pairs(cart)do for f,num in pairs(col)do rect(x+(c-1)*size,y+(f-1)*size,size,size,num[2] and 2 or (13-(c+f)%2)) end end else size=14 rect(x,y,size*5+1,size*5+1,12) for c,col in pairs(cart)do rect(x+(c-1)*size,y-7,size,7,bing[c][2]) rectb(x+(c-1)*size,y-8,size+1,9,15) printm(bing[c][1],x+(c-1)*size+size/2+1,y-4,12) for f,num in pairs(col)do if num[2] then circ(size/2+x+(c-1)*size,size/2+y+(f-1)*size,size/2,2) end rectb(x+(c-1)*size,y+(f-1)*size,size+1,size+1,15) printm(num[1],x+(c-1)*size+size/2+1,y+(f-1)*size+size/2,num[2]and 12 or 0,size//13) end end end end local pri=2 local off=80 local function bTIC() cls(7) if btnp(0) then pri=pri+1 end if btnp(1) then pri=pri-1 end if off~=(pri-1)*80 then off=off+(off<(pri-1)*80 and 4 or -4) end if btnp(4) then last=rem(nume,rnd(1,#nume)) for _,cart in pairs(carts)do cheknum(cart,last) end sali[last]=true for _,ply in pairs(play)do cheknum(ply,last) end end end local function bSCN(li) end local function bOVR() poke(0x03FF8, 5) cls(5) local x,y=mouse() for i,cart in pairs(carts)do drawcart(cart,14-off+(i-1)*80,33) if chekbng(cart)then print("BINGO!!",50,50) end end print(x .." ".. y) print(last,0,8) print(off,0,16) for i=1,#play do drawcart(play[i],i*30-20,110,true,4) if chekbng(play[i])then print("PERDISTE!!",50,50) end end --los numeros que salieron rect(178,0,240-178,136,0) rectb(178,0,240-178,136,13) local xof,yof=173,9 for i=1,5 do printm(bing[i][1],xof+i*12,yof-2,bing[i][2]) for j=1,15 do local n=(i-1)*15+j printm(n,xof+i*12,yof+j*8,sali[n]and bing[i][2] or 1) end end ---------- t=t+1 printf("IN CONSTUCTION!",8,16+math.sin(t/50)*10,4,0,2) end return bTIC,bSCN,bOVR end --TIC,SCN,OVR=bingo() TIC,SCN,OVR=menu()