This commit is contained in:
PossiblyAxolotl 2022-05-08 11:42:07 -06:00
parent 7decfe721f
commit c336d45261
2 changed files with 9 additions and 6 deletions

View file

@ -16,7 +16,7 @@ local gfx <const> = playdate.graphics
local disp <const> = playdate.display local disp <const> = playdate.display
local font <const> = gfx.font.new("gfx/big") local font <const> = gfx.font.new("gfx/big")
local dev = false dev = false
gfx.setFont(font) gfx.setFont(font)
gfx.setBackgroundColor(gfx.kColorBlack) gfx.setBackgroundColor(gfx.kColorBlack)

View file

@ -77,11 +77,14 @@ function updateSaws()
end end
for spinner = 1, #spinblades, 1 do for spinner = 1, #spinblades, 1 do
for armlen = 1, spinblades[spinner].armlen do for arm = 1, spinblades[spinner].arms do
for blade = 1, #spinblades[spinner].blades do for armlen = 1, spinblades[spinner].armlen do
spinblades[spinner].time += spinblades[spinner].speed for blade = 1, #spinblades[spinner].blades do
local newpos = {x=math.sin(math.rad(spinblades[spinner].time)) * 20 * armlen,y=math.cos(math.rad(spinblades[spinner].time)) * 20 * armlen} spinblades[spinner].time += spinblades[spinner].speed
spinblades[spinner].blades[blade]:moveTo(spinblades[spinner].mid.x + newpos.x, spinblades[spinner].mid.y + newpos.y) local degrees = spinblades[spinner].time / 360 * arm
local newpos = {x=math.sin(math.rad(degrees)) * 20 * armlen,y=math.cos(math.rad(degrees)) * 20 * armlen}
spinblades[spinner].blades[blade]:moveTo(spinblades[spinner].mid.x + newpos.x, spinblades[spinner].mid.y + newpos.y)
end
end end
end end
end end