Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
23
Task/Polyspiral/Lua/polyspiral.lua
Normal file
23
Task/Polyspiral/Lua/polyspiral.lua
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
function love.load ()
|
||||
love.window.setTitle("Polyspiral")
|
||||
incr = 0
|
||||
end
|
||||
|
||||
function love.update (dt)
|
||||
incr = (incr + 0.05) % 360
|
||||
x1 = love.graphics.getWidth() / 2
|
||||
y1 = love.graphics.getHeight() / 2
|
||||
length = 5
|
||||
angle = incr
|
||||
end
|
||||
|
||||
function love.draw ()
|
||||
for i = 1, 150 do
|
||||
x2 = x1 + math.cos(angle) * length
|
||||
y2 = y1 + math.sin(angle) * length
|
||||
love.graphics.line(x1, y1, x2, y2)
|
||||
x1, y1 = x2, y2
|
||||
length = length + 3
|
||||
angle = (angle + incr) % 360
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue