Last active
September 18, 2020 09:26
-
-
Save Nekodigi/04b13ff2276dfcac7d1b4b945a2ea128 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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