arkivo.art

Genuary 2024 Day 12 - Lava Lamp

Carson

-- genuary #12 2024 -- lava lamp -- by carson kompon ?"\^!5f100😐1▒🐱☉8" _set_fps(60) o={} z=0 function dist(x,y) return sqrt((x*x+y*y)) end function sdf_circle(x,y,cx,cy,r) x-=cx y-=cy return dist(x,y)-r end function sdf_elipse(x,y,cx,cy,rx,ry) x-=cx y-=cy return dist(x/rx,y/ry)-1 end function sdf(x,y) local topcircle=sdf_elipse(x,y,0,-1,0.8+cos(t()/8)/16,.5+sin(t()/16)/32) local bottomcircle=sdf_elipse(x,y,0,1,0.8+sin(t()/8)/16,.5+cos(t()/16)/32) local cores = min(topcircle,bottomcircle) for s in all(o)do local d=sdf_circle(x,y,s.x,s.y,s.r) cores=min(cores,d) if(s.y<-1 or s.y>=1)del(o,s) end return cores end function lerp(a,b,y) return a+(b-a)*y end ::_:: for s in all(o)do s.x+=s.vx s.y+=s.vy s.r=lerp(s.r,s.tr,.02) end for i=0,200 do x=rnd(2)-1 y=rnd(2)-1 d=sdf(x,y) c=0 if(d<=.02)c=1+((y+1)/2)*6 if(d>.02)c=0 circfill((x+1)*64,(y+1)*64,1,c) if(t()-z>1)then add(o,{ x=rnd(2)-1, y=rnd({-.99,.99}), vx=0.002*rnd({1,-1})*rnd(), vy=0.0065*rnd({1,-1})*(rnd()+.05), tr=rnd(.3)+.01, r=0 }) z=t() end end flip() goto _

Blockchain tezos
Smart Contract KT1RJ6PbjHpwc3M5rw5s2Nbmefwbuwbdxton
Platform HEN
Token ID 844576
Minted at 12 Jan 2024, 13:43 UTC

Metadata URI Metadata URI
Artifact URI Artifact URI

animated , sdf , lava , pixelart , opensource , genuary , pico8 , neoretro , pico-8 , lua , genuary12

JavaScript true
Networked false

Timestamp (UTC) 2024-08-18T00:43:57.163Z
Snapshot version 1
External network calls 0
Download Snapshot Download
Snapshot Image