Skip to content

Instantly share code, notes, and snippets.

@Nekodigi
Last active September 18, 2020 09:26
Show Gist options
  • Select an option

  • Save Nekodigi/04b13ff2276dfcac7d1b4b945a2ea128 to your computer and use it in GitHub Desktop.

Select an option

Save Nekodigi/04b13ff2276dfcac7d1b4b945a2ea128 to your computer and use it in GitHub Desktop.
col = RGB(0, 0, 200)
rectWave = function(ni,nj,size)
for i = 1, ni do
for j = 1, nj do
local fac = obj.time+i/10
rect(size*i*4, size*j*4, math.sin(fac)*size)
if (j ~= nj and i ~= ni) then
fac = fac + 1 / 20
rect(size*i*4+size*2, size*j*4+size*2, math.sin(fac)*size)
end
end
end
end
rect = function (x, y, size)
obj.load("figure","四角形",col,1)
obj.drawpoly(-size+x,-size+y,0,size+x,-size+y,0,size+x,size+y,0,-size+x,size+y,0)
end
rectWave(20, 20, 30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment