0,]']>S}Wup8d%qy)6o;]AsVl30????? @@@@@@@@@BOOOOOOOOOOOOOOOOOOOOPPPQRRSTUVWXY[[\^_____________` !""#$%'(+,.///////////// !"#$$%%&&''(()**++,,--....///025689:=??????????????????????) a aa a a a aa  a  b b b b b b b b b b b b   a aa a a a a a aa a a a a b b b b b b     0q< P P` @03f @PU @ ` @p0 0  0@  p0PP p  p0P @Dw p p @  P0 p 3`  `   @pw 03 `  P `@ ` P 0 "Up 3`f P 0      1 3 133 P @pw 0333333 3333313333333133333A133333333<<$33333C""D43333333331$31DD2C3133333A3333"L"33333333333"3#","AD3$C333<<$3333333"""""!""C333"C""D433333333 """"""1"22213333"1$31DD2C3<3333333""!"1#"!!233"L"33333 <<333333"#33""3#"P,"AD3$C333 13#3333 3 31333,3#"U!""C333" <331"222!3333" L"23333!"DDD"131313!213"!">3313#!!233" ,"!D3$C333 ""D$"""B"313!23""3333#"""3#"!""C333",B"""""B""3333!"1333,33"1"222!3333"" B"""""B"333!!133#23# 13#!!233"  B"""""B1313!233#!"133 33#"""3#" ""D"""""B13!233!!"331333,33" """"B$"""""B3333!""33133#23# "DD""""""B" 3331!"2<!13 33#!"133 BDDDD"` 13"3@!3 3!!"33!"D  "3!!""33"""""""""""""b131!"2<!1311313"3!3  13"3!  13 "113 "BDDDDDDDDDDDDD13 """""""""""""" P   U@Dp0`f P    @  D ` PU@  2 -- title: Santa and the gray cubes -- author: webriprob -- desc: Demo for botb advent calendar 2024 -- site: -- license: creative commons attribution 3.0 -- version: 0.1 -- script: lua tick = 0 test = {} missingboxes =0 maxheight = 0 sleigh = {240,math.random()*80+10} deer = {193,198} canes = {} for i=-50,50 do test[i] = {} for j=-50,50 do test[i][j]={i*5,j*5,i%16+1+j%16+1} end end boxes = {} for i=1,10 do maxheight = math.random()*90 boxes[i]={math.random()*220,maxheight,maxheight,true,math.floor(math.random()*2)} end particlestable = {} function particles(x,y) for i=1,200 do table.insert(particlestable,{x,y,math.random()*16,math.random()*150+50,(math.random()*2)-1,(math.random()*2)-1,math.floor(math.random()*2),math.random()*100}) end createcandycanes(x,y) end function updateparticles(x,y) for i,v in ipairs(particlestable) do v[1]=v[1]+v[5] v[2]=v[2]+v[6] v[8]=v[8]+1 if v[8] > 100 then table.remove(particlestable,i) end end end function renderparticles() for i,v in ipairs(particlestable) do pix(v[1],v[2],v[3]) end end function reindeer() for i=1,8 do if i==2 or i==4 or i==7 or i==8 then spr(deer[1],sleigh[1]+(i*38),sleigh[2]+(math.sin((tick+i*12)/20)*8),0,1,0,0,5,4) else spr(deer[2],sleigh[1]+(i*38),sleigh[2]+(math.sin((tick+i*12)/20)*8),0,1,0,0,5,4) end end spr(203,sleigh[1]+(9*38),sleigh[2]+(math.sin((tick+9*12)/20)*8),0,1,0,0,5,4) sleigh[1]=sleigh[1]-1 if sleigh[1] == -500 then sleigh[1]=240 sleigh[2] = math.random()*80+10 end end function createcandycanes(x,y) for i=1,6 do table.insert(canes,{x,y,math.random()*2-1,math.random()+1,0}) end end function updatecandycanes() for i,v in ipairs(canes) do spr(10,v[1],v[2]-math.sin(v[5])*30*v[4],0) v[5]=v[5]+.05 v[1]=v[1]+v[3] if math.sin(v[5]) < -.5 then table.remove(canes,i) end end end music(0) function TIC() cls(0) for i=-10,50 do for j=-10,50 do test[i][j][1]=test[i][j][1] for k=1,3 do --[[ test[i][j][k]=test[i][j][k]*(math.floor((tick/100)%2)*2-1*1.01) ]]-- end end end for i=-50,50,3 do for j=-50,50,3 do circ((test[i][j][1]+tick%239+math.sin((tick)/50)*3),test[i][j][2],math.random()*2,test[i][j][3]) end end tick = tick + 1 for i,v in ipairs(boxes)do if v[1]+1 > 230 then v[5] = 0 end if v[1]-1 < 0 then v[5] = 1 end if v[5]==1 then v[1]=v[1]+.5 end if v[5]==0 then v[1]=v[1]-.5 end if math.sin((tick+(i*6))*.02)*(136-v[3]) > 0 then v[2]= 136-math.sin((tick+(i*6))*.02)*(136-v[3])-16 else v[2]= 136+math.sin((tick+(i*6))*.02)*(136-v[3])-16 end a,b,c = mouse() if c and a > v[1] and a < v[1]+16 and b > v[2] and b < v[2]+16 then table.remove(boxes,i) missingboxes = missingboxes+1 sfx(0) particles(v[1]+8,v[2]+8) end spr(((math.floor((tick+(i*4))/5%5))*2),v[1],v[2],0,1,0,0,2,2) end if (tick%50) == 0 then if missingboxes > 0 then maxheight = math.random()*90 table.insert(boxes,{math.random()*220,maxheight,maxheight,true,math.floor(math.random()*2)}) missingboxes = missingboxes - 1 end end updateparticles() renderparticles() updatecandycanes() reindeer() print(tick) end