Skip to content

Instantly share code, notes, and snippets.

@jhorikawa
Last active November 13, 2020 15:04
Show Gist options
  • Save jhorikawa/e577bef80313d73a01be75d8c0243331 to your computer and use it in GitHub Desktop.
Save jhorikawa/e577bef80313d73a01be75d8c0243331 to your computer and use it in GitHub Desktop.
PICO-8 source code to create circle grid motion graphics.
r=128
t=0
num=4
rad=9
sp=0.5
function _draw()
cls(13)
val=sin(330/360)
nnum=ceil(num/val)
for i=0,num do
for n=0,nnum do
x1=r/num*i+n%2*r/num*0.5
x2=r/num*i+(1-n%2)*r/num*0.5
y=r/num*n*val
ang=time()*sp+n/nnum
rad1=(sin(ang)+1)*0.5*rad
circfill(x1+1,y+1,rad1,1)
circfill(x1,y,rad1,12)
rad2=(sin(ang+0.5)+1)*0.5*rad
circfill(x2+1,y+1,rad2,4)
circfill(x2,y,rad2,10)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment