{"name":"bad atom atl","description":"-- bad atom alt\n-- alexthescott\n-- 9/23/21 10:27pm\n\n-- ❎,🅾️ change to big burn\n-- ⬅️⬆️➡️⬇️ keys cls() \n\n--p={8,136,130,11,139,131,12,140,129}\np={7,134,133,14,136,141,13,141,1}\n\npal(p,1)\n\n-- new seed every day of the year\nsrand(31*stat(81)+stat(82))\n\nfunction new_obj(r,col)\n\tobj={}\n\tobj.col=col\n\tobj.point={x=64,y=64}\n\n\t-- state\n\tobj.grow=true\n\tobj.need_new=false\n\tobj.kill=false\n\t\n\t-- color transition\n\tobj.life_span=r\n\tobj.timer=0\n\t\n\t-- radius, rad_goal (spawn)\n\t-- rad vel, acc\n\tobj.r=0\n\tobj.rg=r\n\tobj.rv=0.25\n\tobj.ra=0.1\n\t\n\t-- angle, angle span\n\tobj.a=rnd()\n\tobj.span=.075\n\t\n\t-- x,y flip on even odd day\t\n\tobj.coin=stat(82)%2==0\n\tobj.coin=true\n\tobj.var=1+rnd()\n\t\n\tobj.draw=function(self)\n\t\tlocal p=self.point\n\t\tlocal a1=self.a-self.span/2\n\t\tlocal a2=self.a+self.span/2\n\t\t\n\t\t-- an if statment in the for\n\t\t-- loop felt wrong...\n\t\tif self.coin==true then\n\t\t\tx=p.x+cos(a2/self.var)*self.r\n\t\t\ty=p.y+sin(a2)*self.r\n\t\t\tif self.grow==false then\n\t\t\t\tcirc(x,y,2,0)\n\t\t\t\tcirc(x,y,3,0)\n\t\t\tend\n\t\t\tfor at=a2,a1,-0.002 do\n\t\t\t\tx=p.x+cos(at/self.var)*self.r\n\t\t\t\ty=p.y+sin(at)*self.r\n\t\t\t\tif at<=self.a then\n\t\t\t\t\tcircfill(x,y,0,self.col)\n\t\t\t\telse\n\t\t\t\t\tcircfill(x,y,1,self.col)\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\tx=p.x+cos(a2)*self.r\n\t\t\ty=p.y+sin(a2/self.var)*self.r\n\t\t\tif self.grow==false then\n\t\t\t\tcirc(x,y,2,0)\n\t\t\t\tcirc(x,y,3,0)\n\t\t\tend\n\t\t\tfor at=a2,a1,-0.002 do\n\t\t\t\tx=p.x+cos(at)*self.r\n\t\t\t\ty=p.y+sin(at/self.var)*self.r\n\t\t\t\tif at<=self.a then\n\t\t\t\t\tcircfill(x,y,0,self.col)\n\t\t\t\telse\n\t\t\t\t\tcircfill(x,y,1,self.col)\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend\n\t\n\tobj.update=function(self)\n\t\tself.a+=0.005\n\t\t\n\t\tif self.need_next==true \n\t\t\tand self.timer>=0 then\n\t\t\t\tself.timer-=1\n\t\t\t\tif self.timer<=0 then\n\t\t\t\t\tself.col=self.next_col\n\t\t\t\t\tself.need_next=false\n\t\t\t\tend\n\t\tend\n\t\t\n\t\tif self.grow==true and\n\t\t\tself.r<=self.rg then\n\t\t\t\tcirc(64,64,self.r*2)\n\t\t\t\tself.r+=0.005\n\t\t\t\tself.r*=1.05\n\t\t\t\tif self.r>=self.rg then\n\t\t\t\t\tself.grow=false\n\t\t\t\tend\n\t\tend\n\t\t\n\t\tif self.kill==true then\n\t\t\tself.r+=self.rv\n\t\t\tself.rv+=self.ra\n\t\tend\n\t\t\n\tend\n\t\n\tobj.new_col=function(self,new)\n\t\tself.next_col=new\n\t\tself.timer=self.life_span\n\t\tself.need_next=true\n\tend\n\t\n\tobj.destroy=function(self)\n\t\tlocal p=self.point\n\t\tif self.coin then\n\t\t\tx=p.x+cos(self.a/self.var)*self.r\n\t\t\ty=p.y+sin(self.a)*self.r\n\t\t\tif x<=0 or x>=128 or \n\t\t\t\ty<=0 or y>=128 then\n\t\t\t\t\tdel(objs,self)\n\t\t\tend\n\t\telse\n\t\t\tx=p.x+cos(self.a)*self.r\n\t\t\ty=p.y+sin(self.a/self.var)*self.r\n\t\t\tif x<=0 or x>=128 or \n\t\t\t\ty<=0 or y>=128 then\n\t\t\t\t\tdel(objs,self)\n\t\t\tend\n\t\tend\n\tend\n\t\n\treturn obj\nend\n\nfunction burn()\n\tfor i=1,800 do \n\t\tx=rnd(128)\\1\n\t\ty=rnd(128)\\1\n\t\tpc=pget(x,y)\n\t\tif pc!=0 and pc%3!=0 then\n\t\t\tcircfill(x,y,1,pc+1)\n\t\t\tcircfill(x-1,y,1,pc+1)\n\t\t\tcircfill(x+1,y,1,pc+1)\n\t\telse\n\t\t\tpset(x,y,0)\n\t\tend\n\tend\nend\n\nfunction big_burn()\n\tfor i=1,800 do \n\t\tx=rnd(128)\\1\n\t\ty=rnd(128)\\1\n\t\tpc=pget(x,y)\n\t\tif pc!=0 and pc%3!=0 then\n\t\t\tif rnd()<0.25 then\n\t\t\t\tcircfill(x,y,2,pc+1)\n\t\t\telse\n\t\t\t\tcircfill(x,y,1,pc)\n\t\t\tend\n\t\telse\n\t\t\tpset(x-1,y,0)\n\t\t\tpset(x+1,y,0)\n\t\tend\n\tend\nend\n\nobjs={}\nfc=0\nlife_frame=1200\nglobal_color=1+3*(rnd(3)\\1)\n\nfor i=1,32 do\n\tadd(objs,new_obj(i*2,global_color))\nend\n\nmonth=stat(81)\nday=stat(82)\n\n_set_fps(60)\n\ncls()\n::♥::\nif t()<2 then\n\tprint(\"bad atom alt\",40,59,global_color)\n\tprint(month..\"/\"..day,55,65)\nelse\n\tif btn(4) or btn(5) then\n\t\tbig_burn()\n\telseif btn(0) or btn(1) or\n\t\tbtn(2) or btn(3) then\n\t\t\tcls()\n\telse\n\t\tburn()\n\tend\n\t\n\tfor obj in all(objs) do\n\t\tobj:draw()\n\t\tobj:update()\n\t\tobj:destroy()\n\tend\n\t\n\tfc+=1\n\t\n\tif fc%(life_frame*6)!=0and\n\t\tfc%life_frame==0 then\n\t\t\tglobal_color+=3\n\t\t\tglobal_color%=9\t\n\t\t\tfor obj in all(objs) do\n\t\t\t\tobj:new_col(global_color)\n\t\t\tend\n\tend\n\t\n\tif fc%(life_frame*6)==0 then\n\t\tfor obj in all(objs) do\n\t\t\tobj.kill=true\n\t\tend\n\tend\n\t\n\t-- spwan new set after last cycle\n\tif fc%(life_frame*6.25)==0 then\n\t\tglobal_color+=3\n\t\tglobal_color%=9\n\t\tfor i=1,32 do\n\t\t\tadd(objs,new_obj(i*2,global_color))\n\t\tend\n\t\tfc=0\n\tend\n\t\nend\nflip()\ngoto ♥","tags":["pico-8","pico8"],"symbol":"OBJKT","artifactUri":"ipfs://Qma59SYrPmdGk2vNtcNybJpqbB17CCRr6W2jCPorc317VM","displayUri":"ipfs://Qmar35qgSXKURANbmXX4gaHh7nhKKa5NyEXoH66Qt6T8mu","thumbnailUri":"ipfs://QmNrhZHUaEqxhyLfqoq1mtHSipkWHeT31LNHb1QEbDHgnc","creators":["tz1St3n29AbYXZXV8W1BG41qYzz86J2CFAW7"],"formats":[{"uri":"ipfs://Qma59SYrPmdGk2vNtcNybJpqbB17CCRr6W2jCPorc317VM","mimeType":"application/x-directory"}],"decimals":0,"isBooleanAmount":false,"shouldPreferSymbol":false}