{"name":"horizontal burn alt (memory bug fixed)","description":"-- horizontal burn alt (memory bug fixed)\n-- alexthescott\n-- 9/2/21\n\n--p={8,136,130,11,139,131,12,140,129}\np={7,134,133,14,136,141,13,141,1}\npal(p,1)\n\n-- set btn delay\npoke(0x5f5d, 30)\n\nfunction new_screen()\n\ts={}\n\tfor i=0,128 do\n\t\tadd(s,i)\n\tend\n\treturn s\nend\n\nfunction new_beam(c)\n\tif #screen<1 then\n\t\tscreen=new_screen()\n\t\tglobal_index+=3\n\t\tglobal_index%=9\n\tend\n\t\n\tpoint=screen[1+rnd(#screen)\\1]\n\tdel(screen,point)\n\n\tb={}\n\tb.c=c\n\tb.d=rnd(2)\\1\n\t\n\t-- left, right\n\tif b.d==0 then\n\t\t\tb.x=127\n\t\t\tb.y=point\n\t\t\tb.dx=-2\n\telse\n\t\t\tb.x=0\n\t\t\tb.y=point\n\t\t\tb.dx=2\n\tend\n\t\n\tb.draw=function(self)\n\t\tpset(self.x,self.y,self.c)\n\t\tpset(self.x-1,self.y,self.c)\n\tend\n\t\n\tb.update=function(self)\n\t\tself.x+=self.dx\n\tend\n\t\n\tb.destroy=function(self)\n\t\tif self.x<0 or self.x>129 then\n\t\t\tdel(beams,self)\n\t\tend\n\tend\n\t\n\tadd(beams,b)\nend\n\nfunction burn()\n\tfor p=0,256 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(2)\\1==0 then\n\t\t\t\tpset(x,y,pc+1)\n\t\t\telse\n\t\t\t\tpset(x,y+1,pc+1)\n\t\t\t\tpset(x,y-1,pc+1)\n\t\t\tend\n\t\telseif rnd(3)\\1==0 then\n\t\t\tpset(x,y,0)\n\t\tend\n\tend\nend\n\nscreen=new_screen()\nbeams={}\nglobal_index=1\n\ncls()\n\n::♥::\nif t()<2 then\n\tprint(\"horizontal burn alt\",26,64,1)\nelse\n\tburn()\n\t\n\tif t()%0.125==0 then\n\t\tfor i=1,2 do \n\t\t\tnew_beam(global_index)\n\t\tend \n\tend\n\t\n\t-- diy beam\n\tif btnp(4) or btnp(5) then\n\t\tfor i=1,4 do \n\t\t\tnew_beam(global_index)\n\t\tend \n\tend\n\t\n\tfor b in all(beams) do\n\t\tb:draw()\n\t\tb:update()\n\t\tb:destroy()\n\tend\n\t\n\tflip()\nend\ngoto ♥","tags":["pico8","pico-8"],"symbol":"OBJKT","artifactUri":"ipfs://QmRXKpKWL1Gk5Wt4VkBWLdm85Y1QDtZyXT19fgrUcxzJ6T","displayUri":"ipfs://QmP8FgPM3J8Rz2ppYmVrqHZPjFKnqPuazXSkWqNSuuGd62","thumbnailUri":"ipfs://QmP8FgPM3J8Rz2ppYmVrqHZPjFKnqPuazXSkWqNSuuGd62","creators":["tz1St3n29AbYXZXV8W1BG41qYzz86J2CFAW7"],"formats":[{"uri":"ipfs://QmRXKpKWL1Gk5Wt4VkBWLdm85Y1QDtZyXT19fgrUcxzJ6T","mimeType":"application/x-directory"}],"decimals":0,"isBooleanAmount":false,"shouldPreferSymbol":false}