diff --git a/Source/Editor.lua b/Source/Editor.lua index ca0a964..1e96f8c 100644 --- a/Source/Editor.lua +++ b/Source/Editor.lua @@ -48,6 +48,7 @@ local imgExitMen = gfx.image.new("gfx/leave") local imgSaw = gfx.imagetable.new("gfx/sawblades") local imgTarget = gfx.image.new("gfx/target") local imgGrid = gfx.image.new("gfx/grid") +local imgWarn = gfx.image.new("gfx/warningsign") assert(imgFloppy) assert(imgAdd) assert(imgMus) @@ -62,6 +63,7 @@ assert(imgPlayerExit) assert(imgSaw) assert(imgTarget) assert(imgGrid) +assert(imgWarn) local animFloppy = gfx.animation.loop.new(100, imgFloppy) @@ -485,6 +487,8 @@ function editUpdate() gfx.drawText("MOVERS",0,0) elseif math.floor( tileIndex ) == 3 then gfx.drawText("SPINNERS",0,0) + imgWarn:draw(0,18) + gfx.drawText("VERY LAGGY",18,18) elseif math.floor( tileIndex ) == 4 then gfx.drawText("PLAYER",0,0) elseif math.floor( tileIndex ) == 5 then diff --git a/Source/Main.lua b/Source/Main.lua index 632ac6b..c219e2b 100644 --- a/Source/Main.lua +++ b/Source/Main.lua @@ -30,7 +30,6 @@ next = nil local gfx = playdate.graphics local disp = playdate.display local font = gfx.font.new("gfx/big") -small = gfx.font.new("gfx/font(1)") gfx.setFont(font) gfx.setBackgroundColor(gfx.kColorBlack) @@ -138,9 +137,3 @@ function playdate.gameWillTerminate() playdate.datastore.write({savedLevel=map,savedDeaths=deaths},"savegame") end end - -function playdate.debugDraw() - gfx.setDrawOffset(0,0) - playdate.drawFPS(0,228) - small:drawText(math.floor( playdate.getCrankPosition() ), 0, 218) -end \ No newline at end of file diff --git a/Source/Saws.lua b/Source/Saws.lua index 7551210..abcf205 100644 --- a/Source/Saws.lua +++ b/Source/Saws.lua @@ -56,10 +56,12 @@ function loadSpins(_spins) s.middle:add() local sb = {speed=s.speed,arms={},mid=s.middle,time=0} - --local sb = {speed=s.speed,arms=s.arms,armlen=s.armlen,saws = {},arcs = {},time=0} + --[[local sb = {speed=s.speed,layers={},time=0} - --[[for len = 1, s.armlen, 1 do + for len = 1, s.armlen, 1 do local arc = playdate.geometry.arc.new(s.x,s.y, 20 * len, -720, 720) + + sb.layers[#sb.layers+1] = {curve=arc,saws={}} for arm = 1, s.arms, 1 do local saw = gfx.sprite.new(loopSaws:image()) @@ -68,12 +70,13 @@ function loadSpins(_spins) saw:moveTo(sawPos.x,sawPos.y) saw:add() - sb.saws[#sb.saws+1] = saw + sb.layers[#sb.layers].saws[#sb.layers[#sb.layers].saws+1] = saw end + end - sb.arcs[#sb.arcs+1] = arc - end]] + spinblades[#spinblades+1] = sb]] + for i = 1, s.arms, 1 do sb.arms[i] = {} for p = 1, s.armlen, 1 do @@ -146,14 +149,14 @@ function updateSaws() s.time += s.speed print(s.time) - for len = 1, s.armlen, 1 do - local arc = s.arcs[len] + for len = 1, #s.layers, 1 do + local arc = s.layers[len].curve - for arm = 1, s.arms, 1 do - local sawPos = arc:pointOnArc(arc:length() / 4 / s.arms * arm + (s.time * len)) - if s.time > 125 * s.arms or s.time < -125 * s.arms then s.time = 0 end + for arm = 1, #s.layers[len].saws, 1 do + local sawPos = arc:pointOnArc(arc:length() / 4 / #s.layers[len].saws * arm + (s.time * len)) + if s.time > 125 * #s.layers[len].saws or s.time < -125 * #s.layers[len].saws then s.time = 0 end - s.saws[arm+((len)*(arm-1))]:moveTo(sawPos.x,sawPos.y) + s.layers[len].saws[arm]:moveTo(sawPos.x,sawPos.y) end end end]] diff --git a/Source/gfx/warningsign.png b/Source/gfx/warningsign.png new file mode 100644 index 0000000..963b87e Binary files /dev/null and b/Source/gfx/warningsign.png differ