{"name":"unsacred geometry","description":"-- unsacred geometry\n-- alexthescott\n-- 22/3/19\n\n-- new seed every day of the year \nsrand(31*stat(81)+stat(82)) \n\np1={[0]=129,1,133,130,2,136,8,137,142,14,143,15,135,7}\np2={[0]=0,128,130,2,129,1,131,140,12,139,138,10,135,7}\np3={[0]=0,128,130,133,5,132,4,142,137,14,143,15,135,7}\np={p1,p2,p3}\nc=rnd(p)\npal(c,1)\n\n-- framecount\nf=rnd(1)\n-- line count\nv=64\n-- geometry seed\nq=30+rnd(22)\\1\n-- ants seed\ng=rnd()\n\nmonth=stat(81)\nday=stat(82)\n\ncls(0)\n_set_fps(60)\n::♥::\nif t()<2 then\n\tprint(\"unsacred geometry\",30,59,7)\n\tprint(month..\"/\"..day,55,65)\nelse\n\t-- party determine glitch rate\n\t-- and burn type (classic, radial)\n\tparty=rnd()<(1+sin(0.5-f))/2\n\t\n\t-- burn method, ❎ will show\n\t-- skeleton of the sketch\n\tif not btn(❎) then\n\t\tfor i=0,1500 do\n\t\t\tx=rnd(128)\n\t\t\ty=rnd(128)\n\t\t\t-- radial burn\n\t\t\tif not party then\n\t\t\t\ta=atan2((64-x)/128,(64-y)/128)\n\t\t\t\tx2=x-cos(a)\n\t\t\t\ty2=y-sin(a)\n\t\t\t\tpset(x2,y2,max(pget(x,y)-1,0))\n\t\t\t-- og burn\n\t\t\telse\n\t\t\t\tpset(x,y,max(pget(x,y)-1,0))\n\t\t\tend\n\t\tend\n\telse\n\t\tcls(0)\n\tend\n\t\n\t-- draw geometry\n\t-- rotate lines around a circle\n\tfor i=f,v+f do\n\t\t\t-- change color if ❎ pressed\n\t\t\tpc=13\n\t\t\tif(btn(❎))pc=1\n\t\t\ta=i/v\n\t\t\tb=i/(v/q)\n\t\t\tc=(i+1)/v\n\t\t\td=(i+1)/(v/q)\n\t\t\tx1=64+cos(a)*24+cos(b+f)*22\n\t\t\ty1=64+sin(a)*24+sin(b+f)*22\n\t\t\tx2=64+cos(c)*24+cos(d+f)*22\n\t\t\ty2=64+sin(c)*24+sin(d+f)*22\n\t\t\tline(x1,y1,x2,y2,pc)\n\tend\n\t\n\t-- glitch effect\n\t-- poke pushes screen to sprsheet\n\tif not btn(❎) then\n\t\tfor i=0,1 do\n\t\t\tif rnd(0.5)<(1+sin(f/2))/2 then\n\t\t\t\tif f*100%8<=4 then\n\t\t\t\t\tw=3+rnd(10)\n\t\t\t\t\th=10+rnd(86)\n\t\t\t\telse\n\t\t\t\t\tw=10+rnd(86)\n\t\t\t\t\th=3+rnd(10)\n\t\t\t\tend\n\t\t\t\tx=rnd(128-w)\n\t\t\t\ty=rnd(128-h)\n\t\t\t\txo=rnd(4)*(1-2*(rnd(2)\\1))\n\t\t\t\tyo=rnd(4)*(1-2*(rnd(2)\\1))\n\t\t\t\tsspr(x,y,w,h,x+xo,y+yo,w,h)\n\t\t\tend\n\t\tend\n\tend\n\tpoke(0x5f55,0x6000,8192)\n\t\n\t-- draw colorful circle \n\tfor i=0,300 do\n\t\ta=f/8+i/300\n\t\tx=64+50*cos(a)\n\t\ty=64+50*sin(a)\n\t\tpset(x,y,1+i/24)\n\tend\n\t\n\t-- draw rotating square border\n\t-- ty john huges on stackoverflow for the maths\n\t-- https://math.stackexchange.com/questions/2468060/find-x-y-coordinates-of-a-square-given-an-angle-alpha\n\tfor e=0,4 do\n\t\tfor i=0,100 do\n\t\t\tgl=1\n\t\t\tif(g>0.25)gl=g\n\t\t\ta=f\n\t\t\tz=60-sin(f)-e*2\n\t\t\tk=max(abs(cos(a+i/100+e/8)),abs(sin(a+i/100+e/8)))\n\t\t\txr=z*cos(f+i/100+gl*e/8)/k\n\t\t\tyr=z*sin(f+i/100+e/8/gl)/k\n\t\t\tpset(64+xr,64+yr,1+i/8)\n\t\tend\n\tend\n\t\n\t-- increment framecount\n\tf+=.00025\n\t\n\tif btn(❎) then\n\t\tflip()\n\tend\n\t\n\t-- nothing lasts forever...\n\tif f>=256 then\n\t\textcmd(\"reset\")\n\tend\nend\ngoto ♥","tags":["pico-8","pico8","opensource","pixelart"],"symbol":"OBJKT","artifactUri":"ipfs://QmZQxH6nbdysnWWhkzfD25T3sUXis5oUjoELTvZf7b8QXX","displayUri":"ipfs://QmShWuLtSBfj7fiGrm8xi7QP6WV78GSe353mstunLSoXRq","thumbnailUri":"ipfs://QmNrhZHUaEqxhyLfqoq1mtHSipkWHeT31LNHb1QEbDHgnc","creators":["tz1St3n29AbYXZXV8W1BG41qYzz86J2CFAW7"],"formats":[{"uri":"ipfs://QmZQxH6nbdysnWWhkzfD25T3sUXis5oUjoELTvZf7b8QXX","mimeType":"application/x-directory"}],"decimals":0,"isBooleanAmount":false,"shouldPreferSymbol":false}