WOW I FUCKING LOVE MATH SO MUCH

This commit is contained in:
PossiblyAxolotl 2022-07-07 16:03:18 -06:00
parent a869b1cf95
commit 1915981938

View file

@ -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