{"name":"memory probe 6","description":"-- memory probe 6\n-- alexthescott\n-- 10/4/21 9:12pm\n\n-- new seed every day of the year \nsrand(31*stat(81)+stat(82)) \n\np1={7,6,15,143,4,141,13,134,5,133,2,1,130,128,129,0}\np2={7,135,143,14,9,142,137,8,136,2,134,4,132,133,130,0}\np3={7,6,134,13,12,2,141,5,140,131,1,129,133,130,128,0}\n\np={p1,p2,p3}\nc=p[1+rnd(#p)\\1]\n\npal(c,1)\n\ncnt=rnd(2)\\1\n\nfunction new_obj()\n\tobj={}\n\tobj.pos={x=rnd(128)\\1,y=rnd(128)\\1}\n\tobj.a=rnd()\n\tobj.vel={x=cos(obj.a)/2,y=sin(obj.a)/2}\n\t-- grid position \n\tobj.grid_size=16\n\tobj.g_pos={}\n\tobj.g_pos.x=obj.pos.x\\obj.grid_size\n\tobj.g_pos.y=obj.pos.y\\obj.grid_size\n\tobj.pop={}\n\t\n\tobj.draw=function(self)\n\t\tfor i=1,#self.pop do\n\t\t\tcirc(self.pos.x,self.pos.y,self.pop[i],2)\n\t\tend\n\tend\n\t\n\tobj.update=function(self)\n\t\tself.pos.x+=self.vel.x\n\t\tself.pos.y+=self.vel.y\n\t\t\n\t\tif self.pos.x<0 or\n\t\t\tself.pos.x>128 then\n\t\t\t\tself.vel.x*=-1\n\t\tend\n\t\t\n\t\tif self.pos.y<0 or\n\t\t\tself.pos.y>128 then\n\t\t\t\tself.vel.y*=-1\n\t\tend\n\t\t\n\t\tfor i=1,#self.pop do\n\t\t\t\tif self.pop[i]!=nil and\n\t\t\t\t self.pop[i]>=14 then\n\t\t\t\t\t\tdel(self.pop,self.pop[i])\n\t\t\t\telseif self.pop[i]!=nil then\n\t\t\t\t\tself.pop[i]+=rnd()/4\n\t\t\t\tend\n\t\tend\n\t\n\t\tself.g_pos.x=self.pos.x\\self.grid_size\n\t\tself.g_pos.y=self.pos.y\\self.grid_size\n\tend\n\t\n\tobj.new_pop=function(self)\n\t\tadd(self.pop,1)\n\tend\n\t\n\tobj.nearby=function(self,a)\n\t\t\tlocal sgp=self.g_pos\n\t\t\tlocal sp=self.pos\n\t\t\tfor o in all(a) do\n\t\t\t\tlocal ogp=o.g_pos\n\t\t\t\tlocal op=o.pos\n\t\t\t\t-- draw above\n\t\t\t\tif sgp.y<128/self.grid_size\n\t\t\t\t\tand ogp.y-1==sgp.y\n\t\t\t\t\tand abs(ogp.x-sgp.x)<=1 then\n\t\t\t\t\t\tline(op.x,op.y,sp.x,sp.y,1)\n\t\t\t\t-- draw right\n\t\t\t\telseif sgp.x<128/self.grid_size\n\t\t\t\t\tand ogp.x-1==sgp.x\n\t\t\t\t\tand abs(ogp.y-sgp.y)<=1 then\n\t\t\t\t\tline(op.x,op.y,sp.x,sp.y,1)\n\t\t\t\t-- draw below\n\t\t\t\telseif sgp.y>0\n\t\t\t\t\tand ogp.y+1==sgp.y\n\t\t\t\t\tand abs(ogp.x-sgp.x)<=1 then\n\t\t\t\t\tline(op.x,op.y,sp.x,sp.y,1)\n\t\t\t\t-- draw left\n\t\t\t\telseif sgp.x>0\n\t\t\t\t\tand ogp.x+1==sgp.x\n\t\t\t\t\tand abs(ogp.y-sgp.y)<=1 then\n\t\t\t\t\tline(op.x,op.y,sp.x,sp.y,1)\n\t\t\t\tend\n\t\tend\n\tend\n\t\n\treturn obj\nend\n\nfunction new_set()\n\tset={}\n\tset.objs={}\n\tfor i=1,32-8*(cnt) do\n\t\tadd(set.objs,new_obj())\n\tend\n\t\n\tset.run=function(self)\n\t\tfor o in all(self.objs) do\n\t\t\to:update()\n\t\t\to:nearby(self.objs)\n\t\t\to:draw()\n\t\tend\n\tend\n\t\n\tset.new_pop=function(self)\n\t\tfor o in all(self.objs) do\n\t\t\tif rnd(1)<=0.3 then\n\t\t\t\to:new_pop()\n\t\t\tend\n\t\tend\n\tend\n\t\n\treturn set\nend\n\ndir=((1+rnd(2)\\1)*2-3)\n\nfunction burn()\n\tfor i=1,1024+1024*(cnt) do\n\t\tp=0x6000+rnd(8128)\\1\n\t\tpoke(p-dir,peek(p)-1)\n\tend\nend\n\nfunction forward()\n\tv=c[1]\n\tdel(c,v)\n\tc[#c+1]=v\n\tpal(c,1)\nend\n\nfunction backward()\n\tv=c[#c]\n\tdel(c,v)\n\tfor i=#c+1,1,-1 do\n\t\tif i!=1 then\n\t\t\tc[i]=c[i-1]\n\t\telse\n\t\t\tc[i]=v\n\t\tend\n\tend\n\tpal(c,1)\nend\n\ns=new_set()\n\nfor i=1,rnd()*16 do\n\tforward()\nend\n\nmonth=stat(81)\nday=stat(82)\n\ncls()\n_set_fps(60)\n::♥::\nif t()<2 then\n\tprint(\"memory probe 6\",36,59,1)\n\tprint(month..\"/\"..day,55,65)\nelse\n\tburn()\n\ts:run()\n\tb=(t()*60)%128\n\t\n\tpset(b,127,rnd()*16)\n\tpset(b,126,rnd()*16)\n\tpset(128-b,0,rnd()*16)\n\tpset(127-b,1,rnd()*16)\n\tpset(0,b,rnd()*16)\n\tpset(1,b,rnd()*16)\n\tpset(127,128-b,rnd()*16)\n\tpset(126,128-b,rnd()*16)\n\t\n\tif btnp(❎) or btnp(🅾️) then\n\t\t\ts:new_pop()\n\tend\n\t\n\tif btnp(⬆️) or btnp(⬅️) then\n\t\tforward()\n\tend\n\t\t\n\tif btnp(⬇️) or btnp(➡️) then\n\t\tbackward()\n\tend\nend\nflip()\ngoto ♥","tags":["pico-8","pico8","interactive"],"symbol":"OBJKT","artifactUri":"ipfs://QmaePbiMDcMexKpVmKgmh7UbC5rpYraFAA8uKCg6CqfVxv","displayUri":"ipfs://QmR3ikxhFD3zaLRFdPFdZQCrqFaFvHqfFwKF5AgtpBHx8n","thumbnailUri":"ipfs://QmNrhZHUaEqxhyLfqoq1mtHSipkWHeT31LNHb1QEbDHgnc","creators":["tz1St3n29AbYXZXV8W1BG41qYzz86J2CFAW7"],"formats":[{"uri":"ipfs://QmaePbiMDcMexKpVmKgmh7UbC5rpYraFAA8uKCg6CqfVxv","mimeType":"application/x-directory"}],"decimals":0,"isBooleanAmount":false,"shouldPreferSymbol":false}