diff --git a/Source/Editor.lua b/Source/Editor.lua index 513f4e8..e8ebc33 100644 --- a/Source/Editor.lua +++ b/Source/Editor.lua @@ -1,16 +1,17 @@ import "CoreLibs/keyboard" local gfx = playdate.graphics +local prevtext = "" function newProject() mode = "newproj" - playdate.keyboard.show("test") + playdate.keyboard.show("NEW LEVEL") end function updateNewproj() gfx.clear() gfx.drawText("LEVEL NAME:", 0, 105) - gfx.drawText(playdate.keyboard.text:upper(),0,125) + gfx.drawTextInRect(playdate.keyboard.text:upper(),0,125, 210, 80) end function playdate.keyboard.keyboardWillHideCallback(ok) @@ -19,4 +20,14 @@ function playdate.keyboard.keyboardWillHideCallback(ok) playdate.wait(0.3) editLoad() end +end + +function playdate.keyboard.textChangedCallback() + print(#playdate.keyboard.text) + + if #playdate.keyboard.text > 24 then + playdate.keyboard.text = prevtext + end + + prevtext = playdate.keyboard.text end \ No newline at end of file diff --git a/Source/Main.lua b/Source/Main.lua index c5d0ff2..a787a9a 100644 --- a/Source/Main.lua +++ b/Source/Main.lua @@ -16,7 +16,7 @@ local gfx = playdate.graphics local disp = playdate.display local font = gfx.font.new("gfx/big") -dev = true +local dev = false gfx.setFont(font) gfx.setBackgroundColor(gfx.kColorBlack) diff --git a/Source/Saws.lua b/Source/Saws.lua index 7fabc88..2e3b670 100644 --- a/Source/Saws.lua +++ b/Source/Saws.lua @@ -45,7 +45,7 @@ function loadSpins(_spins) s.middle:moveTo(s.x,s.y) s.middle:add() - local sb = {speed=s.speed,arms=s.arms,armlen=s.armlen,blades={},time=0} + local sb = {speed=s.speed,arms=s.arms,armlen=s.armlen,blades={},mid=s.middle,time=0} for i = 1, s.arms, 1 do for p = 1, s.armlen, 1 do local degrees = (360 / s.arms) * i @@ -84,4 +84,13 @@ function killBlades() blades[i].saw:remove() end blades = {} + + for i = 1, #spinblades, 1 do + spinblades[i].mid:remove() + for b = 1, #spinblades[i].blades do + spinblades[i].blades[b]:remove() + end + end + + spinblades = {} end \ No newline at end of file diff --git a/Source/levels/a - Copy.json b/Source/levels/abcdefghijklmnopqrstuvwxyz.json similarity index 100% rename from Source/levels/a - Copy.json rename to Source/levels/abcdefghijklmnopqrstuvwxyz.json