Skip to content

Instantly share code, notes, and snippets.

@jhorikawa
Created November 13, 2020 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhorikawa/6ea8d55b13508e08e2b44e7dd66203d4 to your computer and use it in GitHub Desktop.
Save jhorikawa/6ea8d55b13508e08e2b44e7dd66203d4 to your computer and use it in GitHub Desktop.
PICO-8 source code to create orange peel like motion graphics.
r=64
function _draw()
cls(1)
--print("abc")
num=200.0
rad=50
xss={}
yss={}
sep=3
anum=2+sin(time()*0.1)
for n=1,sep do
xs={}
ys={}
for i=0,num do
a=i/num*anum+time()*0.5+n/sep
tw=sin(-i/num*0.5)*rad
th=cos(-i/num*0.5)*rad
x=cos(a)*tw+r
y=sin(a)*tw+r
z=th+r
xs[#xs+1]=x
ys[#ys+1]=z
end
xss[#xss+1]=xs
yss[#yss+1]=ys
end
for n=1,#xss do
for i=1,#xs-1 do
xs=xss[n]
ys=yss[n]
x1=xs[i]
x2=xs[i+1]
y1=ys[i]
y2=ys[i+1]
for t=0,2,2 do
line(x1+t-1,y1+t-1,x2+t-1,y2-1,7+t)
line(x1+t,y1+t,x2+t,y2,7+t)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment