arkivo.art

bad atom atl

alexthescott

-- bad atom alt -- alexthescott -- 9/23/21 10:27pm -- ❎,🅾️ change to big burn -- ⬅️⬆️➡️⬇️ keys cls() --p={8,136,130,11,139,131,12,140,129} p={7,134,133,14,136,141,13,141,1} pal(p,1) -- new seed every day of the year srand(31*stat(81)+stat(82)) function new_obj(r,col) obj={} obj.col=col obj.point={x=64,y=64} -- state obj.grow=true obj.need_new=false obj.kill=false -- color transition obj.life_span=r obj.timer=0 -- radius, rad_goal (spawn) -- rad vel, acc obj.r=0 obj.rg=r obj.rv=0.25 obj.ra=0.1 -- angle, angle span obj.a=rnd() obj.span=.075 -- x,y flip on even odd day obj.coin=stat(82)%2==0 obj.coin=true obj.var=1+rnd() obj.draw=function(self) local p=self.point local a1=self.a-self.span/2 local a2=self.a+self.span/2 -- an if statment in the for -- loop felt wrong... if self.coin==true then x=p.x+cos(a2/self.var)*self.r y=p.y+sin(a2)*self.r if self.grow==false then circ(x,y,2,0) circ(x,y,3,0) end for at=a2,a1,-0.002 do x=p.x+cos(at/self.var)*self.r y=p.y+sin(at)*self.r if at<=self.a then circfill(x,y,0,self.col) else circfill(x,y,1,self.col) end end else x=p.x+cos(a2)*self.r y=p.y+sin(a2/self.var)*self.r if self.grow==false then circ(x,y,2,0) circ(x,y,3,0) end for at=a2,a1,-0.002 do x=p.x+cos(at)*self.r y=p.y+sin(at/self.var)*self.r if at<=self.a then circfill(x,y,0,self.col) else circfill(x,y,1,self.col) end end end end obj.update=function(self) self.a+=0.005 if self.need_next==true and self.timer>=0 then self.timer-=1 if self.timer<=0 then self.col=self.next_col self.need_next=false end end if self.grow==true and self.r<=self.rg then circ(64,64,self.r*2) self.r+=0.005 self.r*=1.05 if self.r>=self.rg then self.grow=false end end if self.kill==true then self.r+=self.rv self.rv+=self.ra end end obj.new_col=function(self,new) self.next_col=new self.timer=self.life_span self.need_next=true end obj.destroy=function(self) local p=self.point if self.coin then x=p.x+cos(self.a/self.var)*self.r y=p.y+sin(self.a)*self.r if x<=0 or x>=128 or y<=0 or y>=128 then del(objs,self) end else x=p.x+cos(self.a)*self.r y=p.y+sin(self.a/self.var)*self.r if x<=0 or x>=128 or y<=0 or y>=128 then del(objs,self) end end end return obj end function burn() for i=1,800 do x=rnd(128)\1 y=rnd(128)\1 pc=pget(x,y) if pc!=0 and pc%3!=0 then circfill(x,y,1,pc+1) circfill(x-1,y,1,pc+1) circfill(x+1,y,1,pc+1) else pset(x,y,0) end end end function big_burn() for i=1,800 do x=rnd(128)\1 y=rnd(128)\1 pc=pget(x,y) if pc!=0 and pc%3!=0 then if rnd()<0.25 then circfill(x,y,2,pc+1) else circfill(x,y,1,pc) end else pset(x-1,y,0) pset(x+1,y,0) end end end objs={} fc=0 life_frame=1200 global_color=1+3*(rnd(3)\1) for i=1,32 do add(objs,new_obj(i*2,global_color)) end month=stat(81) day=stat(82) _set_fps(60) cls() ::♥:: if t()<2 then print("bad atom alt",40,59,global_color) print(month.."/"..day,55,65) else if btn(4) or btn(5) then big_burn() elseif btn(0) or btn(1) or btn(2) or btn(3) then cls() else burn() end for obj in all(objs) do obj:draw() obj:update() obj:destroy() end fc+=1 if fc%(life_frame*6)!=0and fc%life_frame==0 then global_color+=3 global_color%=9 for obj in all(objs) do obj:new_col(global_color) end end if fc%(life_frame*6)==0 then for obj in all(objs) do obj.kill=true end end -- spwan new set after last cycle if fc%(life_frame*6.25)==0 then global_color+=3 global_color%=9 for i=1,32 do add(objs,new_obj(i*2,global_color)) end fc=0 end end flip() goto ♥

Blockchain tezos
Smart Contract KT1RJ6PbjHpwc3M5rw5s2Nbmefwbuwbdxton
Platform HEN
Token ID 354323
Minted at 25 Sep 2021, 01:13 UTC

Metadata URI Metadata URI
Artifact URI Artifact URI

pico8 , pico-8

JavaScript true
Networked false

Timestamp (UTC) 2024-08-17T09:53:10.349Z
Snapshot version 1
External network calls 0
Download Snapshot Download
Snapshot Image