WOW I FUCKING LOVE MATH SO MUCH
This commit is contained in:
parent
a869b1cf95
commit
1915981938
1 changed files with 4 additions and 4 deletions
|
@ -58,11 +58,11 @@ function loadSpins(_spins)
|
|||
local sb = {speed=s.speed,arms=s.arms,armlen=s.armlen,saws = {},arcs = {},time=0}
|
||||
|
||||
for len = 1, s.armlen, 1 do
|
||||
local arc = playdate.geometry.arc.new(s.x,s.y, 20 * len, 0, 360)
|
||||
local arc = playdate.geometry.arc.new(s.x,s.y, 20 * len, 0, 540)
|
||||
|
||||
for arm = 1, s.arms, 1 do
|
||||
local saw = gfx.sprite.new(loopSaws:image())
|
||||
local sawPos = arc:pointOnArc(arc:length() / s.arms * arm)
|
||||
local sawPos = arc:pointOnArc(360 / s.arms * arm)
|
||||
|
||||
saw:moveTo(sawPos.x,sawPos.y)
|
||||
saw:add()
|
||||
|
@ -149,9 +149,9 @@ function updateSaws()
|
|||
local arc = s.arcs[len]
|
||||
|
||||
for arm = 1, s.arms, 1 do
|
||||
local sawPos = arc:pointOnArc(arc:length() / s.arms * arm + s.time)
|
||||
local sawPos = arc:pointOnArc(360 / s.arms * arm + (s.time * len))
|
||||
|
||||
s.saws[arm]:moveTo(sawPos.x,sawPos.y)
|
||||
s.saws[len + ((arm-1)*s.arms)]:moveTo(sawPos.x,sawPos.y)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue