TSWInstallerFile1

{"TSWRes Cache.lua":"local CacheList = {\n  \"Images\/Cardboard.png\",\n   \"Images\/GoodiesBag.png\",\n\n\n}\n\nfor k, v in ipairs(CacheList) do\n   draw.cacheimage(v)\nend","TSWRes Game1.lua":"if not TSW then require \"TSWRes Game\" end\n\n-- Test Mode\nfunction GT.TestMode\n   TestStart = sys.gettime\n   if type(ObjTab[6]) ~= \"table\" then\n      table.insert(ObjTab, 6, GT.CreObjTab(\"Sackboy\", 48, -48, 32, 10, true))\n   end\n   if ObjTab[6][\"CorTab\"] ~= \"Sackboy\" then\n      table.insert(ObjTab, 6, GT.CreObjTab(\"Sackboy\", 48, -48, 32, 10, true))\n   end\n   --OldChPtTab = TablesFun.Clone(ChPtTab)\n   draw.setscreen(1)\n   local DrObjInLev = Draw.ObjectsInLevel\n   local Sac = ObjTab[6]\n   CreateMode = false\n   Aced = true\n   draw.tracktouches(Nil, GetTouch2, ResetTouchF)\n   --for k, v in ipairs(LuaCorTab) do\n      local Ok, Func = Sandbox.Load(v)\n      if Ok then\n         LogicCoroutines[k] = coroutine.create(Func)\n      else\n         print(\"Error loading coroutine \"..k..\",\", Func)\n      end\n   end\n   TX, TY = 0, 0\n   for i=1, math.huge do\n      if PlayerOutOfLives or ToCM then\n         --ChPtTab = OldChPtTab\n         ToCM = nil\n         PlayerOutOfLives = nil\n         GT.ResetLevel\n         GT.ResetCheckpoints\n         return\n      end\n      local OldTime = sys.gettime\n      if not LvDone then\n         CamX, CamY = Sac[\"X\"] - ((SizeX\/2)\/Zoom), -(Sac[\"Y\"]+Sac[\"YVol\"]*.95) +  ((SizeY\/2)\/Zoom)\n      end\n      draw.doevents\n      local OldTime2 = sys.gettime\n      GT.GameHandleFrame(TX, TY)\n      local NewTime2 = sys.gettime\n      draw.beginframe\n      Draw.BGs.Default\n      Draw.Level\n      --Draw.Thermometer(DrThV, 24, 24, 48, SizeY-24)\n      Draw.DPad(64, SizeY-96, PlayCol1, PlayCol2)\n      draw.rect(SizeX-96, SizeY-96, SizeX-32, SizeY-32, PlayCol1)\n      draw.fillcircle(64, 64, 24, PlayCol1)\n      draw.stringinrect(Score, 48, 56, 80, 56, draw.white)\n      if ScoreMultiplier >= 1 then\n         draw.fillrect(80, 48, 100, 64, draw.white)\n         draw.stringinrect(\"x\"..math.floor(ScoreMultiplier + 1), 80, 48, 100, 64, draw.black)\n      end\n      local NewTime = sys.gettime\n      local Frame, DrawFrame, ColFrame = (NewTime - OldTime), (NewTime - NewTime2), (NewTime2 - OldTime2)\n      Draw.StatusBar(Frame, DrawFrame, ColFrame)\n      draw.endframe\n      --CG\n      --CG(\"stop\")\n      Sleep(OldTime)\n   end\nend\n\nfunction ResetTouchF\n   TX, TY = nil, nil\nend\n\nfunction Emitter(Obj, EmitX, EmitY)\n   Obj[\"X\"], Obj[\"Y\"] = EmitX, EmitY\n   ObjTab[#ObjTab+1] = Obj\nend\n\nfunction GT.StringAttach(Obj1, Obj2)\n\n\nend\n\n-- Handles a single object's collision\nfunction GT.ObjectCollision(ObjKey, TDirH)\n   local Object = ObjTab[ObjKey]\n   local ObjX, ObjY = Object[\"X\"], Object[\"Y\"]\n   local ColSz = Object[\"Size\"] + 16\n   local Col, ColNum = false, 0\n   --local ColX, ColY = 0, 0\n   --local ColXN, ColYN = 0, 0\n   for k, v in ipairs(ObjTab) do\n      if true then --TRec(ObjX - ColSz*10, ObjY - ColSz*10, ObjX + ColSz*10, ObjY + ColSz*10, v[\"X\"], v[\"Y\"]) then\n         Col, ColCX, ColCY, PointPop = CollisionTest(Object, v)\n         --ColX, ColY = ColX + ColCX, ColY + ColCY\n         if Col == true then ColNum = ColNum + 1 end\n         if ObjKey == 6 and v[\"CorTab\"] == \"Scoreboard\" then --Scoreboard collision\n            CheckForScoreboardEndOfLevel(k)\n         end\n         if ObjKey == 6 and v[\"CorTab\"] == \"ScoreBubble\" and Col == true then\n            table.remove(ObjTab, k)\n            print(ObjTab[k])\n            v = nil\n         end\n      end\n   end\n   if ColNum == 0 then\n      Object[\"YVol\"] = math.min(Object[\"YVol\"] + .4, 9.8)\n      if (ObjKey == 6 and TDirH == 0) or (ObjKey ~= 6) then\n         Object[\"XVol\"] = .2 * Object[\"XVol\"]\n      end\n   else\n      if ObjKey > 6 then\n         print(Math.Fix(sys.gettime - TestStart, 3), \"Object \"..ObjKey, \"Collisions: \"..ColNum)\n      end\n   end\n   Object[\"X\"] = Object[\"X\"] + Object[\"XVol\"]\n   Object[\"Y\"] = Object[\"Y\"] + Object[\"YVol\"]\n   --return ColX, ColY\nend\n\n-- Handles the level collision\nfunction GT.HandleCollisions(TDirH)\n   local Collision = GT.ObjectCollision\n   for k, v in ipairs(ObjTab) do\n      if v[\"Dynam\"] == true and v[\"NoCollide\"] ~= true then\n         --if v[\"CreTab\"] then\n            GT.CreatureObject(ObjTab[k])\n         end\n         if v[\"Attach\"] then\n\n         end\n         if k == 6 then\n            Collision(k, TDirH)\n         else\n            Collision(k)\n         end\n      end\n      -- For logic objects\n      if v[\"Outputs\"] then\n         v[\"Outputs\"][1][\"Value\"] = true\n      end\n      if v[\"Inputs\"] then\n         for k2, v2 in ipairs(v[\"Inputs\"]) do\n            if ObjTab[v2] then\n               if ObjTab[v2][\"Outputs\"] then\n                  if ObjTab[v2][\"Outputs\"][1] then\n                     if ObjTab[v2][\"Outputs\"][1][\"Value\"] then\n                        if v[\"CorTab\"] == \"ScoreBubble\" then\n                           table.remove(ObjTab, k)\n                           print(ObjTab[k])\n                           for k3, v3 in ipairs(ObjTab[v2][\"Outputs\"][1]) do\n                              if v3 == k then\n                                 table.remove(ObjTab[v2][\"Outputs\"][1], k3)\n                              end\n                           end\n                           GT.PointBubblePop\n                        elseif v[\"CorTab\"] == \"Emitter\" then\n                           GT.CreObjTab(v[\"EmitObject\"], v[\"X\"], v[\"Y\"], 1)\n                        end\n                     end\n                  end\n               end\n            end\n         end\n      end\n   end\n   --return SackCollisionX, SackCollisionY\nend\n\n-- Handles the Logic Coroutines so they can run\nfunction GT.HandleCoroutines\n   for k, v in ipairs(LogicCoroutines) do\n      print(\"Coroutine \"..k, coroutine.status(v))\n      if coroutine.status(v) ~= \"dead\" then\n         local Ok, Error = coroutine.resume(LogicCoroutines[k])\n         if collectgarbage(\"count\")*1024 > (120*1024*1024) then\n            print(\"Low Memory\", ObjRes.BytesPlus(collectgarbage(\"count\")*1024))\n            collectgarbage\n         end\n         if collectgarbage(\"count\")*1024 > (128*1024*1024) then\n            error(\"Too much memory usage\", ObjRes.BytesPlus(collectgarbage(\"count\")*1024))\n         end\n         if not Ok then\n            print(\"Coroutine \"..k..tostring(Ok), Error)\n         end\n      else\n         table.remove(LogicCoroutines, k)\n      end\n   end\nend\n\nfunction GT.HandleSackboyUnderWater\n   --print(\"Sackboy is underwater\")\n   if SackboyBreath == nil then\n      SackboyBreath = LevelTab[\"SackboyBreath\"] or FR * 20\n   else\n      SackboyBreath = SackboyBreath - 1\n      if SackboyBreath < FR*10 then\n         sys.alert(\"tock\")\n      end\n      if SackboyBreath < 0 then\n         sys.alert(\"neg\")\n         SackboyBreath = nil\n         GT.SackDie\n      end\n   end\nend\n\nfunction GT.HandleSackboy\n   local Sackboy = ObjTab[6]\n   for k, v in ipairs(ChPtTab) do\n      if TRec(v[\"X\"] - 32, v[\"Y\"] - 32, v[\"X\"] + 32, v[\"Y\"] + 32, Sackboy[\"X\"], Sackboy[\"Y\"]) then\n         if 0 < v[\"Lives\"] then\n            CurChPt = k\n         end\n      end\n   end\n   assert(Sackboy, \"Sackboy object doesn't exist\")\n   --print(Sackboy[\"Y\"], LevelTab[\"WaterLevel\"])\n   if LevelTab[\"WaterLevel\"] < 0 and -Sackboy[\"Y\"] < -tonumber(LevelTab[\"WaterLevel\"]) then -- Underwater Physics\n      GT.HandleSackboyUnderWater\n   else\n      SackboyBreath = nil\n   end\nend\n\nfunction GT.HandleFrame\n   local SMT, SMP, SM = ScoreMultiplierTime, ScoreMultiplierPoints, ScoreMultiplier\n   if ScoreMultiplierTime >= 0 then\n      ScoreMultiplierTime = ScoreMultiplierTime - 1\n      if SMT <= 0 then\n         Score = Score + (SMP*math.floor(SM))\n         ScoreMultiplier = 0\n         ScoreMultiplierPoints = 0\n      end\n   end\n   if LvDone == true then\n      WhileWon(LvDoneScKey)\n   end\nend\n\n-- Handles a frame of Gameplay.\nfunction GT.GameHandleFrame(TX, TY)\n   local TDirH = SacMove(TX, TY)\n   GT.HandleFrame\n   GT.HandleCollisions(TDirH)\n   GT.HandleSackboy\n   GT.HandleCoroutines\nend\n\nreturn","TSWRes Story.lua":"if not TSW then require \"TSWRes Game\" end\nlocal StoryRes = {}\n\nStoryRes.SavedFile = {}\nStoryRes.StoryProg = 0\n\nfunction GT.LevelProg\n   local Tab = {}\n   Tab[\"Played\"] = false\n   Tab[\"Completed\"] = false\n   Tab[\"Aced\"] = false\n   Tab[\"CollectedAllPrizes\"] = false\n   return Tab\nend\n\nfunction StoryRes.BlankFile\n   local Worlds = Strings.Story.Planets\n   local SavedFile = StoryRes.SavedFile\n\n   SavedFile[\"Save\"] = {}\n   local Save = SavedFile[\"Save\"]\n\n   SavedFile[\"LevelInfo\"] = {}\n   local LevelInfo = SavedFile[\"LevelInfo\"]\n   -- Worlds\n   LevelInfo[tostring(Worlds[1])] = {}\n   LevelInfo[tostring(Worlds[1])][1] = GT.LevelProg\n\n   Save[\"CollectedPrizes\"] = {}\n\n   StoryRes.StoryProg = 0\nend\n\nfunction StoryRes.LoadFile\n   local SavedFile = StoryRes.SavedFile\n   if not FS.exists(\"SavedData\/LBPStorySave.data\") then\n      StoryRes.BlankFile\n      return true, \"No file found\"\n   end\n   local FileHandle = io.open(\"LBPStorySave.data\")\n   if not FileHandle then\n      StoryRes.BlankFile\n      return false, \"Story Progress is unreadable\"\n   end\n   SavedFile = JSON.EncodeJSON(FileHandle:read)\n   FileHandle:close\n   return true\nend\n\nfunction StoryRes.WorldsMenu\n   local Scroll = 0\n   for i=1, math.huge do\n      draw.beginframe\n      Draw.BGs.StoryWorldsMenu(Scroll)\n      draw.endframe\n      TX, TY = draw.waittouch\n      local BackTap = TRec(24, SizeY - 64, 128, SizeY - 24, TX, TY)\n      if BackTap then\n         return\n      elseif LevelsTap then\n         StoryRes.WorldsMenu\n      elseif CollectiblesTap then\n\n      end\n   end\nend\n\nfunction StoryRes.LevelsMenu\n\nend\n\nfunction StoryRes.Menu\n   if StoryRes.StoryProg == 0 then\n      Intro = require \"TSWRes Intro\"\n      Intro.IntroCut\n   end\n   for i=1, math.huge do\n      draw.beginframe\n      Draw.BGs.StoryMainMenu\n      draw.endframe\n      TX, TY = draw.waittouch\n      local BackTap = TRec(24, SizeY - 64, 128, SizeY - 24, TX, TY)\n      local LevelsTap = TRec(24, 64, 128, 96, TX, TY)\n      local CollectiblesTap = TRec(24, 96, 128, 128, TX, TY)\n      if BackTap then\n         return\n      elseif LevelsTap then\n         StoryRes.WorldsMenu\n      elseif CollectiblesTap then\n\n      end\n   end\nend\n\n\n\nreturn StoryRes","TSWRes Tool4.lua":"function FixObjCorn(CorTab)\n   local StartX, EndX = math.huge, 0\n   local StartY, EndY = math.huge, 0\n   for k,v in pairs(CorTab) do\n      StartX = math.min(v[1], StartX)\n      StartY = math.min(v[2], StartY)\n   end\n   for k,v in pairs(CorTab) do\n      v[1] = v[1] - (StartX)\n      v[2] = v[2] - (StartY)\n   end\n   for k,v in pairs(CorTab) do\n      EndX = math.max(v[1], EndX)\n      EndY = math.max(v[2], EndY)\n   end\n   for k,v in pairs(CorTab) do\n      v[1] = ((v[1] \/ math.max(EndX, EndY)))\n      v[2] = ((v[2] \/ math.max(EndX, EndY)))\n   end\n   return StartX, StartY, EndX, EndY\nend\n\nfunction FixObjCorn2(CorTab, Size)\n   local EndX = 0\n   local EndY = 0\n   for k,v in pairs(CorTab) do\n      EndX = math.max(v[1], EndX)\n      EndY = math.max(v[2], EndY)\n   end\n   for k,v in pairs(CorTab) do\n      v[1] = (v[1]*Size)\n      v[2] = (v[2]*Size)\n   end\n   return EndX, EndY\nend\n\nfunction FixObj(ObjTab)\n   local StartX, StartY, EndX, EndY = FixObjCorn(ObjTab[\"CorTab\"])\n   ObjTab[\"Size\"] = (ObjTab[\"Size\"] * math.max(EndX, EndY))\n   ObjTab[\"X\"] = ObjTab[\"X\"] + StartX --(math.max(EndX, EndY))\n   ObjTab[\"Y\"] = ObjTab[\"Y\"] + StartY -- (math.max(EndX, EndY))\nend\n\nfunction FixObj2(ObjTab)\n   local EndX, EndY = FixObjCorn2(ObjTab[\"CorTab\"], ObjTab[\"Size\"])\n   ObjTab[\"Size\"] = 1\n   ObjTab[\"X\"] = ObjTab[\"X\"] - (math.max(EndX, EndY)*.5)\n   ObjTab[\"Y\"] = ObjTab[\"Y\"] + (math.max(EndX, EndY)*.5)\nend\n\nfunction ObjSel(TX, TY)\n   --if TX == nil then\n   --   return TX, TY\n   --end\n   local PopitClosed = TRec(SizeX-96, SizeY-96, SizeX-32, SizeY-32,TX,TY)\n   if PopitClosed then\n      ToolClosed = true\n      return\n   end\n   for k,v in pairs(ObjTab) do\n      local ObjTap = TRec(\n      (v[\"X\"] - v[\"Size\"]) - 16 -CamX,\n      (v[\"Y\"] - v[\"Size\"]) - 16 + CamY,\n      (v[\"X\"] + v[\"Size\"]) + 4 - CamX,\n      (v[\"Y\"] + v[\"Size\"]) + 4 + CamY, TX, TY)\n      if ObjTap == true then\n         if k > 4 then\n            ObjSelected = k\n         end\n      end\n   end\nend\n\nfunction CETouch(TX, TY)\n   --print(\"Touched \"..TX, TY)\n   assert(TX)\n   local PopitClosed = TRec(SizeX-96, SizeY-96, SizeX-32, SizeY-32,TX,TY)\n   if ObjSelected == nil then\n      if PopitClosed then\n         ToolClosed = true\n         return\n      end\n      ObjSel(TX, TY)\n      return TX, TY\n   elseif CorSel == nil then\n      if PopitClosed then\n         Object = ObjTab[ObjSelected]\n         FixObj(Object)\n         Object[\"TVal\"] = #Object[\"CorTab\"] * 10\n         GT.FixIncLTV\n         ObjSelected = nil\n         Fixed = nil\n         return\n      end\n   end\n   Object = ObjTab[ObjSelected]\n   assert(ObjSelected, \"ObjSelected is missing\")\n   if CorSel ~= nil then\n      CETouchC(TX, TY)\n      return TX, TY\n   end\n   if type(Object[\"CorTab\"]) ~= \"table\" then\n      Object[\"CorTab\"] = {{0,0}, {0,1}, {1,1}, {1,0}}\n   end\n   assert(ObjSelected ~= nil)\n   assert(type(Object[\"CorTab\"]) == \"table\")\n   if type(Object[\"CorTab\"]) == \"table\" and not Fixed then\n      FixObj2(Object)\n      Fixed = true\n   end\n   CorSel = nil\n   local SB = 24\n   local Size = Object[\"Size\"]\n   for k, v in ipairs(Object[\"CorTab\"]) do\n      local IsSel = TRec(((v[1]*Size)-16)+(Object[\"X\"]), ((v[2]*Size)-16)+(Object[\"Y\"]), ((v[1]*Size)+16)+(Object[\"X\"]), ((v[2]*Size)+16)+(Object[\"Y\"]), TX+CamX, TY-CamY)\n      if IsSel then\n         CorSel = k\n         --print(\"CorSel\"..CorSel)\n         return TX, TY\n      end\n   end\n   if CorSel == nil then\n      CorSel = #Object[\"CorTab\"]+1\n   end\n   return TX, TY\nend\n\nfunction CETouchC(TX, TY)\n   local PopitClosed = TRec(SizeX-96, SizeY-96, SizeX-32, SizeY-32,TX,TY)\n   CorTab = ObjTab[ObjSelected]\n   CorTab =CorTab[\"CorTab\"]\n   if PopitClosed and CorTab[CorSel] ~= nil then\n      --print(\"Deleting \"..tostring(CorSel))\n      table.remove(CorTab, CorSel)\n      CorSel = nil\n      PopitRes.DeleteSound\n      return\n   elseif PopitClosed and CorTab[CorSel] == nil then\n      CorSel = nil\n      return\n   end\n   CorTab[CorSel] = {}\n   SCor = CorTab[CorSel]\n   if not Grid then\n      SCor[1] = (-((-TX+(Object[\"X\"]))\/Object[\"Size\"]))+(CamX\/Object[\"Size\"])\n      SCor[2] = (-((-TY+(Object[\"Y\"]))\/Object[\"Size\"]))- (CamY\/Object[\"Size\"])\n   else\n      SCor[1] = math.round((-((-TX+(Object[\"X\"]))\/Object[\"Size\"]))+(CamX\/Object[\"Size\"]))\n      SCor[2] = math.round((-((-TY+(Object[\"Y\"]))\/Object[\"Size\"]))- (CamY\/Object[\"Size\"]))\n   end\n   --print((TX+(Object[\"X\"]))\/Object[\"Size\"])\n   PopitRes.PlaceSound\n   CorSel = nil\nend\n\nfunction CornerShow\n   if ObjSelected == nil then\n      return\n   end\n   local Object = ObjTab[ObjSelected]\n   local CorTab = Object[\"CorTab\"]\n   local Cor = CorTab[CorSel]\n   --print(\"Corner \"..CorSel, \"X: \"..Cor[1], \"Y: \"..Cor[2])\n   if Cor ~= nil then\n      draw.beginframe\n      local Size = Object[\"Size\"]\n      draw.fillcircle(((Cor[1]*Size)+(Object[\"X\"]))-CamX, ((Cor[2]*Size)+(Object[\"Y\"]))+CamY, 16, PlayCol1)\n      --print(\"CorSel\"..CorSel)\n      draw.endframe\n   end\nend\n\nfunction ToolRes.CorEditor\n   PopitCuTool = \"Corner Editor\"\n   ObjSelected = nil\n   Mode = 0\n   draw.tracktouches(Nil, CamMove, CETouch)\n   for i=1, math.huge do\n      local OldTime = sys.gettime\n      GT.DrawCMFrame\n      if CorSel ~= nil then\n         CornerShow\n      end\n      draw.doevents\n      if ToolClosed then\n         return\n      end\n      --if ObjSelected == nil then\n         if TDirH == 0 and TDirV == 0 then\n\n         end\n      else\n         local Object = ObjTab[ObjSelected]\n         print(ObjSelected)\n         local TDirH, TDirV = TDPad(64, SizeY-96,TX,TY)\n         CamX, CamY = CamX + TDirH, CamY + TDirV\n         if PopitClosed then\n            table.remove(ObjTab, ObjSelected)\n            PopitRes.DeleteSound\n         end\n         if TDirH == 0 and TDirV == 0 then\n            if CorSel == nil then\n               CETouch(TX, TY)\n            else\n               CETouchC(TX, TY)\n            end\n         end\n      end\n      collectgarbage(\"stop\")\n      Sleep(OldTime)\n   end\nend\n\nPopitRes.CorEditor = ToolRes.CorEditor","FileSystem.lua":"local lfs = require \"lfs\"\nlocal FileSystem = {}\n\n-- Returns if Path exists.\nfunction FileSystem.exists(Path)\n   return type(lfs.attributes(Path)) == \"table\"\nend\n\n-- Returns the size of file or folder Path.\nfunction FileSystem.size(Path)\n   if FileSystem.isFile(Path) then\n      return lfs.attributes(Path, \"size\")\n   elseif FileSystem.isDirectory(Path) then\n      local Size = 0\n      for k, v in pairs(sys.dir(Path)) do\n         if v ~= \".\" and v ~= \"..\" then\n            Size = Size + lfs.attributes(Path, \"size\")\n         end\n      end\n   end\nend\n\n-- Returns if Path relates to a file.\nfunction FileSystem.isFile(Path)\n   return lfs.attributes(Path, \"mode\") == \"file\"\nend\n\n-- Returns if Path relates to a folder\/directory.\nfunction FileSystem.isDirectory(Path)\n   return lfs.attributes(Path, \"mode\") == \"directory\"\nend\n\n-- Creates a directory.\nFileSystem.mkDir = lfs.mkdir\n\n-- Removes a directory\nFileSystem.rmDir = lfs.rmdir\n\n\nreturn FileSystem","TSWRes Functions.lua":"Math = {}\nTablesFun = {}\n\nfunction Math.Bounce(Var, Top, Speed, Var2, Bottom)\n   if not Bottom then Bottom = 0 end\n   if Var2 == 0 then\n      if Var >= Top then\n         Var2 = 1\n         Var = Var - Speed\n      else\n         Var = Var + Speed\n      end\n   elseif Var2 == 1 then\n      if Var <= Bottom then\n         Var2 = 0\n         Var = Var + Speed\n      else\n         Var = Var - Speed\n      end\n   end\n   return Var, Var2\nend\n\nfunction Math.Fix(Number, Value)\n   if type(Number) ~= \"number\" then\n      error(\"'Number' number expected (got \"..type(Number)..\")\", 3)\n   end\n   local RetVal = math.floor(Number*(10^Value))\n   return RetVal\/(10^Value)\nend\n\nfunction TablesFun.Clone(Table)\n   local Clone = {}\n   for k, v in ipairs(Table) do\n      Clone[k] = Table[k]\n   end\n   return Clone\nend\n\nreturn","TSWRes Game4.lua":"if not TSW then require \"TSWRes Game\" end\n\n-- Size\nfunction GT.LevelSize(Level)\n   local LevelSave = io.open(\"SavedData\/LBPLua.Level\"..Level..\".lualevel\")\n   if LevelSave == nil then\n      return -1\n   end\n   local LevelStr = LevelSave:read\n   LevelSave:close\n   local ObjSave = io.open(\"SavedData\/LBPLua.Level\"..Level..\".lualobj\")\n   local ObjStr = ObjSave:read\n   ObjSave:close\n   local ChPtSave = io.open(\"SavedData\/LBPLua.Level\"..Level..\".lualch\")\n   local ChPtStr = ChPtSave:read\n   ChPtSave:close\n   --if not Ok1 and not Ok2 and not Ok3 then\n      print(\"Warning: \"..Level..\" is missing!\")\n   end\n   local LevelSize = #tostring(LevelStr) + #tostring(ObjStr) + #tostring(ChPtStr)\n   return LevelSize\nend\n\nfunction Sleep(OldTime)\n   sys.sleep((((1\/FR)-(sys.gettime-OldTime))*1000) - 0.54)\nend\n\n-- Play Mode\nfunction GT.PlayMode\n\n\nend\n\nfunction ButtonTapped(TX, TY)\n   local Button\n   if TRec(SizeX-160, SizeY-96, SizeX-96, SizeY-32, TX, TY) then\n      Button = 1\n   elseif TRec(SizeX-224, SizeY-96, SizeX-160, SizeY-32, TX, TY) then\n      Button = 2\n   end\n   return Button\nend\n\nfunction GT.PointBubblePop\n   local Add = 10\n   Score = Score + Add\n   ScoreMultiplier = ScoreMultiplier + .2\n   ScoreMultiplierTime = 28\n   ScoreMultiplierPoints = ScoreMultiplierPoints + Add\nend\n\nfunction GT.ResetCheckpoints\n   CurChPt = 1\n   for k, v in ipairs(ChPtTab) do\n      v[\"Lives\"] = v[\"MaxLives\"]\n   end\nend\n\nfunction GT.ResetLevel\n   LvDone, LvDoneScKey = nil, nil\n   TX, TY = -1000, -1000\n   Score = 0\n   ScoreMultiplier = 0\n   ScoreMultiplierTime = 0\n   ScoreMultiplierPoints = 0\n   Aced = true\n   FinalScore = nil\n   FinalAced = nil\n   TimeTotal = nil\n   TimeTillMenu = nil\n   ScoreListTime = nil\n   PlayerOutOfLives = nil\nend\n\n-- Conditional functions\nfunction GT.OutOfLives\n   --draw.beginframe\n   draw.clear(draw.black)\n   --Draw.BGs.PStartMenu\n   draw.endframe\n   draw.waittouch\n   GT.TStartMenu\n   PlayerOutOfLives = true\nend\n\nfunction GT.LevelWon1(ScKey)\n   if not LvDone then\n      print(\"Level Won!\")\n      LvDone = true\n      LvDoneScKey = ScKey\n      local SMP, SM = ScoreMultiplierPoints, ScoreMultiplier\n      ScoreMultiplierTime = 0\n      Score = Score + (SMP*math.floor(SM - 1))\n      ScoreMultiplier = 0\n      ScoreMultiplierPoints = 0\n      FinalScore = Score\n      FinalAced = Aced\n      if ShowLeaderboards then\n         TimeTotal = 12*FR\n         TimeTillMenu = 12*FR\n         ScoreListTime = 6*FR\n      else\n         TimeTotal = 6*FR\n         TimeTillMenu = 6*FR\n         ScoreListTime = 0\n      end\n   end\nend\n\nfunction CamFollowPos(X, Y, Speed)\n   local OldX, OldY = CamX, CamY\n   if X > CamX then\n      CamX = CamX + math.min(Speed, X + CamX)\n      --if CamX < OldX + Speed then\n         CamX = OldX + Speed\n      end\n   elseif X < CamX then\n      CamX = CamX - math.min(Speed, CamX - X)\n      --if CamX > OldX - Speed then\n         CamX = OldX - Speed\n      end\n   end\n   if Y > CamY then\n      CamY = CamY + math.min(Speed, Y - CamY)\n   elseif Y < CamY then\n      CamY = CamY - math.min(Speed, CamY + Y)\n   end\nend\n\nfunction WhileWon(ScKey)\n   TimeTillMenu = TimeTillMenu - 1\n   local ScBo = ObjTab[ScKey]\n   CamFollowPos(ScBo[\"X\"] - (SizeX*.5), ScBo[\"Y\"] - (SizeY*.5), 4)\n   if TimeTillMenu <= 0 then\n      GT.OutOfLives\n   end\nend\n\n-- Object Related Stuff --\n\nfunction GT.SackDie\n   local CurCheck = ChPtTab[CurChPt]\n   local Sac = ObjTab[6]\n   Aced = false\n   CurCheck[\"Lives\"] = CurCheck[\"Lives\"] - 1\n   print(CurCheck[\"Lives\"], CurCheck[\"MaxLives\"], CurCheck[\"Lives\"]\/CurCheck[\"MaxLives\"])\n   if 0 > CurCheck[\"Lives\"] then\n      GT.OutOfLives\n   end\n   Score = Score - (Score*.05)\n   Sac[\"X\"] = CurCheck[\"X\"]\n   Sac[\"Y\"] = CurCheck[\"Y\"]\n   Sac[\"XVol\"], Sac[\"YVol\"] = 0, 0\nend\n\n\n-- Lighting Functions\nfunction GenerateLightingTable\n   LightingTable = {}\n   for y=1, 100 do\n      LightingTable[y] = {}\n      for x=1, 100 do\n         LightingTable[y][x] = 255\n      end\n   end\nend\n\nreturn","TSWRes Draw2.lua":"if not TSW then require \"TSWRes Game\" end\n\n-- Draw Object Elements --\nfunction Draw.PodButton(Str, X1, Y1, X2, Y2, FCol)\n   local XSize = X2 - X1\n   draw.fillroundedrect(X1, Y1, X2, Y2, 6, FCol)\n   draw.roundedrect(X1, Y1, X2, Y2, 6, draw.black)\n   draw.string(Str, X1+( (XSize) \/ 2 - (draw.stringsize(Str)\/2)), Y2 - 24, draw.black)\nend\n\nfunction Draw.Button(Str, X1, Y1, X2, Y2, FCol)\n   local XSize = X2 - X1\n   local XL, YL = draw.stringsize(Str)\n   draw.fillroundedrect(X1, Y1, X2, Y2, 6, FCol)\n   draw.roundedrect(X1, Y1, X2, Y2, 6, draw.black)\n   --draw.string(Str, X1 + ((XSize)*.5 - (XL*.5)), Y2 - (((Y2 - Y1)*.5) + (YL*.5)), draw.black)\n   draw.stringinrect(Str, X1, Y1 + (((Y2 - Y1)*.5) + (YL*.5))*.3, X2, Y2, draw.black)\nend\n\nfunction Draw.ProgressBar(Value, X1, Y1, X2, Y2, OutCol)\n   draw.fillroundedrect(X1, Y1, ((Value)*(X2-(X1*2)))+X1, Y2, 4, PlayCol2)\n   draw.roundedrect(X1, Y1, X2, Y2, 4, OutCol or draw.white)\nend","TSWRes DrawToolIco.lua":"if not TSW then require \"TSWRes Game\" end\n-- Draw Tool Icons --\nfunction Draw.PopitCursor(X, Y, Size)\n   draw.fillcircle(X, Y - (Size\/4), Size*(16\/32), PlayCol2)\n   draw.fillcircle(X, Y - (Size\/4), Size*(12\/32), PlayCol1)\n   draw.fillcircle(X, Y - (Size\/4), Size*(8\/32), PlayCol2)\n   draw.line(X, Y, X - (Size\/32), Y + (.5*Size), PlayCol2)\nend\n\nfunction Draw.StickerEditIco(X, Y, Size)\n   draw.fillrect(X - Size, Y - Size, X + (Size*.6), Y + Size, draw.white)\n   draw.fillrect(X - Size, Y - (Size*.6), X + Size, Y + Size, draw.white)\n   draw.line(X + (Size*.6), Y - Size, X + Size, Y - (Size*.6), draw.white)\nend\n\nfunction Draw.CornerEditIco(X, Y, Size)\n   draw.fillrect(X, Y, X + Size, Y + Size, draw.white)\n\nend\n\nfunction Draw.MaterialChangerIco(X, Y, Size)\n   draw.fillrect(X - Size, Y, X, Y + Size, draw.blue)\n   draw.fillrect(X, Y, X + Size, Y + Size, draw.white)\nend\n\nfunction Draw.CollideIco(X, Y, Size)\n   draw.fillrect(X, Y, X + Size, Y + Size, draw.blue)\n\nend\n\nfunction Draw.WaterToolIco(X, Y, Size)\n   draw.fillrect(X - Size, Y, X + Size, Y + Size, draw.blue)\n   draw.rect(X - Size, Y, X + Size, Y + Size, draw.black)\nend\n\nfunction Draw.CaptureToolIco(X, Y, Size)\n   draw.rect(X - (Size*.8), Y - (Size*.8), X + (Size*.8), Y + (Size*.8), PlayCol2)\n   --draw.fillrect(X - Size, Y, X, Y + Size, draw.white)\n   draw.transformedimage(\"Images\/GoodiesBag.png\", X - (Size*.5), Y + (Size*.5), Size*.02, 0)\nend\n\nfunction Draw.StaticIco(X, Y, Size)\n   draw.triangle(X - Size, Y, X, Y - Size, X + Size, Y, draw.white)\n\nend\n\n\nfunction Draw.TweakToolIco(X, Y, Size)\n\n\nend\n\nreturn","TSWRes BGs.lua":"if not TSW then require \"TSWRes Game\" end\n\nfunction Draw.BGs.Default\n   draw.clear(Col255(128, 164, 255))\nend\n\nfunction Draw.BGs.Exit\n   draw.clear(Col255(10, 10, 100))\nend\n\nfunction Draw.BGs.Loading(String)\n   draw.clear(Col255(255, 255, 255))\n   draw.fillcircle(SizeX*.5, SizeY*.3, 24, PlayCol1)\n   local Rand = math.random(1, #Strings.Loading)\n   local RanString = String or Strings.Loading[Rand]\n   draw.string(RanString, (SizeX*.5) - (draw.stringsize(RanString)\/2), SizeY*.4, draw.black)\nend\n\n-- Play Mode Start Menu\nfunction Draw.BGs.PStartMenu\n   draw.clear(Col255(128, 164, 255))\n   draw.fillroundedrect(32, 32, SizeX-32, SizeY-32, 4, draw.black)\n   draw.roundedrect(32, 32, SizeX-32, SizeY-32, 4, PlayCol1)\n   Draw.Button(\"\", 32, 32, 64, 64, PlayCol1)\n   draw.line(32,32,64,64,draw.red)\n   draw.line(64,32,32,64,draw.red)\n   Draw.Button(LevelTab[\"Name\"], 64, 32, SizeX-64, 64, PlayCol1)\n   Draw.Button(\"Review\", 64, 96, 256, 128, PlayCol1)\n   Draw.Button(\"Return to Pod\", 64, 160, 192, 192, PlayCol1)\n   Draw.Button(\"Off\",224, 160, 256, 192, PlayCol1)\n   Draw.Button(\"Small\", 256, 160, 288, 192, PlayCol1)\nend\n\n-- Create Mode Stuff --\n\n-- Create Mode Start Menu\nfunction Draw.BGs.CStartMenu\n   draw.clear(Col255(128, 164, 255))\n   draw.fillroundedrect(32, 32, SizeX-32, SizeY-32, 4, draw.black)\n   draw.roundedrect(32, 32, SizeX-32, SizeY-32, 4, PlayCol1)\n   Draw.Button(\"\", 32, 32, 64, 64, PlayCol1)\n   draw.line(32,32,64,64,draw.red)\n   draw.line(64,32,32,64,draw.red)\n   Draw.Button(LevelTab[\"Name\"], 64, 32, SizeX-64, 64, PlayCol1)\n   Draw.Button(\"Save\", 64, 96, 160, 128, PlayCol1)\n   Draw.Button(\"Save as...\", 64, 128, 160, 160, PlayCol1)\n   Draw.Button(\"Save Copy\", 64, 160, 160, 192, PlayCol1)\n   Draw.Button(\"Return to Pod\", 64, 192, 192, 224, PlayCol1)\n   Draw.Button(\"Off\", 224, 96, 288, 128, PlayCol1)\n   Draw.Button(\"Small\", 224, 128, 288, 160, PlayCol1)\n   Draw.Button(\"Medium\", 224, 160, 288, 192, PlayCol1)\n   Draw.Button(\"Large\", 224, 192, 288, 224, PlayCol1)\nend\n\n-- Create Mode Level Details Menu\nfunction Draw.BGs.CLDMenu\n   draw.clear(Col255(128, 164, 255))\n   draw.fillroundedrect(32, 32, SizeX-32, SizeY-32, 4, draw.black)\n   draw.roundedrect(32, 32, SizeX-32, SizeY-32, 4, PlayCol1)\n   Draw.PodButton(\"\", 32, 32, 64, 64, PlayCol1)\n   draw.line(32,32,64,64,draw.red)\n   draw.line(64,32,32,64,draw.red)\n   Draw.Button(LevelTab[\"Name\"], 64, 32, SizeX-64, 64, PlayCol1)\n   Draw.StringBoxR(LevelTab[\"Description\"], 64, 64, SizeX - 64, SizeY-128, PlayCol1)\n   Draw.Button(\"Labels\", SizeX - 128, SizeY-96, SizeX - 32, SizeY-64, PlayCol1)\n   Draw.Button(\"\", 32, SizeY-96, 128, SizeY-32, PlayCol1)\n   draw.fillcircle(64, (SizeY-64), 32, draw.white)\n   Stickers[LevelTab[\"Icon\"] or \"nil\"](64, (SizeY-64), 32)\nend\n\nfunction Draw.BGs.CLDIconsMenu\n   draw.clear(Col255(128, 164, 255))\n   draw.fillroundedrect(32, 32, SizeX-32, SizeY-32, 4, draw.black)\n   Draw.Button(\"\", 32, 32, 64, 64, PlayCol1)\n   draw.line(32,32,64,64,draw.red)\n   draw.line(64,32,32,64,draw.red)\n   Draw.PrintStickIcons(Stickers, 32, 64, SizeX-64,SizeY-32)\nend\n\n-- Labels Menu\nfunction Draw.BGs.CLDLabelsMenu\n   draw.clear(Col255(128, 164, 255))\n   draw.fillroundedrect(32, 32, SizeX-32, SizeY-32, 4, draw.black)\n   Draw.Button(\"\", 32, 32, 64, 64, PlayCol1)\n   draw.line(32,32,64,64,draw.red)\n   draw.line(64,32,32,64,draw.red)\nend\n\n-- Modal Menus --\n\n-- Yes No Menu\nfunction Draw.BGs.YesNo(Title, Des, B1Col, B2Col, B1Txt, B2Txt)\n   B1Txt, B2Txt = B1Txt or \"Yes\", B2Txt or \"No\"\n   draw.clear(Col255(48, 48, 60))\n   draw.fillroundedrect(48, 48, SizeX-48, SizeY-48, 4, PlayCol1)\n   draw.setfont(\"Arial\", 24)\n   draw.string(Title, (SizeX*.5) - (draw.stringsize(Title)\/2), 48, draw.black)\n   draw.setfont(\"Arial\", 16)\n   draw.stringinrect(Des, 48, 96, SizeX - 48, SizeY - 96, draw.black)\n   Draw.Button(B1Txt, 48+24, SizeY-96, SizeX*.5, SizeY-48, B1Col)\n   Draw.Button(B2Txt, SizeX*.5, SizeY-96, SizeX-(48+24), SizeY-48, B2Col)\nend\n\n-- Corrupted Profile Menu\nfunction Draw.BGs.CorruptProfile(ProfileOk, StoryOk, MMOk, ComOk)\n   draw.clear\n   if not ProfileOk and not StoryOk and not MMOk and not ComOk then\n      local Title = \"Profile is corrupt or unloadable\"\n      draw.string(Title, (SizeX*.5) - (draw.stringsize(Title)\/2), SizeY*.1, draw.black)\n   else\n      local Title = \"Profile is corrupt or unloadable\"\n      draw.string(Title, (SizeX*.5) - (draw.stringsize(Title)\/2), 0--SizeY*.1, draw.black)\n      draw.string(\"Profile: \"..tostring(ProfileOk), 16, 32, draw.black)\n      draw.string(\"Story: \"..tostring(StoryOk), 16, 48, draw.black)\n      draw.string(\"My Moon: \"..tostring(MMOk), 16, 64, draw.black)\n      draw.string(\"Community: \"..tostring(ComOk), 16, 80, draw.black)\n   end\nend\n\n-- Menus --\n\n-- Pod Control Menu\nfunction Draw.BGs.Pod\n   draw.clear(Col255(48, 48, 60))\n   Draw.PodButton(\"Community Moon\", 24, 128, 128, 256, Col255(96, 96, 200))\n   if SavedFile.SFJSON then\n      DrCo.PlayerIcon(76, 180, 48, SavedFile.SFJSON[\"Icon\"])\n   end\n   Draw.PodButton(\"Story Planet\", 128 + 24, 128, 128 + 128, 256, Col255(96, 96, 200))\n   Draw.PodButton(\"My Moon\", 256 + 24, 128, 256 + 128, 256, Col255(96, 96, 200))\n   Stickers[\"My Moon\"](280 + ((128 - 24)*.5), (128 + 64), 32)\n   Draw.PodButton(\"Pod\", 384 + 24, 128, 384 + 72, 256, Col255(96, 96, 200))\n   Draw.Button(\"Settings\", 0, SizeY - 32, 128, SizeY, PlayCol1)\n   Draw.Button(\"Help\", 128, SizeY - 32, 256, SizeY, PlayCol1)\n   Draw.Button(\"Credits\", 256, SizeY - 32, 384, SizeY, PlayCol1)\n   Draw.Button(\"Exit\", 384, SizeY - 32, SizeX, SizeY, PlayCol1)\n   --Stickers[\"LBPLTSW\"](SizeX\/2, 64, 128)\n   draw.string(Strings.Version, SizeX*.8, 96, draw.white)\nend\n\n-- Credits Menu\nfunction Draw.BGs.Credits\n   draw.clear(Col255(48, 48, 60))\n   Draw.Button(\"Back\", 24, SizeY - 64, 128, SizeY - 32, PlayCol1)\n   local Credits = Strings.Credits\n   draw.setfont(\"Arial\", 28)\n   draw.string(Credits.Title, 24, 24, draw.blue)\n   draw.setfont(\"Arial\", 16)\n   draw.string(Credits.SubTitle, 24, 64, draw.white)\n   Draw.LuaIcon(SizeX-96, SizeY-96, SizeX-48, SizeY-48)\n   draw.string(Credits.LuaURL, SizeX-128, SizeY-16, draw.white)\nend\n\nrequire \"TSWRes BGs1\"\nrequire \"TSWRes BGs2\"\nrequire \"TSWRes BGs3\"\n\nfunction Draw.MMBC(Action)\n   if MAction == Action then\n      return PlayCol2\n   end\n   return PlayCol1\nend\n\n-- My Moon\nfunction Draw.BGs.MyMoon\n   draw.clear(Col255(48, 48, 160))\n   Draw.Button(\"\", 24, 32, SizeX-24, SizeY-32, PlayCol1)\n   if MyMoonLevels[\"SavedLevelTab\"] then\n      for k,v in ipairs(MyMoonLevels[\"SavedLevelTab\"]) do\n         Draw.PodButton(\"\", 32, (32+LevScr+((k-1)*64)), SizeX-48, (32+LevScr+(k*64)), PlayCol1)\n         draw.fillcircle(64, (64+LevScr+((k-1)*64)), 32, draw.white)\n         Stickers[v[\"Icon\"] or \"nil\"](64, (64+LevScr+((k-1)*64)), 32)\n         draw.string(v[\"Name\"], 96, (32+LevScr+((k-1)*64)), draw.white)\n         draw.string(ObjRes.BytesPlus(v[\"Size\"]), 96, (48+LevScr+((k-1)*64)), draw.white)\n      end\n   else -- SavedData\/\n      draw.stringinrect(\"There are no levels to load!\", 24, 32, SizeX-24, SizeY-32, draw.black)\n   end\n   Draw.Button(\"Back\", 0, SizeY - 32, 128, SizeY, PlayCol1)\n   Draw.Button(\"New\", 0, 0, 128, 32, PlayCol1)\n   Draw.Button(\"Delete\", 128, 0, 256, 32, Draw.MMBC(\"Delete\"))\n   draw.fillrect(SizeX-32, 32, SizeX, 64, PlayCol2)\n   draw.fillrect(SizeX-32, SizeY-64, SizeX, SizeY-32, PlayCol2)\n   local SLT = SavedLevelTab\nend\n\nreturn","TSWRes CommunityPlayIcons.lua":"PlayIcons = {}\n\nPlayIcons[\"White Square\"] = function(X, Y, Size)\n   local Col = draw.white\n   draw.fillrect(X-Size, Y-Size, X+Size, Y+Size, Col)\nend\n\nPlayIcons[\"Blue Square\"] = function(X, Y, Size)\n   local Col = draw.blue\n   draw.fillrect(X-Size, Y-Size, X+Size, Y+Size, Col)\nend\n\nPlayIcons[\"Red Square\"] = function(X, Y, Size)\n   local Col = draw.red\n   draw.fillrect(X-Size, Y-Size, X+Size, Y+Size, Col)\nend\n\nPlayIcons[\"Green Square\"] = function(X, Y, Size)\n   local Col = draw.green\n   draw.fillrect(X-Size, Y-Size, X+Size, Y+Size, Col)\nend\n\nPlayIcons[\"Sackboy\"] = function(X, Y, Size)\n   --local Col = draw.green\n   draw.fillrect(X-Size, Y-Size, X+Size, Y+Size, Col)\nend\n\nPlayIcons[\"Shade\"] = function(X, Y, Size) end\n\nPlayIcons[\"Sukan\"] = function(X, Y, Size) end\n\nPlayIcons[\"Sean\"] = function(X, Y, Size) end\n\nPlayIcons[\"Sackbot\"] = function(X, Y, Size) end\n\nPlayIcons[\"Emitter\"] = function(X, Y, Size) end\n\nreturn","TSWRes Community3.lua":"if not TSW then require \"TSWRes Game\" end\n\n-- Load levels on the current page\nfunction Community.GetLevelsOnPage(Search)\n   if not Search then Search = \"Newest Levels\" end\n   Community.LevelsOnPage = {}\n   local LevelTab = {\n      [\"Name\"] = \"Example Level\",\n      [\"Description\"] = \"This level is a test of the Community features of Tag's Super World.\",\n      [\"Icon\"] = \"nil\",\n      [\"Labels\"] = {},\n      [\"LevelID\"] = 1,\n      [\"Creator\"] = \"Tag\",\n      [\"LevelSize\"] = 2048,\n      [\"Likes\"] = 2,\n      [\"Dislikes\"] = 8,\n      [\"Plays\"] = 24,\n      [\"Hearts\"] = 10,\n      [\"LBPPicked\"] = true,\n   }\n   Community.LevelsOnPage[1] = LevelTab\nend\n\nfunction Community.DownloadLevelString(LevelID)\n   return \"\"\nend\n\nfunction Community.DownloadLevel(LevelID)\n   local String = Community.DownloadLevelString(LevelID)\nend","TSWRes CommunityDraw.lua":"Draw.Community = {}\nDrCo = Draw.Community\n\nfunction DrCo.PlayerIcon(X, Y, Size, Icon)\n   draw.fillrect(X-(Size*.8), Y-Size, X+(Size*.8), Y+Size, draw.white)\n   draw.fillrect(X-(Size*.6), Y-(Size*.8), X+(Size*.6), Y+(Size*.4), draw.black)\n   if Icon then\n      local Run = PlayIcons[tostring(Icon)]\n      Run(X, Y-(Size*.2), Size*.7)\n   end\nend\n\nfunction Draw.PrintPlayIcons(t,X1,Y1,X2,Y2)\n   t2=t2 or t\n   local X2, Y2 = X2 or SizeX, Y2 or SizeY\n   local FunX,FunY = X1, Y1\n   local DwSize, IcoSize = 1, 64\n   local OptSz = 64\n   local DISz = (IcoSize*DwSize)\n   local Odd = false\n   local Col = nil\n   for k,v in pairs(t) do\n      Odd = not Odd\n      if Odd then\n         Col = PlayCol1\n      else\n         Col = PlayCol2\n      end\n      --print(t)\n      --print(k, v, Func)\n      draw.fillrect(FunX, FunY, FunX+64, FunY+64, Col)\n      DrCo.PlayerIcon(FunX + 32, FunY + 32, 32, k)\n      FunX = FunX + OptSz\n      if FunX + OptSz > X2 then\n         FunX, FunY = X1, FunY + OptSz\n      end\n   end\nend","TSWRes GameCM1.lua":"if not TSW then require \"TSWRes Game\" end\n-- Create Mode Start Menu --\n\n-- Gets the icon touched\nfunction CLDIcoTapped(TX, TY, Scroll)\n   t2=t2 or t\n   local X1 = 32\n   local X2, Y2 = SizeX - 32, SizeY-32\n   local FunX,FunY = 32, 64\n   local DwSize, IcoSize = 1, 64\n   local OptSz = 64\n   local DISz = (IcoSize*DwSize)\n   for k,v in pairs(Stickers) do\n      local TappedIcon = TRec(FunX, FunY, FunX+64, FunY+64, TX, TY + Scroll)\n      if TappedIcon then\n         LevelTab[\"Icon\"] = k\n         Action = \"Close\"\n         return k\n      end\n      FunX = FunX + OptSz\n      if FunX + OptSz > X2 then\n         FunX, FunY = X1, FunY + OptSz\n      end\n   end\nend\n\n-- Icon Menu Touch\nfunction CLDIcoTouch(TX, TY)\n   local ClosePress = TRec(32, 32, 64, 64, TX, TY)\n   local Scroll = 0\n   if ClosePress then\n      Action = \"Close\"\n      return\n   else\n      CLDIcoTapped(TX, TY, Scroll)\n   end\nend\n\n-- Level Icons\nfunction GT.LDIconsMenu\n   for i=1, math.huge do\n      draw.tracktouches(Nil, Nil, CLDIcoTouch)\n      local OldTime = sys.gettime\n      Action = nil\n      draw.beginframe\n      Draw.BGs.CLDIconsMenu\n      draw.endframe\n      draw.doevents\n      if Action == \"Close\" then\n         Action = nil\n         return\n      end\n      Sleep(OldTime)\n   end\nend\n\n-- Labels Menu Touch\nfunction CLDLabTouch(TX, TY)\n   local ClosePress = TRec(32, 32, 64, 64, TX, TY)\n   if ClosePress then\n      Action = \"Close\"\n      return\n   end\nend\n\n-- Labels\nfunction GT.LDLabelsMenu\n   for i=1, math.huge do\n      local OldTime = sys.gettime\n      draw.tracktouches(Nil, Nil, CLDLabTouch)\n      Action = nil\n      draw.beginframe\n      Draw.BGs.CLDLabelsMenu\n      draw.endframe\n      draw.doevents\n      if Action == \"Close\" then\n         Action = nil\n         return\n      end\n      Sleep(OldTime)\n   end\nend\n\n-- Create Mode Level Details Touch\nfunction CLDMTouch(TX, TY)\n   local ClosePress = TRec(32, 32, 64, 64, TX, TY)\n   local LvNamePress = TRec(64, 32, SizeX-64, 64, TX, TY)\n   local LvDescTap = TRec(64, 64, SizeX - 32, SizeY-128, TX, TY)\n   local LvLabTap = TRec(SizeX - 128, SizeY-96, SizeX - 32, SizeY-64, TX, TY)\n   local LvIconTap = TRec(64, SizeY-96, 256, SizeY-32, TX, TY)\n   if ClosePress then\n      Action = \"Close\"\n      return\n   elseif LvNamePress then\n      Action = \"Name\"\n      return\n   elseif LvDescTap then\n      Action = \"Description\"\n      return\n   elseif LvLabTap then\n      Action = \"Labels\"\n      return\n   elseif LvIconTap then\n      Action = \"Icon\"\n      return\n   end\nend\n\n-- The Level Details Menu\nfunction GT.LevelDetailsMenu\n   Action = nil\n   --if type(LevelTab) ~= \"table\" then\n   LevelTab = {[\"Name\"] = \"Broken Level\", [\"Description\"] = \"This level had no LevelTab.\"}\nend\n   for i=1, math.huge do\n      local OldTime = sys.gettime\n      draw.tracktouches(Nil, Nil, CLDMTouch)\n      Action = nil\n      draw.beginframe\n      Draw.BGs.CLDMenu\n      draw.endframe\n      draw.doevents\n      if Action == \"Name\" then\n         if Key == nil then\n            Key = require \"TSKeyboard\"\n            SX, SY = draw.getport\n         end\n         LevelTab[\"Name\"] = Key.Keyboard(\"Level Name\", LevelTab[\"Name\"])\n      elseif Action == \"Description\" then\n         if Key == nil then\n            Key = require \"TSKeyboard\"\n            SX, SY = draw.getport\n         end\n         LevelTab[\"Description\"] = Key.Keyboard(\"Level Description\", LevelTab[\"Description\"])\n      elseif Action == \"Icon\" then\n         GT.LDIconsMenu\n      elseif Action == \"Labels\" then\n         GT.LDLabelsMenu\n      elseif Action == \"Close\" then\n         Action = nil\n         return\n      end\n      ToPod = nil\n      Action = nil\n      local NewTime = sys.gettime\n      local Frame = (NewTime-OldTime)\n      CG\n      Sleep(OldTime)\n   end\nend\n\n-- Create Mode Start Menu Touch\nfunction CSMTouch(TX, TY)\n   local ClosePress = TRec(32, 32, 64, 64, TX, TY)\n   local LvDetPress = TRec(64, 32, SizeX-64, 64, TX, TY)\n   local SaveTap = TRec(64, 96, 160, 128, TX, TY)\n   local SaveNewTap = TRec(64, 160, 160, 192, TX, TY)\n   local ReToPoTap = TRec(64, 192, 192, 224, TX, TY)\n   local GridOffTap = TRec(224, 96, 288, 128, TX, TY)\n   local GridSmallTap = TRec(224, 128, 288, 160, TX, TY)\n   local GridMediumTap = TRec(224, 160, 288, 192, TX, TY)\n   local GridBigTap = TRec(224, 192, 288, 224, TX, TY)\n   if ClosePress then\n      Action = \"Close\"\n      return\n   elseif SaveTap then\n      Action = \"Save\"\n      return\n   elseif SaveNewTap then\n      Action = \"SaveAsNew\"\n      return\n   elseif ReToPoTap then\n      Action = \"ToPod\"\n      return\n   elseif LvDetPress then\n      Action = \"LevelDetails\"\n      return\n   elseif GridOffTap then -- Disable Grid\n      Grid = nil\n      return\n   elseif GridSmallTap then -- Set Grid to Small\n      Grid = 16\n      return\n   elseif GridMediumTap then -- Set Grid to Medium\n      Grid = 32\n      return\n   elseif GridBigTap then -- Set Grid to Big\n      Grid = 64\n      return\n   elseif GridHugeTap then -- Set Grid to Huge\n      Grid = 128\n      return\n   end\nend\n\n-- Create Mode Start Menu\nfunction GT.CStartMenu\n   draw.tracktouches(Nil, Nil, CSMTouch)\n   Action = nil\n   --if type(LevelTab) ~= \"table\" then\n   LevelTab = {[\"Name\"] = \"Broken Level\", [\"Description\"] = \"This level had no LevelTab.\"}\nend\n   for i=1, math.huge do\n      draw.tracktouches(Nil, Nil, CSMTouch)\n      local OldTime = sys.gettime\n      Action = nil\n      draw.beginframe\n      Draw.BGs.CStartMenu\n      draw.endframe\n      draw.doevents\n      if Action == \"Close\" then\n         return\n      elseif Action == \"Save\" then\n         --print(\"Saving Level...\")\n         GT.SaveLevel(GT.Vars.CurrentLevel)\n         return\n      elseif Action == \"SaveAsNew\" then\n         if GT.YesNo(\"Save new level?\", \"\", PlayCol1, PlayCol2, \"Yes\", \"No\") then\n            --print(\"Saving Level...\")\n            GT.SaveLevel(MyMoonLevels[\"Levels\"] + 1)\n            GT.Vars.CurrentLevel = MyMoonLevels[\"Levels\"]\n            return\n         end\n      elseif Action == \"ToPod\" then\n         if GT.YesNo(\"Exit?\", \"You will lose any changes made to your level.\", draw.red, PlayCol1, \"Yes\", \"No\") then\n            ToPod = true\n            return\n         end\n      elseif Action == \"PlayMode\" then\n\n      elseif Action == \"LevelDetails\" then\n         GT.LevelDetailsMenu\n      end\n      ToPod = nil\n      Action = nil\n      local NewTime = sys.gettime\n      local Frame = (NewTime-OldTime)\n      if Frame < 1\/FR then\n         CG\n      end\n      Sleep(OldTime)\n   end\nend\n\n\nreturn","JSON.lua":"\nlocal t = {}\n\n\n\n\n\n\nJSON Functions Begin\n\n\n\n\n--JSON Encoder and Parser for Lua 5.1\n--\n--Copyright 2007 Shaun Brown  (http:\/\/www.chipmunkav.com)\n--All Rights Reserved.\n\n--Permission is hereby granted, free of charge, to any person\n--obtaining a copy of this software to deal in the Software without\n--restriction, including without limitation the rights to use,\n--copy, modify, merge, publish, distribute, sublicense, and\/or\n--sell copies of the Software, and to permit persons to whom the\n--Software is furnished to do so, subject to the following conditions:\n\n--The above copyright notice and this permission notice shall be\n--included in all copies or substantial portions of the Software.\n--If you find this software useful please give www.chipmunkav.com a mention.\n\n--THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n--EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n--OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n--IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR\n--ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n--CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n--CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nlocal string = string\nlocal math = math\nlocal table = table\nlocal error = error\nlocal tonumber = tonumber\nlocal tostring = tostring\nlocal type = type\nlocal setmetatable = setmetatable\nlocal pairs = pairs\nlocal ipairs = ipairs\nlocal assert = assert\nlocal Chipmunk = Chipmunk\n\n\nlocal StringBuilder = {\n   buffer = {}\n}\n\nfunction StringBuilder:New\n   local o = {}\n   setmetatable(o, self)\n   self.__index = self\n   self.si = 0\n   o.buffer = {}\n   return o\nend\n\nfunction StringBuilder:Append(s)\n   self.buffer[#self.buffer+1] = s\nend\n\nfunction StringBuilder:ToString\n   return table.concat(self.buffer)\nend\n\nlocal JsonWriter = {\n   backslashes = {\n      ['\\b'] = \"\\\\b\",\n      ['\\t'] = \"\\\\t\",\n      ['\\n'] = \"\\\\n\",\n      ['\\f'] = \"\\\\f\",\n      ['\\r'] = \"\\\\r\",\n      ['\"']  = \"\\\\\\\"\",\n      ['\\\\'] = \"\\\\\\\\\",\n      ['\/']  = \"\\\\\/\"\n   }\n}\n\nfunction JsonWriter:New(pg)\n   local o = {}\n   o.writer = StringBuilder:New\n   setmetatable(o, self)\n   self.__index = self\n   self.pg = pg\n   return o\nend\n\nfunction JsonWriter:Append(s)\n   self.writer:Append(s)\nend\n\nfunction JsonWriter:ToString\n   return self.writer:ToString\nend\n\nfunction JsonWriter:Write(o)\n   local t = type(o)\n   if t == \"nil\" then\n      self:WriteNil\n   elseif t == \"boolean\" then\n      self:WriteString(o)\n   elseif t == \"number\" then\n      self:WriteString(o)\n   elseif t == \"string\" then\n      self:ParseString(o)\n   elseif t == \"table\" then\n      self:WriteTable(o)\n   elseif t == \"function\" then\n      self:WriteFunction(o)\n   elseif t == \"thread\" then\n      self:WriteError(o)\n   elseif t == \"userdata\" then\n      self:WriteError(o)\n   end\nend\n\nfunction JsonWriter:WriteNil\n   self:Append(\"null\")\nend\n\nfunction JsonWriter:WriteString(o)\n   self:Append(tostring(o))\nend\n\nfunction JsonWriter:ParseString(s)\n   self:Append('\"')\n   self:Append(string.gsub(s, \"[%z%c\\\\\\\"\/]\", function(n)\n      local c = self.backslashes[n]\n      if c then return c end\n      return string.format(\"\\\\u%.4X\", string.byte(n))\n   end))\n   self:Append('\"')\nend\n\nfunction JsonWriter:IsArray(t)\n   local count = 0\n   local isindex = function(k)\n      if type(k) == \"number\" and k > 0 then\n         if math.floor(k) == k then\n            return true\n         end\n      end\n      return false\n   end\n   for k,v in pairs(t) do\n      if self.pg ~= nil then self.pg(k, #t) end\n      if not isindex(k) then\n         return false, '{', '}'\n      else\n         count = math.max(count, k)\n      end\n   end\n   return true, '[', ']', count\nend\n\nfunction JsonWriter:WriteTable(t)\n   local ba, st, et, n = self:IsArray(t)\n   self:Append(st)\n   if ba then\n      for i = 1, n do\n         self:Write(t[i])\n         if i < n then\n            self:Append(',')\n         end\n      end\n   else\n      local first = true;\n      for k, v in pairs(t) do\n         if self.pg ~= nil then self.pg(k, #t, v) end\n         if not first then\n            self:Append(',')\n         end\n         first = false;\n         self:ParseString(k)\n         self:Append(':')\n         self:Write(v)\n      end\n   end\n   self:Append(et)\nend\n\nfunction JsonWriter:WriteError(o)\n   error(string.format(\n   \"Encoding of %s unsupported\",\n   tostring(o)))\nend\n\nfunction JsonWriter:WriteFunction(o)\n   if o == Null then\n      self:WriteNil\n   else\n      self:WriteError(o)\n   end\nend\n\nlocal StringReader = {\n   s = \"\",\n   i = 0\n}\n\nfunction StringReader:New(s)\n   local o = {}\n   setmetatable(o, self)\n   self.__index = self\n   o.s = s or o.s\n   return o\nend\n\nfunction StringReader:Peek\n   local i = self.i + 1\n   if self.pg ~= nil then self.pg(self.i, #self.s) end\n   if i <= #self.s then\n      return string.sub(self.s, i, i)\n   end\n   return nil\nend\n\nfunction StringReader:Next\n   self.i = self.i+1\n   if self.i <= #self.s then\n      return string.sub(self.s, self.i, self.i)\n   end\n   return nil\nend\n\nfunction StringReader:All\n   return self.s\nend\n\nlocal JsonReader = {\n   escapes = {\n      ['t'] = '\\t',\n      ['n'] = '\\n',\n      ['f'] = '\\f',\n      ['r'] = '\\r',\n      ['b'] = '\\b',\n   }\n}\n\nfunction JsonReader:New(s, pg)\n   local o = {}\n   o.reader = StringReader:New(s)\n   setmetatable(o, self)\n   self.__index = self\n   self.s = s\n   return o;\nend\n\nfunction JsonReader:Read\n   if self.li == nil then self.li = 0 end\n   self:SkipWhiteSpace\n   local peek = self:Peek\n   if peek == nil then\n      error(string.format(\n      \"Nil string: '%s'\",\n      self:All))\n   elseif peek == '{' then\n      return self:ReadObject\n   elseif peek == '[' then\n      return self:ReadArray\n   elseif peek == '\"' then\n      return self:ReadString\n   elseif string.find(peek, \"[%+%-%d]\") then\n      return self:ReadNumber\n   elseif peek == 't' then\n      return self:ReadTrue\n   elseif peek == 'f' then\n      return self:ReadFalse\n   elseif peek == 'n' then\n      return self:ReadNull\n   elseif peek == '\/' then\n      self:ReadComment\n      return self:Read\n   else\n      return nil\n   end\nend\n\nfunction JsonReader:ReadTrue\n   self:TestReservedWord{'t','r','u','e'}\n   return true\nend\n\nfunction JsonReader:ReadFalse\n   self:TestReservedWord{'f','a','l','s','e'}\n   return false\nend\n\nfunction JsonReader:ReadNull\n   self:TestReservedWord{'n','u','l','l'}\n   return nil\nend\n\nfunction JsonReader:TestReservedWord(t)\n   for i, v in ipairs(t) do\n      if self:Next ~= v then\n         error(string.format(\n         \"Error reading '%s': %s\",\n         table.concat(t),\n         self:All))\n      end\n   end\nend\n\nfunction JsonReader:ReadNumber\n   local result = self:Next\n   local peek = self:Peek\n   while peek ~= nil and string.find(\n   peek,\n   \"[%+%-%d%.eE]\") do\n      result = result .. self:Next\n     peek = self:Peek\n   end\n   result = tonumber(result)\n   if result == nil then\n      error(string.format(\n      \"Invalid number: '%s'\",\n      result))\n   else\n      return result\n   end\nend\n\nfunction JsonReader:ReadString\n   local result = \"\"\n   assert(self:Next == '\"')\n   --self.si = 0\n   while self:Peek ~= '\"' do\n      self.si = self.si + 1\n      local ch = self:Next\n      if ch == '\\\\' then\n      ch = self:Next\n      if self.escapes[ch] then\n         ch = self.escapes[ch]\n      end\n   end\n   result = result .. ch\nend\nassert(self:Next == '\"')\nlocal fromunicode = function(m)\n  return string.char(tonumber(m, 16))\nend\nreturn string.gsub(\nresult,\n\"u%x%x(%x%x)\",\nfromunicode)\nend\n\nfunction JsonReader:ReadComment\nassert(self:Next == '\/')\nlocal second = self:Next\nif second == '\/' then\n   self:ReadSingleLineComment\nelseif second == '*' then\n   self:ReadBlockComment\nelse\n   error(string.format(\n   \"Invalid comment: %s\",\n   self:All))\nend\nend\n\nfunction JsonReader:ReadBlockComment\nlocal done = false\nwhile not done do\n   self.si = self.si + 1\n   local ch = self:Next\n   if ch == '*' and self:Peek == '\/' then\n      done = true\n   end\n   if not done and\n   ch == '\/' and\n   self:Peek == \"*\" then\n      error(string.format(\n      \"Invalid comment: %s, '\/*' illegal.\",\n      self:All))\n   end\nend\nself:Next\nend\n\nfunction JsonReader:ReadSingleLineComment\nlocal ch = self:Next\nwhile ch ~= '\\r' and ch ~= '\\n' do\n   ch = self:Next\nend\nend\n\nfunction JsonReader:ReadArray\nlocal result = {}\nassert(self:Next == '[')\nlocal done = false\nif self:Peek == ']' then\n   done = true;\nend\nif not self.si then self.si = 0 end\nwhile not done do\n   self.si = self.si + 1\n   local item = self:Read\n   result[#result+1] = item\n   self:SkipWhiteSpace\n   if self:Peek == ']' then\n      done = true\n   end\n   if not done then\n      local ch = self:Next\n      if ch ~= ',' then\n         error(string.format(\n         \"Invalid array: '%s' due to: '%s'\",\n         self:All, ch))\n      end\n   end\nend\nassert(']' == self:Next)\nreturn result\nend\n\nfunction JsonReader:ReadObject\nlocal result = {}\nassert(self:Next == '{')\nlocal done = false\nif self:Peek == '}' then\n   done = true\nend\nif not self.si then self.si = 0 end\nwhile not done do\n   self.si = self.si + 1\n   local key = self:Read\n   if type(key) ~= \"string\" then\n      error(string.format(\n      \"Invalid non-string object key: %s\",\n      key))\n   end\n   self:SkipWhiteSpace\n   local ch = self:Next\n   if ch ~= ':' then\n      error(string.format(\n      \"Invalid object: '%s' due to: '%s'\",\n      self:All,\n      ch))\n   end\n   self:SkipWhiteSpace\n   local val = self:Read\n   result[key] = val\n   self:SkipWhiteSpace\n   if self:Peek == '}' then\n      done = true\n   end\n   if not done then\n      ch = self:Next\n      if ch ~= ',' then\n         error(string.format(\n         \"Invalid array: '%s' near: '%s'\",\n         self:All,\n         ch))\n      end\n   end\nend\nassert(self:Next == \"}\")\nreturn result\nend\n\nfunction JsonReader:SkipWhiteSpace\nlocal p = self:Peek\nwhile p ~= nil and string.find(p, \"[%s\/]\") do\n   if p == '\/' then\n      self:ReadComment\n   else\n      self:Next\n   end\n   p = self:Peek\nend\nend\n\nfunction JsonReader:Peek\nreturn self.reader:Peek\nend\n\nfunction JsonReader:Next\nreturn self.reader:Next\nend\n\nfunction JsonReader:All\nreturn self.reader:All\nend\n\nfunction Encode(o, pg)\nlocal writer = JsonWriter:New(pg)\nwriter.pg = pg\nwriter:Write(o, pg)\nreturn writer:ToString\nend\n\nfunction Decode(s, pg)\nlocal reader = JsonReader:New(s, pg)\nreturn reader:Read\nend\n\nfunction Null\nreturn Null\nend\n End JSON Parser \n\n\nt.DecodeJSON = function(jsonString, ProgFun)\nif type(jsonString) == \"string\" then\n   return Decode(jsonString, ProgFun)\nend\nprint(\"RbxUtil.DecodeJSON expects string argument!\")\nreturn nil\nend\n\nt.EncodeJSON = function(jsonTable, ProgFun)\nreturn Encode(jsonTable, ProgFun)\nend\n\nreturn t","TSWRes HTTP Browser1.lua":"local IPages = {} -- Internal Pages\nIPages[\"about:blank\"] = \n\n\n\nIPages[\"about:test\"] = <!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd\">\n \n   \n      Tag<\/title>\n   <\/head>\n   \n\n   <\/body>\n<\/html>\n\n\nreturn IPages","TSWRes Strings.lua":"-- Strings for Tag's Super World Created by Tag\nStrings = {}\nStrings.Version = \"Alpha 0.14\"\nStrings.Loading = {}\nfunction ReloadLoadingStrings\n   local Loading = Strings.Loading\n   Loading[1] = \"Cogitating\"\n   Loading[2] = \"Loading...\"\n   Loading[3] = \"Still in Alpha\"\n   Loading[4] = \"Got you now!\"\n   Loading[5] = \"Created by Tag\"\n   Loading[9001] = \"My name is Franklin Wadsworth Emerson\"\nend\nReloadLoadingStrings\n\nStrings.ThermometerNotice = \"Your level is starting to overheat! If you cannot place an object, it may cause the level to overheat when placed.\"\nStrings.ThermometerOverheatNotice = \"Your level has overheated! You cannot add objects as you are aready over the limit.\"\n\nStrings.Credits = {}\nlocal Credits = Strings.Credits\nCredits.Title = \"Tag's Super World\"\nCredits.SubTitle = \"A game built using Touch Lua\"\nCredits.MM = \"\"\nCredits.TSWCreator= \"Created by Tag365.\"\nCredits.Thanks = \"\"\nCredits.LuaURL = \"http:\/\/www.lua.org\/\"\nCredits.Version = \"Alpha 0.12.6\"\n\nStrings.WelcomeToLBP = {}\nWelcomeToLBP = Strings.WelcomeToLBP\n\nWelcomeToLBP[1] = \"Welcome to LittleBigPlanet!\"\n\nStrings.Story = {}\nStrings.Story.Planets = {\n  \"Cloudland\",\n   \"\",\n   \"\",\n   \"\",\n   \"\",\n   \"\",\n   \"\"\n}\n\nreturn Strings","TSWRes Tool1.lua":"if not TSW then require \"TSWRes Game\" end\nToolRes = {}\n\nfunction math.round(N)\n   if (N - math.floor(N)) < .5 then\n      return math.floor(N)\n   end\n   return math.ceil(N)\nend\n\nfunction OCTouch(TX, TY)\n   local PopitClosed = TRec(SizeX-96, SizeY-96, SizeX-32, SizeY-32,TX,TY)\n   CorTab = ObjSelected\n   if PopitClosed or Undo then\n      ObjSelected = nil\n      CorTab = nil\n      PopitCuTool = nil\n      return true\n   end\n   local TDirH, TDirV = TDPad(64, SizeY-96,TX,TY)\n   CamX, CamY = CamX + TDirH, CamY + TDirV\n   if TDirH == 0 and TDirV == 0 then\n      if LTV + TherAdd <= MT then\n         GT.SaveUndo\n         if IsLogicObject ~= \"Custom\" then\n            ObjTab[#ObjTab+1] = GT.CreObjTab(CorTab, TX + CamX, TY - CamY, Size or 16, TherAdd, false, SelectedMaterial)\n            local Object = ObjTab[#ObjTab]\n            if not Grid then\n               Object[\"X\"] = TX + CamX\n               Object[\"Y\"] = TY - CamY\n            else\n               Object[\"X\"] = math.round((TX + CamX)\/Grid)*Grid\n               Object[\"Y\"] = math.round((TY - CamY)\/Grid)*Grid\n            end\n            if CorTab == \"Checkpoint\" then\n               ChPtTab[#ChPtTab + 1] = GT.CreChPtTab(Type, 3, 3, false, #ObjTab, TX + CamX, TY - CamY)\n               local Tag = ObjTab[#ObjTab]\n               Tag[\"Link\"] = #ChPtTab\n            elseif CorTab == \"ScoreBubble\" then\n               ObjTab[#ObjTab][\"Inputs\"] = {}\n            end\n            if IsLogicObject == true then\n               ObjTab[#ObjTab][\"LogicObject\"] = true\n               ObjTab[#ObjTab][\"Inputs\"] = {}\n               ObjTab[#ObjTab][\"Size\"] = 16\n            end\n            LTV = LTV + TherAdd\n            PopitRes.PlaceSound\n         else\n            ObjTab[#ObjTab+1] = table.clone(CorTab)\n            local Object = ObjTab[#ObjTab]\n            if not Grid then\n               Object[\"X\"] = TX + CamX\n               Object[\"Y\"] = TY - CamY\n            else\n               Object[\"X\"] = math.round((TX + CamX)\/Grid)*Grid\n               Object[\"Y\"] = math.round((TY - CamY)\/Grid)*Grid\n            end\n            LTV = LTV + TherAdd\n            PopitRes.PlaceSound\n         end\n      else\n         PopitRes.UnavailSound\n      end\n   end\nend\n\nfunction ToolRes.ObjectCursor(CorTab, LogicObject)\n   IsLogicObject = LogicObject\n   Undo = false\n   PopitCuTool = \"Object Cursor\"\n   TherAdd, Size = 0, ObjRes.SizeTab[CorTab] or 16\n   local Resizeable = ObjRes.SizeTab[CorTab] == nil\n   ObjSelected = CorTab\n   if type(CorTab) == \"table\" then\n      TherAdd = 10*#CorTab\n   else\n      TherAdd = ObjRes.TherTab[CorTab] or 0\n   end\n   for i=1, math.huge do\n      local OldTime = sys.gettime\n      GT.DrawCMFrame\n      draw.doevents\n      local TX, TY = draw.tracktouches(Nil, CamMove, OCTouch)\n      if PopitCuTool == nil then\n         GT.SaveUndo\n         return\n      end\n      collectgarbage\n      Sleep(OldTime)\n   end\nend\n\n\nPopitRes.ObjectCursor = ToolRes.ObjectCursor\n\nrequire \"TSWRes Tool2\"\nrequire \"TSWRes Tool3\"\nrequire \"TSWRes Tool4\"\n\nreturn","TSWRes DrawCM.lua":"-- Create Mode Drawing stuff --\nif not TSW then require \"TSWRes Game\" end\n-- GUI --\nfunction Draw.Grid\n   if Grid then\n      local OffX = CamX - (math.floor(CamX\/Grid)*Grid)\n      local OffY = CamY - (math.floor(CamY\/Grid)*Grid)\n      for i=1, SizeX\/Grid + 2 do\n         draw.line((i*Grid) - OffX, 0, (i*Grid) - OffX, SizeY, draw.blue)\n      end\n      for i=1, SizeY\/Grid + 2 do\n         draw.line(0, ((i*Grid) + OffY) - Grid, SizeX, ((i*Grid) + OffY) - Grid, draw.blue)\n      end\n   end\nend\n\n\n-- Tool Gui\nfunction Draw.Tool(Tool)\n   if Tool == \"Popit Cursor\" then\n\n      if type(ObjSelected) == \"number\" then\n         v = ObjTab[ObjSelected]\n         local CT = v[\"CorTab\"]\n         if type(CT)--~=\"table\" then\n            Draw.Object(CT, SizeX-64, SizeY-64, ObjTooSiz[CT], v[\"RotRad\"], v[\"Mat\"] or SelectedMaterial, 0, true)\n            Draw.SizeControls(v[\"Size\"])\n         end\n      else\n         Draw.SizeControls\n         Draw.PopitCursor(SizeX-64, SizeY-64, 48)\n      end\n   elseif Tool == \"Object Cursor\" then\n      local CT = ObjSelected\n      Draw.Object(CT, SizeX-64, SizeY-64, ObjTooSiz[CT], 0, SelectedMaterial, ObjSelected, true)\n   elseif Tool == \"Corner Editor\" then\n      Draw.CornerEditIco(SizeX-64, SizeY-64, 32)\n   elseif Tool == \"Sticker Editor\" then\n      if StickerSelected then\n         local SS = StickerSelected\n         Stickers[SS[\"Sticker\"]](SizeX-64, SizeY-64, 32)\n      else\n         Draw.StickerEditIco(SizeX-64, SizeY-64, 32)\n      end\n   elseif Tool == \"Sticker Cursor\" then\n      local SS = StickerSelected\n      local Stick = Stickers[SS[\"Sticker\"]]\n      Stick(SizeX-64, SizeY-64, 32)\n   elseif Tool == \"Material Changer\" then\n      Draw.MaterialChangerIco(SizeX-64, SizeY-64, 32)\n   elseif Tool == \"Water Tool\" then\n      Draw.WaterToolIco(SizeX-64, SizeY-64, 32)\n   elseif Tool == \"Capture Tool\" then\n      Draw.CaptureToolIco(SizeX-64, SizeY-64, 32)\n   elseif Tool == \"Collision Tool\" then\n      Draw.CollideIco(SizeX-64, SizeY-64, 32)\n   elseif Tool == \"Tweak Tool\" then\n      Draw.TweakToolIco(SizeX-64, SizeY-64, 32)\n   else\n      draw.fillroundedrect(SizeX - (96 - 12), SizeY - 96, SizeX - (32 + 12), SizeY - 32, 4, PlayCol1)\n   end\nend\n\n\nfunction Draw.ZoomControls\n   draw.fillroundedrect(SizeX - 192, SizeY - 96, SizeX - 96, SizeY - 64, 4, PlayCol1)\n   draw.roundedrect(SizeX - 192, SizeY - 96, SizeX - 96, SizeY-64, 4, PlayCol2)\n   draw.string(Zoom, SizeX - 192, SizeY - 96, PCBG)\n   Draw.StringBoxR(\"-\", SizeX - 160, SizeY - 96, SizeX - 128, SizeY - 64, PlayCol1)\n   Draw.StringBoxR(\"+\", SizeX - 128, SizeY - 96, SizeX - 96, SizeY - 64, PlayCol1)\nend\n\nfunction Draw.SizeControls(SizeVal)\n   Draw.StringBoxR(\"+\", 32, 32, 64, 64, PlayCol1)\n   Draw.StringBoxR(\"-\", 64, 32, 96, 64, PlayCol1)\n   if SizeVal then\n      Draw.StringBoxR(SizeVal, 96, 32, 160, 64, PlayCol1)\n   end\nend\n\n-- The Thermometer\nfunction Draw.Thermometer(Value, X, Y, X2, Y2, Color)\n   local line = draw.line\n   local ThT = (Y2 - Y)\n   if Value > .9 then\n      GT.ThNotice\n      ThermoPus, TPS = Math.Bounce(ThermoPus, 255, 16, TPS)\n   else\n      ThermoPus, TPS = 16, 0\n   end\n   if Value > 1 then\n      GT.ThOverNotice\n      ThermoPus, TPS = Math.Bounce(ThermoPus, 255, 32, TPS)\n   end\n   local FillColor = Color or Draw.Col255(255,ThermoPus,ThermoPus)\n   draw.circle(X + 12, Y2 + 12, 24, draw.white)\n   draw.rect(X, Y2 - (ThT), X2, Y2, draw.white)\n   draw.fillrect(X + 2, math.max(Y2 - (ThT*Value), 16),X2 - 2,Y2 ,FillColor)\n   draw.arc(X + ((X2 - X)\/2), Y, (X2 - X)\/2, -(math.pi), 0, draw.white )\n   draw.setantialias(false)\n   line(X + 4, Y + (ThT*.875), X2, Y + (ThT*.875), draw.white)\n   line(X, Y+(ThT*.75), X2, Y+(ThT*.75), draw.white)\n   line(X+4, Y+(ThT*.625), X2, Y+(ThT*.625), draw.white)\n   line(X, Y+(ThT*.5), X2, Y+(ThT*.5), draw.white)\n   line(X+4, Y+(ThT*.375), X2, Y+(ThT*.375), draw.white)\n   line(X, Y+(ThT*.25), X2, Y+(ThT*.25), draw.white)\n   line(X+4, Y+(ThT*.125), X2, Y+(ThT*.125), draw.white)\n   draw.setantialias(true)\n   draw.fillcircle(X+12, Y2+12, 21, FillColor)\nend\n\nreturn","TSWRes ObjectsMaterial.lua":"-- Material Objects --\nif not TSW then require \"TSWRes Game\" end\n-- Square\nfunction ObjRes.Square(CorTab, X, Y, Size, RotRad, Mat, k)\n   draw.fillpolygon(X, Y, Size*1.41, 4, RotRad + (math.pi*.25), ObjMaterials[Mat] or draw.brown)\n   --if Mat == \"Cardboard\" then\n      draw.setclip(X - Size, Y - Size, X + Size, Y + Size)\n      draw.tiledimage(\"Images\/Cardboard.png\", X - Size, Y - Size, X + Size, Y + Size)\n      draw.clearclip\n   end\n   draw.polygon(X, Y, Size*1.41, 4, RotRad + (math.pi*.25), ObjMaterialsBorders[Mat] or draw.black)\n   if ObjSelected == k then\n      draw.polygon(X, Y, Size*1.41, 4, RotRad + (math.pi*.25), PlayCol1)\n   end\nend\n\n-- Triangle\nfunction ObjRes.Triangle(CorTab, X, Y, Size, RotRad, Mat, k)\n   draw.fillpolygon(X, Y, Size, 3, RotRad + (math.pi*.5), ObjMaterials[Mat] or draw.brown)\n   draw.polygon(X, Y, Size, 3, RotRad + (math.pi*.5), ObjMaterialsBorders[Mat] or draw.black)\n   if ObjSelected == k then\n      draw.polygon(X, Y, Size, 3, RotRad + (math.pi*.5), PlayCol1)\n   end\nend\n\n-- Pentagon\nfunction ObjRes.Pentagon(CorTab, X, Y, Size, RotRad, Mat, k)\n   draw.fillpolygon(X, Y, Size, 5, RotRad + (math.pi*.5), ObjMaterials[Mat] or draw.brown)\n   draw.polygon(X, Y, Size, 5, RotRad + (math.pi*.5), ObjMaterialsBorders[Mat] or draw.black)\n   if ObjSelected == k then\n      draw.polygon(X, Y, Size, 5, RotRad + (math.pi*.5), PlayCol1)\n   end\nend\n\n-- Hexagon\nfunction ObjRes.Hexagon(CorTab, X, Y, Size, RotRad, Mat, k)\n   draw.fillpolygon(X, Y, Size, 6, RotRad + (math.pi*.5), ObjMaterials[Mat] or draw.brown)\n   draw.polygon(X, Y, Size, 6, RotRad + (math.pi*.5), ObjMaterialsBorders[Mat] or draw.black)\n   if ObjSelected == k then\n      draw.polygon(X, Y, Size, 6, RotRad + (math.pi*.5), PlayCol1)\n   end\nend\n\n-- Octagon\nfunction ObjRes.Octagon(CorTab, X, Y, Size, RotRad, Mat, k)\n   draw.fillpolygon(X, Y, Size, 8, RotRad + (math.pi*.5), ObjMaterials[Mat] or draw.brown)\n   draw.polygon(X, Y, Size, 8, RotRad + (math.pi*.5), ObjMaterialsBorders[Mat] or draw.black)\n   if ObjSelected == k then\n      draw.polygon(X, Y, Size, 8, RotRad + (math.pi*.5), PlayCol1)\n   end\nend\n\n-- Five Pointed Star\nfunction ObjRes.FivePointStar(CorTab, X, Y, Size, RotRad, Mat, k)\n   draw.fillstar(X, Y, Size*.5, Size, 5, RotRad + (math.pi*.5), ObjMaterials[Mat] or draw.brown)\n   draw.star(X, Y, Size*.5, Size, 5, RotRad + (math.pi*.5), ObjMaterialsBorders[Mat] or draw.black)\n   if ObjSelected == k then\n      draw.star(X, Y, Size*.5, Size, 5, RotRad + (math.pi*.5), PlayCol1)\n   end\nend\n\n-- Six Pointed Star\nfunction ObjRes.SixPointStar(CorTab, X, Y, Size, RotRad, Mat, k)\n   draw.fillstar(X, Y, Size*.5, Size, 6, RotRad + (math.pi*.5), ObjMaterials[Mat] or draw.brown)\n   draw.star(X, Y, Size*.5, Size, 6, RotRad + (math.pi*.5), ObjMaterialsBorders[Mat] or draw.black)\n   if ObjSelected == k then\n      draw.star(X, Y, Size*.5, Size, 6, RotRad + (math.pi*.5), PlayCol1)\n   end\nend\n\n-- Circle\nfunction ObjRes.Circle(CorTab, X, Y, Size, RotRad, Mat, k)\n   draw.fillcircle(X, Y, Size, ObjMaterials[Mat] or draw.brown)\n   draw.circle(X, Y, Size, ObjMaterialsBorders[Mat] or draw.black)\n   if ObjSelected == k then\n      draw.circle(X, Y, Size, PlayCol1)\n   end\nend\n\n-- For Custom Objects\nfunction ObjRes.Custom(CorTab, X, Y, Size, RotRad, Mat, k)\n   if not Size then Size = 32 end\n   local Line, filltriangle = draw.line, draw.filltriangle\n   local Col\n   if type(Mat) == \"table\" then\n      Col = Mat\n   else\n      Col = ObjMaterials[Mat] or draw.brown\n   end\n   --setmetatable(Col, Col255MT) -- use\n   local Col2 = ObjMaterialsBorders[Mat] or draw.black\n   --print(\"Size: \"..tostring(Size), \"k: \"..tostring(k))\n   for k, v in ipairs(CorTab) do\n      local FCor = CorTab[k-1] or CorTab[#CorTab]\n      local SCor = CorTab[k]\n      local TCor = CorTab[k+1] or CorTab[1]\n      filltriangle((FCor[1]*Size)+X, (FCor[2]*Size)+Y, (SCor[1]*Size)+X, (SCor[2]*Size)+Y, (TCor[1]*Size)+X, (TCor[2]*Size)+Y, Col)\n      Line((FCor[1]*Size)+X, (FCor[2]*Size)+Y, (SCor[1]*Size)+X, (SCor[2]*Size)+Y, Col2)\n   end\nend\n\nreturn","TSWRes HandleSackboy.lua":"function SacMove(TX, TY)\n   Sac = ObjTab[6]\n   local TDirH, TDirV = TDPad(64, SizeY-96,TX,TY)\n   Sac[\"XVol\"] = TDirH\n   local PopitClosed = TRec(SizeX-96, SizeY-96, SizeX-32, SizeY-32,TX, TY)\n   if PopitClosed then\n      GT.SackDie\n   end\n   if TDirV > 0 and Sac[\"YVol\"] > -.1 and Sac[\"YVol\"] < .4 then\n      if SackboyJumpAvail ~= false then\n         Sac[\"Y\"] = Sac[\"Y\"] -3.5\n         Sac[\"YVol\"] = -8\n         --print(\"Sackboy jumped\")\n      end\n   else\n      if TDirV <= 0 and Sac[\"YVol\"] < 4 then\n         Sac[\"YVol\"] = Sac[\"YVol\"] + (.6*.02)\n      end\n      SackboyJumpAvail = false\n   end\n   if Sac[\"YVol\"] > -.1 and Sac[\"YVol\"] < .4 then\n      SackboyJumpAvail = true\n   end\n   return TDirH or 0\nend","TSWRes Stick.lua":"-- Placeholder for Stickers.\nStickers = {}\n\nStickers[\"nil\"] = function end\n\nStickers[\"StickerEditor\"] = Draw.StickerEditIco\n\nStickers[\"LBPPick\"] = function(X, Y, Size)\n   local Pink = Draw.Col255(255, 0, 128)\n   draw.fillcircle(X, Y, Size, Pink)\nend\n\nStickers[\"White Square\"] = function(X, Y, Size)\n   local Col = draw.white\n   draw.fillrect(X-Size, Y-Size, X+Size, Y+Size, Col)\nend\n\nStickers[\"StickerIcon\"] = function(X, Y, Size)\n\nend\n\nStickers[\"White Gradient\"] = function(X, Y, Size)\n   local Col = Draw.Col255(255, 255, 255, 64)\n   draw.fillrect(X-Size, Y+Size, X+Size, Y-Size, Col)\n   draw.fillrect(X-Size, Y+(Size*.5), X+Size, Y-Size, Col)\n   draw.fillrect(X-Size, Y, X+Size, Y-Size, Col)\n   draw.fillrect(X-Size, Y-(Size*.5), X+Size, Y-Size, Col)\nend\n\nStickers[\"Wing\"] = function(X, Y, Size) end\nStickers[\"Brick\"] = function(X, Y, Size) end\nStickers[\"Cardboard\"] = function(X, Y, Size) end\nStickers[\"Tail\"] = function(X, Y, Size) end\n\nStickers[\"Blue and Black Stripes\"] = function(X,Y,Size)\n   draw.fillrect(X-Size, Y-(Size*.3), X+Size, Y+(Size*.3), Draw.Col255(0, 0, 213))\nend\n\nStickers[\"Sheep Head\"] = function(X, Y, Size) end\n\nStickers[\"Lua Icon\"] = function(X, Y, Size)\n   Draw.LuaIcon(X-Size, Y-Size, X+Size, Y+Size)\nend\n\nStickers[\"Lua Script\"] = function(X, Y, Size)\n   draw.fillrect(X-(Size*.5), Y-Size, X+(Size*.5), Y+Size, draw.white)\n   Draw.LuaIcon(X-(Size*.5), Y-(Size*.5), X+(Size*.5), Y+(Size*.5))\nend\n\nStickers[\"Tag's Super World\"] = function(X, Y, Size)\n   draw.setfont(\"Arial\", Size\/4.2)\n   draw.fillrect(X - Size, Y - (Size*.16), X + Size, Y + (Size*.16), draw.white)\n   draw.string(\"Tag's Super World\", X - (Size*.94), Y - (Size*.16), draw.black)\n   draw.setfont(\"Arial\", 16)\nend\n\nStickers[\"LittleBigPlanet Lua\"] = function(X, Y, Size)\n   Stickers[\"Lua Icon\"](X + (Size*.9), Y, Size*.2)\nend\n\nStickers[\"LBPLTSW\"] = function(X, Y, Size)\n   draw.fillrect(X - Size, Y - (Size*.3), X + Size, Y + (Size*.3), draw.blue)\n   Stickers[\"LittleBigPlanet Lua\"](X, Y, Size)\n   Stickers[\"Tag's Super World\"](X + (Size*.5), Y + (Size*.3), Size\/2)\nend\n\nStickers[\"My Moon\"] = function(X, Y, Size)\n   draw.fillcircle(X, Y, Size, draw.white)\nend\n\n\nfunction PrintTable(T)\n   print(\"PrintTable\", tostring(T))\n   for k, v in pairs(T) do\n      print(k, tostring(v))\n   end\nend\n\nPrintTable(Stickers)\n\nreturn Stickers","TSWRes DrawObjects.lua":"-- Draw Objects --\nif not TSW then require \"TSWRes Game\" end\n\nfunction Draw.MaterialObject(CorTab, X, Y, Size, RotRad, Mat, k, Abs)\n   if CorTab == \"Square\" then\n      ObjRes.Square(CorTab, X, Y, Size, RotRad, Mat, k)\n      --return\n   elseif CorTab == \"Circle\" then\n      ObjRes.Circle(CorTab, X, Y, Size, RotRad, Mat, k)\n      --return\n   elseif CorTab == \"Triangle\" then\n      ObjRes.Triangle(CorTab, X, Y, Size, RotRad, Mat, k)\n      --return\n   elseif CorTab == \"Pentagon\" then\n      ObjRes.Pentagon(CorTab, X, Y, Size, RotRad, Mat, k)\n      --return\n   elseif CorTab == \"Hexagon\" then\n      ObjRes.Hexagon(CorTab, X, Y, Size, RotRad, Mat, k)\n      --return\n   elseif CorTab == \"Octagon\" then\n      ObjRes.Octagon(CorTab, X, Y, Size, RotRad, Mat, k)\n      --return\n   end\n   if PopitCuTool == \"Static Tool\" and ObjTab[k][\"Dynam\"] == true then\n      draw.fillcircle(X, Y, 4, draw.blue)\n   end\nend\n\nfunction Draw.LogicObject(CorTab, X, Y, Size, RotRad, Mat, k, Abs)\n   if not Abs then X, Y, Size = ((X*Zoom) - CamX*(Zoom)), ((Y*Zoom) + CamY*(Zoom)), Size*Zoom end\n   if CorTab == \"AndGate\" then\n      ObjRes.AndGate(CorTab, X, Y, Size, RotRad, Mat, k)\n   elseif CorTab == \"OrGate\" then\n      ObjRes.OrGate(CorTab, X, Y, Size, RotRad, Mat, k)\n   elseif CorTab == \"NandGate\" then\n      ObjRes.NandGate(CorTab, X, Y, Size, RotRad, Mat, k)\n   elseif CorTab == \"NorGate\" then\n      ObjRes.NorGate(CorTab, X, Y, Size, RotRad, Mat, k)\n   elseif CorTab == \"PowerGate\" then\n      ObjRes.PowerGate(CorTab, X, Y, Size, RotRad, Mat, k)\n   elseif CorTab == \"Microchip\" then\n      ObjRes.Microchip(CorTab, X, Y, Size, RotRad, Mat, k)\n   end\nend\n\nfunction Draw.Object(CorTab, X, Y, Size, RotRad, Mat, k, Abs)\n   local Line = draw.line\n   local Rect = draw.rect\n   if not Abs then X, Y, Size = ((X*Zoom) - CamX*(Zoom)), ((Y*Zoom) + CamY*(Zoom)), Size*Zoom end\n   --if CorTab ~= \"LevelEdge\" then\n      draw.fillrect(X-Size, Y-Size, X+Size, Y+Size, draw.blue)\n   end\n   if (CorTab == \"Square\") or (CorTab == \"Circle\") or (CorTab == \"Triangle\") or (CorTab == \"Pentagon\") or (CorTab == \"Hexagon\") or (CorTab == \"Octagon\") then\n      Draw.MaterialObject(CorTab, X, Y, Size, RotRad, Mat, k, Abs)\n   elseif CorTab == \"LevelEdge\" then\n      draw.fillrect(X, Y, (1*Size)+X, (1*Size)+Y, ObjMaterials[\"Cloth\"])\n      Rect(X, Y, (1*Size)+X, (1*Size)+Y, ObjMaterialsBorders[\"Cloth\"])\n      return\n   elseif CorTab == \"Sackboy\" then\n      ObjRes.Sackboy(CorTab, X, Y, Size, RotRad, Mat, k, PlayCostume)\n      return\n   elseif CorTab == \"Entrance\" then\n      ObjRes.Entrance(CorTab, X, Y, Size, RotRad, Mat, k)\n      return\n   elseif CorTab == \"Checkpoint\" then\n      ObjRes.Checkpoint(CorTab, X, Y, Size, RotRad, Mat, k)\n      return\n   elseif CorTab == \"StartGate\" then\n      ObjRes.StartGate(CorTab, X, Y, Size, RotRad, Mat, k)\n      return\n   elseif CorTab == \"FinishGate\" then\n      ObjRes.FinishGate(CorTab, X, Y, Size, RotRad, Mat, k)\n      return\n   elseif CorTab == \"ScoreBubble\" then\n      ObjRes.ScoreBubble(CorTab, X, Y, Size, RotRad, Mat, k)\n      return\n   elseif CorTab == \"Scoreboard\" then\n      ObjRes.Scoreboard(CorTab, X, Y, Size, RotRad, Mat, k)\n      return\n   elseif CorTab == \"Button\" then\n      ObjRes.Button(CorTab, X, Y, Size, RotRad, Mat, k)\n      return\n   elseif CorTab == \"Spikes\" then\n      ObjRes.Spikes(CorTab, X, Y, Size, RotRad, Mat, k)\n      return\n   elseif CorTab == \"CorEdi\" then\n      Draw.CornerEditIco(X, Y, Size)\n      return\n   elseif CorTab == \"MatCha\" then\n      Draw.MaterialChangerIco(X, Y, Size)\n      return\n   elseif CorTab == \"StickerEditor\" then\n      Draw.StickerEditIco(X, Y, Size)\n      return\n   elseif CorTab == \"WaterTool\" then\n      Draw.WaterToolIco(X, Y, Size)\n      return\n   elseif CorTab == \"Capture Tool\" then\n      Draw.CaptureToolIco(X, Y, Size)\n      return\n   elseif CorTab == \"Static Tool\" then\n      Draw.StaticIco(X, Y, Size)\n      return\n   elseif type(CorTab) == \"table\" then\n      ObjRes.Custom(CorTab, X, Y, Size, RotRad, Mat, k)\n      return\n   else\n      --print(\"Warning: Unknown Object\")\n   end\nend\n\nfunction Draw.ObjectsInLevel(ObjTab)\n   local Object = Draw.Object\n   local TRec = TRec\n   local CamX, CamY = CamX, CamY\n   for k,v in ipairs(ObjTab) do\n      local Size = v[\"Size\"]\n      local X, Y = (v[\"X\"] - CamX), (v[\"Y\"] + CamY)\n      if TRec(-20*(Size), -20*(Size), SizeX+(20*(Size)), SizeY+(20*(Size)), X, Y) then\n         if v[\"LogicObject\"] then\n            Draw.LogicObject(v[\"CorTab\"], v[\"X\"], v[\"Y\"], v[\"Size\"], v[\"RotRad\"], v[\"Mat\"], k)\n         else\n            Object(v[\"CorTab\"], v[\"X\"], v[\"Y\"], v[\"Size\"], v[\"RotRad\"], v[\"Mat\"], k)\n            --Draw.AttachOnObj(v)\n         end\n         if v[\"Stickers\"] then\n            Draw.StickersOnObj(v)\n         end\n         if v[\"CreTab\"] then\n            local CreTab = v[\"CreTab\"]\n            ObjRes.CreatureBrain(X + CreTab[\"X\"], Y + CreTab[\"Y\"])\n         end\n      end\n   end\nend\n\n-- Draw Attachments\nfunction Draw.Attach(AttTab, X, Y, Size, RotRad, Oth, k, Abs)\n   if not Abs then X, Y = X - CamX, Y + CamY end\n   if AttTab[1] == \"Bolt\" then\n      ObjRes.Bolt(AttTab, X, Y, Size, RotRad, Oth, k)\n\n   else\n      --print(\"Unknown Attachment\")\n   end\nend\n\nfunction Draw.AttachOnObj(ObjTab)\n   for k, v in ipairs(ObjTab[\"Attach\"]) do\n      Draw.Attach(v[\"AttTab\"], v[\"X\"], v[\"Y\"], v[\"Size\"], v[\"RotRad\"], v[\"Oth\"], k)\n   end\nend\n\nfunction Draw.StickersOnObj(ObjTab)\n   local Zoom = 1\n   for k, v in ipairs(ObjTab[\"Stickers\"]) do\n      --print(v[\"Sticker\"])\n      local StiFun = Stickers[v[\"Sticker\"]]\n      --local X, Y, Size = ((((ObjTab[\"X\"]*Zoom) + (v[\"X\"]*Zoom))) - (CamX*Zoom)), ((((ObjTab[\"Y\"]*Zoom) + (v[\"Y\"]*Zoom))) + (CamY*Zoom)), v[\"Size\"]\n      local X, Y, Size = ObjTab[\"X\"] - (v[\"X\"] + CamX), ObjTab[\"Y\"] + (v[\"Y\"] + CamY), v[\"Size\"]\n      StiFun(X, Y, Size + 4)\n   end\nend\n\nfunction Draw.Water\n   local Y = tonumber(LevelTab[\"WaterLevel\"]) or 1000\n   --if Y < 2000 then\n   if -Y > CamY + SizeY then\n      draw.fillrect(-20, -20, SizeX+20, SizeY+20, Col255(75, 40, 255, 200))\n   elseif (-Y+(SizeY + CamY)) > (CamY - SizeY) then\n      --print(\"Close to Water Surface\")\n      local DrawY = ((Y*Zoom) + CamY*(Zoom))\n      --print(Y, DrawY, DrawY - SizeY)\n      draw.fillrect(-20, DrawY, SizeX+20, SizeY, Col255(75, 40, 255, 200))\n      draw.line(-20, DrawY, SizeX+20, DrawY, Col255(0, 0, 0, 200))\n   end\n   --end\n   if not Sackboy then\n      Sackboy = ObjTab[6]\n   end\n   if SackboyBreath then\n      if -Sackboy[\"Y\"] < -tonumber(LevelTab[\"WaterLevel\"]) then\n         draw.fillcircle(SizeX*.5, SizeY*.3, 32, draw.white)\n         draw.fillcircle(SizeX*.5, SizeY*.3, (SackboyBreath\/(LevelTab[\"SackboyBreath\"] or FR*20))*32, PlayCol1)\n         draw.string(math.floor(SackboyBreath\/FR), SizeX*.5, SizeY*.3, PlayCol2)\n      end\n   end\nend\n\nfunction Draw.Fog\n   if LevelTab[\"Fog\"] then\n      draw.fillrect(0, 0, SizeX, SizeY, Draw.Col255(LevelTab[\"FogR\"], LevelTab[\"FogG\"], LevelTab[\"FogB\"], LevelTab[\"FogValue\"]))\n   end\nend\n\nfunction Draw.Lighting\n   if LightingTable then\n      for Y=1, 100 do\n         if Y*100 <= (SizeY + CamY) - 100 and Y*100 >= CamY - 100 then\n            for X=1, 100 do\n               if X*100 >= (SizeX + CamX) + 100 and X*100 <= CamX then\n                  draw.fillrect((SizeX + CamX) - (X*100), (SizeY + CamY) - (Y*100), (SizeX + CamX + 100) - (X*100), (SizeY + CamY + 100) - (Y*100), Draw.Col255(0, 0, 0, LightingTable[Y][X]))\n               end\n            end\n         end\n      end\n   end\nend\n\nfunction Draw.Level\n   LifePus, LPS = Math.Bounce(LifePus, 255, 32, LPS)\n   Draw.ObjectsInLevel(ObjTab)\n   Draw.Water\n   Draw.Lighting\n   Draw.Fog\nend\n\nreturn","TSWRes SoundPlugin.lua":"print('Hello World!')","TSWRes Objects2.lua":"-- Logic Objects.\nfunction ObjRes.LogicGate(CorTab, X, Y, Size, RotRad, Mat, k)\n   draw.fillrect(X - Size, Y - Size, X + Size, Y + Size, draw.black)\n   draw.rect(X - Size, Y - Size, X + Size, Y + Size, draw.white)\nend\n\nfunction ObjRes.AndGate(CorTab, X, Y, Size, RotRad, Mat, k)\n   ObjRes.LogicGate(CorTab, X, Y, Size, RotRad, Mat, k)\n   draw.string(\"Tag\", X, Y, draw.blue)\nend\n\nfunction ObjRes.OrGate(CorTab, X, Y, Size, RotRad, Mat, k)\n   ObjRes.LogicGate(CorTab, X, Y, Size, RotRad, Mat, k)\nend\n\nfunction ObjRes.NandGate(CorTab, X, Y, Size, RotRad, Mat, k)\n   ObjRes.LogicGate(CorTab, X, Y, Size, RotRad, Mat, k)\nend\n\nfunction ObjRes.NorGate(CorTab, X, Y, Size, RotRad, Mat, k)\n   ObjRes.LogicGate(CorTab, X, Y, Size, RotRad, Mat, k)\nend\n\nfunction ObjRes.PowerGate(CorTab, X, Y, Size, RotRad, Mat, k)\n   ObjRes.LogicGate(CorTab, X, Y, Size, RotRad, Mat, k)\nend\n\nfunction ObjRes.Microchip(CorTab, X, Y, Size, RotRad, Mat, k)\n   ObjRes.LogicGate(CorTab, X, Y, Size, RotRad, Mat, k)\nend","ModuleFS.lua":"FS = {}\n\n-- Find the length of a file\n--   filename: file name\n-- returns\n--   len: length of file\n--   asserts on error\nfunction FS.length(filename)\n   local fh = assert(io.open(filename, \"rb\"))\n   local len = assert(fh:seek(\"end\"))\n   fh:close\n   return len\nend\n\n-- Return true if file exists and is readable.\nfunction FS.exists(path)\n   local file = io.open(path, \"rb\")\n   if file then file:close end\n   return file ~= nil\nend\n\n\nreturn FS","TSWRes GameCM2.lua":"function GT.TStartMenu\n   draw.tracktouches(Nil, Nil, CSMTouch)\n   Action = nil\n   --if type(LevelTab) ~= \"table\" then\n   LevelTab = {[\"Name\"] = \"Broken Level\", [\"Description\"] = \"This level had no LevelTab.\"}\nend\n   for i=1, math.huge do\n      draw.tracktouches(Nil, Nil, CSMTouch)\n      local OldTime = sys.gettime\n      Action = nil\n      draw.beginframe\n      Draw.BGs.CStartMenu\n      draw.endframe\n      draw.doevents\n      if Action == \"Close\" then\n         return\n      elseif Action == \"Replay\" then\n         --print(\"Saving Level...\")\n         --GT.SaveLevel(GT.Vars.CurrentLevel)\n         return\n      elseif Action == \"ToPod\" then\n         ToPod = true\n         return\n      elseif Action == \"CreateMode\" then\n         ToCM = true\n      elseif Action == \"LevelDetails\" then\n         GT.LevelDetailsMenu\n      end\n      ToPod = nil\n      Action = nil\n      local NewTime = sys.gettime\n      local Frame = (NewTime-OldTime)\n      if Frame < 1\/FR then\n         CG\n      end\n      sys.sleep(((1\/FR)-(Frame))*1000)\n   end\nend\n\nThNoti = -1\nfunction GT.ThNotice\n   if ThNoti < 0 then\n      ThNoti = FR*60\n      NoticeText = Strings.ThermometerNotice\n   else\n      ThNoti = ThNoti - 1\n   end\nend\n\nTherOverNoti = -1\nfunction GT.ThOverNotice\n   if TherOverNoti < 0 then\n      TherOverNoti = FR*30\n      NoticeText = Strings.ThermometerOverheatNotice\n   else\n      TherOverNoti = TherOverNoti - 1\n   end\nend\n\n\n\n\nreturn","TSWRes GameCM.lua":"-- CreateMode --\nif not TSW then require \"TSWRes Game\" end\n\n-- Undo function\nUndoTable = {}\nRedoTable = {}\nfunction GT.SaveUndo\n   if UndoFunction then\n      local NewObjTab = table.clone(ObjTab)\n      UndoTable = NewObjTab\n   end\nend\n\nfunction GT.SaveRedo\n   if UndoFunction then\n      local NewObjTab = table.clone(ObjTab)\n      RedoTable = NewObjTab\n   end\nend\n\n-- Function to undo last change\nfunction GT.Undo\n   GT.SaveRedo\n   Undo = true\n   draw.beginframe\n   Draw.BGs.Default\n   draw.endframe\n   ObjTab = UndoTable\n   Undo = false\nend\n\nfunction GT.Redo\n   GT.SaveUndo\n   Undo = true\n   draw.beginframe\n   Draw.BGs.Default\n   draw.endframe\n   ObjTab = RedoTable\n   Undo = false\nend\n\n-- Create Mode Touch Action\nfunction Touch(TX,TY)\n   GT.PopitMenu(TX,TY)\n   local PopitPress = TRec(SizeX-96, SizeY-96, SizeX-32, SizeY-32,TX,TY)\n   local UndoPress = TRec(32, 32, 96, 96,TX,TY)\n   if PopitPress and not PopitOpen then\n      PopitOpen = true\n      PopitCurMen = nil\n      PopitCuMenu = \"Home\"\n   end\n   if UndoPress then\n      if UndoFunction then\n         Undo = true\n      end\n   end\n   if NoticeText ~= \"\" then\n      MagicMouthTextRemove(TX, TY)\n   end\n   NTX, NTY = nil, nil\n   ResetTouch = true\nend\n\nrequire \"TSWRes LevelSaveLoad\"\n\n-- Actual Create Mode Stuff\n\nfunction GT.CMZoom(TX, TY)\n   --local ZO = TRec(SizeX-160, SizeY-96, SizeX-128, SizeY-64, TX, TY)\n   local ZI = TRec(SizeX-128, SizeY-96, SizeX-96, SizeY-64, TX, TY)\n   if ZO then\n      Zoom = math.max(Zoom - .1, 0.1)\n   elseif ZI then\n      Zoom = Zoom + .1\n   end\nend\n\nfunction CMHold(TX, TY)\n   CamMove(math.floor(TX), math.floor(TY))\n   GT.CMZoom(math.floor(TX), math.floor(TY))\n   NTX, NTY = math.floor(TX), math.floor(TY)\nend\n\nfunction GT.DrawPaused\n   draw.fillrect(SizeX - 96, 32, (SizeX - 96) + (64\/3), 96, draw.white)\n   draw.fillrect((SizeX - 96) + ((64\/3)*2), 32, SizeX - 32, 96, draw.white)\nend\n\nfunction GT.DrawCMFrame(Amount)\n   local Paused = true\n   local DrObjInLev = Draw.ObjectsInLevel\n   OldTime = sys.gettime\n   draw.beginframe\n   Draw.BGs.Default\n   Draw.Grid\n   Draw.Level\n   Draw.Buttons(Amount or 0)\n   if Paused then -- Draw paused indicator\n      GT.DrawPaused\n   else -- Draw player indicator\n      draw.filltriangle(32, 32, 96, 64, 32, 96, draw.white)\n   end\n   if PCEdgeX ~= nil then\n      draw.rect(PCStartX - CamX, PCStartY + CamY, PCEdgeX - CamX, PCEdgeY + CamY, draw.white)\n   end\n   Draw.Thermometer(DrThV, 24, 24, 48, SizeY-48)\n   Draw.DPad(64, SizeY-96, PlayCol1, PlayCol2)\n   draw.rect(SizeX-96, SizeY-96, SizeX-32, SizeY-32, PlayCol1)\n   Draw.Tool(PopitCuTool)\n   --Draw.ZoomControls\n   Draw.Popit.Menu\n   local NewTime = sys.gettime\n   local Frame = (NewTime-OldTime)\n   Draw.StatusBar(Frame, Frame, 0)\n   --draw.string(f, 0, 0, draw.black)\n   Draw.PopUpText\n   --draw.string(math.floor((sys.gettime - Start)*FR), 0, 16, draw.black)\n   draw.endframe\n   return Frame\nend\n\nfunction Draw.PopUpText\n   if MagicMouthText ~= \"\" then\n      Draw.MagicMouthText(MagicMouthText)\n   end\n   if NoticeText ~= \"\" then\n      Draw.NoticeText(NoticeText, \"Notice\")\n   end\nend\nTX,TY = 0,0\n\nfunction tables\n   a = {}\n   b = {}\n   a['other'] = b\n   b['other'] = a   -- now we have a cyclic reference\n   a,b = nil,nil    -- oh dear, we don't have a reference to the 2 tables now\n   -- there are two tables which are unreachable\nend\n\nfunction GT.CreateMode(Load)\n   CamX, CamY = 0, 250\n   Start = sys.gettime\n   if Load == nil or tonumber(Load) > MyMoonLevels[\"Levels\"] then\n      GT.BlankLevel\n      GT.Vars.CurrentLevel = MyMoonLevels[\"Levels\"] + 1\n      LevelTab[\"WaterLevel\"] = 10000\n   else\n      ErrorCode = GT.LoadLevel(Load)\n      if ErrorCode == -1 then\n         NoticeText = \"Failed to load level\"\n         return\n      end\n      GT.Vars.CurrentLevel = Load\n   end\n   PopitOpen = false\n   GT.SaveUndo\n   draw.tracktouches(CMHold, CMHold, Touch)\n   for i=1, math.huge do\n      draw.tracktouches(CamMove, CMHold, Touch)\n      f = i\n      if ToPod then\n         PopitOpen = false\n         ToPod = nil\n         return\n      end\n      CreateMode = true\n      ToolClosed = false\n      PopitCuTool = nil\n      if Undo == true then\n         Undo = false\n         GT.Undo\n      end\n      draw.doevents\n      Frame = GT.DrawCMFrame(1)\n      --print = error\n      -- Actions\n      if NTX then\n         TX, TY = NTX, NTY\n      end\n      if not ResetTouch then\n         if TX then\n            CMHold(TX, TY)\n         end\n      else\n         ResetTouch = false\n         TX = nil\n      end\n      if Frame < 1\/FR then\n         CG\n      end\n      --sys.sleep((1\/FR-(Frame)))\n      Sleep(OldTime)\n   end\nend\n\nrequire \"TSWRes GameCM1\"\nrequire \"TSWRes GameCM2\"\n\nreturn","TSWRes Popit.lua":"if not TSW then require \"TSWRes Game\" end\nPopitRes = {}\n\nprint(\"Popit Menus Loading\")\n\nfunction GT.PopitGTI(t, TX, TY)\n   local X1,Y1,X2,Y2 = SizeX-(32*6), 64, SizeX-64, SizeY-32\n\n   --local X2, Y2 = X2 or SizeX, Y2 or SizeY\n   local FunX,FunY = X1, Y1\n   local DwSize, IcoSize = 1, 32\n   local OptSz = 32\n   local DISz = (IcoSize*DwSize)\n   local Odd = false\n   for k,v in ipairs(t) do\n      local Tapped = TRec(FunX, FunY, FunX+32, FunY + 32, TX, TY)\n      --print(k, Tapped)\n      if Tapped then\n         return k\n      end\n      FunX = FunX + OptSz\n      if FunX > X2 then\n         FunX, FunY = X1, FunY + OptSz\n      end\n   end\n   return false\nend\n\nfunction GT.PopitGTIR(t, TX, TY)\n   local X1,Y1,X2,Y2 = SizeX-(32*6), 64, SizeX-64, SizeY-32\n\n   --local X2, Y2 = X2 or SizeX, Y2 or SizeY\n   local FunX,FunY = X1, Y1\n   local DwSize, IcoSize = 1, 32\n   local OptSz = 32\n   local DISz = (IcoSize*DwSize)\n   local Odd = false\n   for k,v in pairs(t) do\n      local Tapped = TRec(FunX, FunY, FunX+32, FunY + 32, TX, TY)\n      --print(k, Tapped)\n      if Tapped then\n         return k\n      end\n      FunX = FunX + OptSz\n      if FunX > X2 then\n         FunX, FunY = X1, FunY + OptSz\n      end\n   end\n   return false\nend\n\nfunction GT.PopitMenu(TX,TY)\n   local PMPages = PopitRes.PMPages\n   local TRec = TRec\n   if not PopitOpen then return end\n   local PopitClosed = TRec(SizeX-64, 32, SizeX-32, 64, TX, TY)\n   if PopitClosed then\n      PopitOpen = false\n      PopitCurMen = nil\n      SelectedMaterial = nil\n   end\n   if PopitCuMenu == \"Home\" then\n      PopitPage = 1\n      local ObjTap =TRec(SizeX-(32*5), 64, SizeX-(32*3.5), 64+(32*1.5),TX,TY)\n      local TutTap = TRec(SizeX-112, 64, SizeX-64, 112, TX, TY)\n      local PopCurTap =TRec(SizeX-(32*5), 112, SizeX-(32*3.5), 112+(32*1.5),TX,TY)\n      local StiTap = TRec(SizeX-112, 112, SizeX-64, 160, TX, TY)\n      local ToolsTap =TRec(SizeX-(32*5), 160, SizeX-(32*3.5), 160+(32*1.5),TX,TY)\n      local CosTap =TRec(SizeX-112, 160, SizeX-64, 160+(32*1.5),TX,TY)\n      local SaveTap =TRec(SizeX-(32*5), 208, SizeX-(32*3.5), 208+(32*1.5),TX,TY)\n      local TestTap =TRec(SizeX-112, 208, SizeX-64, 208+(32*1.5),TX,TY)\n      if ObjTap then\n         PopitCurMen = \"Goodies Bag\"\n         PopitCuMenu = \"Materials\"\n      elseif TutTap then\n         --GT.TutorialMenu\n      elseif PopCurTap then\n         PopitOpen = false\n         PopitCuTool = \"Popit Cursor\"\n         GT.PopitCursor\n      elseif StiTap then\n         PopitCuMenu = \"Stickers\"\n      elseif ToolsTap then\n         PopitCurMen = \"Tools Bag\"\n         PopitCuMenu = \"Tools Bag\"\n      elseif CosTap then\n         PopitCuMenu = \"Costume Materials\"\n      elseif SaveTap then\n         GT.CStartMenu\n      elseif TestTap then\n         if SafePlay then\n            Error, EMes = pcall(GT.TestMode)\n            print(EMes)\n         else\n            GT.TestMode\n         end\n      end\n   elseif PopitCuMenu == \"Stickers\" then\n      local Key = GT.PopitGTI(PopitRes.PMSelPage[PopitCuMenu], TX, TY)\n      local Tag = PopitRes.PMSelPage[PopitCuMenu]\n      if Key ~= false then\n         PopitOpen = false\n         CorTab = Key\n         if type(Tag[Key]) == \"string\" then\n            StickerSelected = GT.CreStiTab(Tag[Key], 0, 0, 0)\n            PopitRes.StickerCursor\n         else\n            Tag[Key]\n         end\n      end\n   elseif PopitCuMenu == \"Materials\" then\n      local Key = GT.PopitGTIR(PopitRes.PMSelPage[PopitCuMenu], TX, TY)\n      if Key ~= false then\n         SelectedMaterial = Key\n         PopitCuMenu = \"Shapes\"\n      else\n         SwitchPage(TX, TY)\n      end\n   elseif PopitCuMenu == \"Captured Objects\" then\n      local COT = CapturedObjects[\"ObjTabs\"]\n      local Key = GT.PopitGTI(COT, TX, TY)\n      local Tag = COT\n      PrintTable(COT)\n      --print(\"Tag \"..tostring(Tag))\n      if Key ~= false then\n         PopitOpen = false\n         CorTab = Key\n         PopitRes.ObjectCursor(Tag[Key], \"Custom\")\n      else\n         SwitchPage(TX, TY)\n      end\n   elseif PopitCuMenu == \"Costume Materials\" then\n      local Key = GT.PopitGTIR(PopitRes.PMSelPage[PopitCuMenu], TX, TY)\n      if Key ~= false then\n         PlayCostume[\"SackMat\"] = Key\n      end\n   else\n      local Key = GT.PopitGTI(PopitRes.PMSelPage[PopitCuMenu], TX, TY)\n      local Tag = PopitRes.PMSelPage[PopitCuMenu]\n      --print(\"Tag \"..tostring(Tag))\n      if Key ~= false then\n         PopitOpen = false\n         CorTab = Key\n         local LO = PopitCuMenu == \"Logic Objects\"\n         if type(Tag[Key]) == \"string\" then\n            PopitRes.ObjectCursor(Tag[Key], LO)\n         else\n            Tag[Key]\n         end\n      else\n         SwitchPage(TX, TY)\n      end\n   end\nend\n\nfunction SwitchPage(TX, TY)\n   local PMPages = PopitRes.PMPages\n   if TRec(SizeX-(32*6), SizeY-64, SizeX-(32*5), SizeY-32, TX, TY) then\n      if PopitPage > 1 then\n         PopitPage = PopitPage - 1\n         PopitCuMenu = PMPages[PopitCurMen][PopitPage]\n      end\n   end\n   if TRec(SizeX - 64, SizeY - 64, SizeX - 32, SizeY - 32, TX, TY) then\n      if PopitPage < #PMPages[PopitCurMen] then\n         PopitPage = PopitPage + 1\n         PopitCuMenu = PMPages[PopitCurMen][PopitPage]\n      end\n   end\nend\n\nrequire \"TSWRes Tool1\"\n\nPopitRes.PMPages = {}\nlocal PMPages = PopitRes.PMPages\nPMPages[\"Goodies Bag\"] = {\"Materials\", \"Captured Objects\"}\nPMPages[\"Tools Bag\"] = {\"Tools Bag\", \"Logic Objects\"}\n\nPopitRes.PMPage = {}\nlocal PMPage = PopitRes.PMPage\nPMPage[\"Materials\"] = ObjMaterials\nPMPage[\"Shapes\"] = {\n   [1] = \"Square\", [2] = \"Circle\", [3] = \"Triangle\", [4] = \"Pentagon\", [5] = \"Hexagon\", [6] = \"Octagon\", [7] = \"MatCha\"\n}\nPMPage[\"Stickers\"] = {[1] = \"StickerEditor\", [2] = \"LBPPick\", [3] = \"White Square\"}\nPMPage[\"Tools Bag\"] = {\"CorEdi\", \"WaterTool\", \"Capture Tool\", \"Static Tool\", \"StartGate\", \"FinishGate\", \"ScoreBubble\", \"Scoreboard\", \"Entrance\", \"Checkpoint\", \"Button\", \"Spikes\"}\nPMPage[\"Logic Objects\"] = {\"AndGate\", \"OrGate\"}\nPMPage[\"Costumes\"] = {}\nPMPage[\"Costume Materials\"] = SackboyMaterials\n\nPopitRes.PMSelPage = {}\nlocal PMSelPage = PopitRes.PMSelPage\nPMSelPage[\"Materials\"] = ObjMaterials\nPMSelPage[\"Shapes\"] = {\n   [1] = \"Square\", [2] = \"Circle\", [3] = \"Triangle\", [4] = \"Pentagon\", [5] = \"Hexagon\", [6] = \"Octagon\", [7] = PopitRes.MaterialChanger\n}\nPMSelPage[\"Stickers\"] = {[1] = PopitRes.StickerEditor, [2] = \"LBPPick\", [3] = \"White Square\",}\nPMSelPage[\"Tools Bag\"] = {PopitRes.CorEditor, PopitRes.WaterTool, PopitRes.CaptureTool, PopitRes.StaticTool, \"StartGate\", \"FinishGate\", \"ScoreBubble\", \"Scoreboard\", \"Entrance\", \"Checkpoint\", \"Button\", \"Spikes\"}\nPMSelPage[\"Logic Objects\"] = {\"AndGate\", \"OrGate\"}\nPMSelPage[\"Costumes\"] = {}\nPMSelPage[\"Costume Materials\"] = SackboyMaterials\n\nfunction PopitRes.SplatterSound\n   sys.alert(\"drop\")\nend\n\nfunction PopitRes.PlaceSound\n   sys.alert(\"drop\")\nend\n\nfunction PopitRes.UnavailSound\n   sys.alert(\"tink\")\n   --sys.alert(\"neg\")\n   --sys.alert(\"drop\")\nend\n\nfunction PopitRes.DeleteSound\n   sys.alert(\"neg\")\nend\n\nfunction PopitRes.PhysicsSound\n   sys.alert(\"drop\")\nend\n\nrequire \"TSWRes Popit1\"\n\nreturn PopitRes","TSWRes BGs3.lua":"if not TSW then require \"TSWRes Game\" end\n\n-- Settings Menus --\n-- The Settings Menu\nfunction Draw.BGs.Settings\n   draw.clear(Col255(48, 48, 60))\n   Draw.Button(\"Back\", 24, SizeY - 64, 128, SizeY - 32, PlayCol1)\n   draw.string(\"Settings\", 24, 24, draw.white)\n   if DrawStatusBar then\n      Draw.Button(\"Draw Beta StatusBar\", 24, 64, 256, 96, PlayCol1)\n   else\n      Draw.Button(\"Draw Beta StatusBar\", 24, 64, 256, 96, PlayCol2)\n   end\n   if UndoFunction then\n      Draw.Button(\"Undo\/Redo Function\", 24, 96, 256, 128, PlayCol1)\n   else\n      Draw.Button(\"Undo\/Redo Function\", 24, 96, 256, 128, PlayCol2)\n   end\n   Draw.Button(\"Save Management\", 24, 128, 256, 160, PlayCol2)\nend\n\nfunction Draw.SaveFileSizePercent(X1, Y1, X2, Y2)\n   local Table = GT.SaveDetails\n   local TotalSize = Table[\"TotalSize\"]\n   local SizeBytes = 0\n   local MaxX = X2 - X1\n   local CurX = X1\n   local i = 0\n   local Odd = false\n   local DrawColor = PlayCol2\n   local Colors = {draw.blue, draw.green, draw.red, draw.orange, draw.purple, draw.yellow, draw.magenta}\n   for k, v in pairs(Table[\"SizeTaken\"]) do\n      i = i + 1\n      DrawColor = Colors[i]\n      draw.fillrect(CurX, Y1, CurX + ((v \/ TotalSize) * MaxX), Y2, DrawColor)\n      CurX = CurX + ((v \/ TotalSize) * MaxX)\n      SizeBytes = SizeBytes + v\n   end\n   draw.rect(X1, Y1, X2, Y2, draw.black)\n   draw.string(TotalSize, X1, Y1, draw.black)\nend\n\nfunction Draw.BGs.SaveManagement\n   draw.clear\n   Draw.Button(\"Back\", 24, SizeY - 64, 128, SizeY - 32, PlayCol1)\n   Draw.SaveFileSizePercent(0, SizeY - 32, SizeX, SizeY)\nend","TSWRes HelpFile.lua":"HelpRes.HelpFile = {}\nHelpRes.HelpFile.HP = {}\nHelpFiles = HelpRes.HelpFile\n\nrequire \"TSWRes HelpFile1\"\n\n\nreturn","TSWRes Game3.lua":"-- Menus --\nif not TSW then require \"TSWRes Game\" end\n-- Mordal Menus\n-- Corform if you want to do an action.\nfunction GT.YesNo(Title, Des, B1Col, B2Col, B1Txt, B2Txt)\n   local Ans = nil\n   while Ans==nil do\n      draw.beginframe\n      Draw.BGs.YesNo(Title, Des, B1Col, B2Col, B1Txt, B2Txt)\n      draw.endframe\n      TX, TY = draw.waittouch\n      Yes=TRec(48+24, SizeY-72, SizeX*.5, SizeY-48, TX, TY)\n      No=TRec(SizeX*.5, SizeY-72, SizeX-(48+24), SizeY-48, TX, TY)\n      if No==true then\n         Ans = false\n      elseif Yes==true then\n         Ans = true\n      end\n   end\n   return Ans\nend\n\n-- When your profile is corrupt\nfunction GT.CorruptProfile(ProfileOk, StoryOk, MMOk, ComOk)\n   draw.beginframe\n   Draw.BGs.CorruptProfile(ProfileOk, StoryOk, MMOk, ComOk)\n   draw.endframe\n   local TX, TY = draw.waittouch\nend\n\n-- Community Main Menu\nfunction GT.CommunityMenu\n   if Community == nil then\n      draw.beginframe\n      Draw.BGs.Loading\n      draw.endframe\n      Community = require \"TSWRes Community\"\n      Community.LoadFile\n   end\n   if Community.Connected ~= true then\n      Community.OfflineMenu\n   else\n      Community.OnlineMenu1\n   end\nend\n\n-- Story Menu\nfunction GT.StoryMenu\n   draw.beginframe\n   Draw.BGs.Loading\n   draw.endframe\n   StoryRes = require \"TSWRes Story\"\n   StoryRes.Menu\nend\n\n-- My Moon Menu\nfunction GT.MyMoonMenu\n   --if MyMoonLevels[\"Levels\"] == nil then\n      draw.beginframe\n      Draw.BGs.Loading\n      draw.endframe\n      local Ok = Loader.LoadMyMoonLevels\n      if Ok ~= \"Ok\" then\n\n      end\n   end\n   LevScr = 0\n   for i=1, math.huge do\n      draw.beginframe\n      Draw.BGs.MyMoon\n      Draw.PopUpText\n      draw.endframe\n      local TX, TY = draw.waittouch\n      local BackTap = TRec(24, SizeY - 32, 128, SizeY, TX, TY)\n      local TTap = TRec(0, 0, 128, 32, TX, TY)\n      local DeleteTap = TRec(128, 0, 256, 32, TX, TY)\n      local UTap = TRec(SizeX-32, 32, SizeX, 64, TX, TY)\n      local DTap = TRec(SizeX-32, SizeY-64, SizeX, SizeY-32, TX, TY)\n      if BackTap then\n         return\n      elseif TTap then\n         LevelTab = {[\"Name\"] = \"Unnamed Level\", [\"Description\"] = \"Add a description to this level.\"}\n         GT.Vars.CurrentLevel = MyMoonLevels[\"Levels\"] + 1\n         GT.CreateMode(MyMoonLevels[\"Levels\"] + 1)\n      elseif UTap then\n         LevScr = LevScr + 48\n      elseif DTap then\n         LevScr = LevScr - 48\n      elseif DeleteTap then\n         if MAction ~= \"Delete\" then\n            MAction = \"Delete\"\n         else\n            MAction = nil\n         end\n      else\n         if MyMoonLevels[\"SavedLevelTab\"] then\n            for k,v in ipairs(MyMoonLevels[\"SavedLevelTab\"]) do\n               local LTap = TRec(32, (32+LevScr+((k-1)*64)), SizeX-48, (32+LevScr+(k*64)), TX, TY)\n               if LTap and MAction == nil then\n                  LevelTab = v\n                  GT.Vars.CurrentLevel = k\n                  GT.CreateMode(k)\n               elseif LTap and MAction == \"Delete\" then\n                  local LevelSe = v\n                  if GT.YesNo('Delete level \"'..tostring(LevelSe[\"Name\"])..'\"?', \"Selecting Delete will delete this level.\", draw.red, PlayCol1, \"Delete!\", \"Keep\") then\n                     GT.DeleteLevel(k)\n                  end\n               end\n            end\n         end\n      end\n      CG\n   end\nend\n\n-- Settings Menu\nfunction GT.SettingsMenu\n   for i=1, math.huge do\n      draw.beginframe\n      Draw.BGs.Settings\n      draw.endframe\n      local TX, TY = draw.waittouch\n      local BackTap = TRec(24, SizeY - 64, 128, SizeY - 32, TX, TY)\n      local StatusBarTap = TRec(24, 64, 256, 96, TX, TY)\n      local ActivateUndoTap = TRec(24, 96, 256, 128, TX, TY)\n      local SaveManageTap = TRec(24, 128, 256, 160, TX, TY)\n      if BackTap then\n         draw.beginframe\n         Draw.BGs.Loading(\"Saving Profile...\")\n         Draw.SaveNotice\n         draw.endframe\n         GT.SaveProfile\n         return\n      elseif StatusBarTap then\n         DrawStatusBar = not DrawStatusBar\n      elseif ActivateUndoTap then\n         UndoFunction = not UndoFunction\n      elseif SaveManageTap then\n         GT.SaveManagement\n      end\n   end\nend\n\n-- Help Menu\nfunction GT.HelpMenu\n   if HelpRes == nil then\n      require \"TSWRes Help\"\n   end\n   HelpRes.HelpMenu\nend\n\n-- Credits Menu\nfunction GT.CreditsMenu\n   for i=1, math.huge do\n      draw.beginframe\n      Draw.BGs.Credits\n      draw.endframe\n      local TX, TY = draw.waittouch\n      local BackTap = TRec(24, SizeY - 64, 128, SizeY - 32, TX, TY)\n      if BackTap then\n         return\n      end\n      CG\n   end\nend\n\n-- Exit the game\nfunction GT.ExitGame\n   CloseGame = true\n   print(\"Game is closing!\")\n   draw.beginframe\n   Draw.BGs.Loading(\"Saving Progress...\")\n   --Draw.StatusBar(0)\n   draw.endframe\n   LoaderTab.LoadMyMoonLevels\n   LoaderTab.SaveMyMoonLevels\n   draw.beginframe\n   Draw.BGs.Exit\n   --Draw.StatusBar(0)\n   draw.endframe\n   sleep(2000)\n   GT = nil\n   Community = nil\n   LoaderTab = nil\n   Draw = OldDraw or nil\n   Strings = nil\n   collectgarbage\n   collectgarbage\n   collectgarbage\n   collectgarbage\n   return true\nend\n\n-- Pod Control Menu\nfunction GT.Menu\n   draw.setscreen(1)\n   draw.settitle(\"Tag's Super World\")\n   for i=1, math.huge do\n      draw.beginframe\n      Draw.BGs.Pod\n      draw.endframe\n      local TX, TY = draw.waittouch\n      local CMTap = TRec(24, 128, 128, 256, TX, TY)\n      local STap = TRec(128+24, 128, 128+128, 256, TX, TY)\n      local MMTap =TRec(248+24, 128, 248+128, 256, TX, TY)\n      local PodTap =TRec(384+24, 128, 384+72, 256, TX, TY)\n      local SettingsTap =TRec(0, SizeY-32, 128, SizeY, TX, TY)\n      local HelpTap =TRec(128, SizeY - 32, 256, SizeY, TX, TY)\n      local CreditsTap =TRec(256, SizeY - 32, 384, SizeY, TX, TY)\n      local ExitTap =TRec(384, SizeY - 32, SizeX, SizeY, TX, TY)\n      if CMTap then\n         GT.CommunityMenu\n      elseif STap then\n         GT.StoryMenu\n      elseif MMTap then\n         GT.MyMoonMenu\n      elseif PodTap then\n         GT.PodMenu\n      elseif SettingsTap then\n         GT.SettingsMenu\n      elseif HelpTap then\n         GT.HelpMenu\n      elseif CreditsTap then\n         GT.CreditsMenu\n      elseif ExitTap then\n         GT.ExitGame\n         return\n      end\n      CG\n   end\nend\n\nreturn","TSWRes Intro.lua":"--[[The Story of Sackboy\n\nOne day, Sackboy decided that it was lonely being\nalone. Sackboy decided to create more Sackpeople in \nresponce. Sackboy also created a My Moon for each \nSackperson that lived, so they could create what they\nwanted. Eventually Sackboy created the first fourteen\nCreator Curators, to show how a good level should\nbe. Everything was good for a while, but then\n\"Rex is skill\", or \"The Collector\" showed up.\n\n\n\n\n]]\n\nIntro = {}\n\nfunction Intro.Intro1\n  --for i=1, math.huge do\n   draw.beginframe\n   Draw.BGs.Default\n   Draw.MagicMouthText(\"Welcome To LittleBigPlanet!\", \"The Story of Sackboy\")\n   draw.endframe\n   --end\n   draw.waittouch\nend\n\nfunction Intro.Intro2\n   --for i=1, math.huge do\n   draw.beginframe\n   Draw.BGs.Default\n   Draw.MagicMouthText(\"The World of LittleBigPlanet is filled with wonder and .\")\n   draw.endframe\n   --end\n   draw.waittouch\nend\n\nfunction Intro.Intro3\n   --for i=1, math.huge do\n   draw.beginframe\n   Draw.BGs.Pod\n   Draw.MagicMouthText(\"There are rumors about something called the 'Crown Crusaders'.\")\n   draw.endframe\n   --end\n   draw.waittouch\nend\n\nfunction Intro.Intro4\n   --for i=1, math.huge do\n   draw.beginframe\n   Draw.BGs.Pod\n   Draw.MagicMouthText(\"They promise to give crowns to all Sackpeople in LBP, but we will have to find out and see.\", \"Narrator\")\n   draw.endframe\n   --end\n   draw.waittouch\nend\n\nfunction Intro.Intro5\n   --for i=1, math.huge do\n   draw.beginframe\n   Draw.BGs.Pod\n   Draw.MagicMouthText(\"Finally, you woke up Sackboy... We got very bad news.\", \"Narrator\")\n   draw.endframe\n   --end\n   draw.waittouch\nend\n\nfunction Intro.IntroCut\n   --Intro.Intro1\n   Intro.Intro2\n   Intro.Intro3\n   Intro.Intro4\n   Intro.Intro5\nend\n\n\n\nreturn Intro","TSKeyboard.lua":"-- Keyboard for TagShell.\nKey = {}\nlocal FillRect, DStr, alert = draw.fillrect, draw.string, sys.alert\ndraw.lightGray = draw.lightgray\n\nSX, SY = draw.getport\n\nKey.History = {}\n\nif not TRec then\n   function TRec(X1,Y1,X2,Y2,TX,TY)\n      assert(X1, \"X1 missing\")\n      if TX>=X1 and TX<=X2 then\n         if TY>=Y1 and TY<=Y2 then\n            return true\n         end\n      end\n      return false\n   end\nend\n\nrequire \"TSKeyboard1\"\n\nfunction Key.DrawKey(Shift)\n   local SX, SY = draw.getport -- Fix for incorrect size\n   draw.setfont(\"Arial\", 16)\n   local FillRect=FillRect\n   local L1,L2,L3,L4=SY-128, SY-96, SY-64, SY-32\n   local X1, X2, X3, X4=L2-2, L3-2, L4-2, SY-2\n   local TA=-5 -- the height of the text\n   local T1, T2, T3, T4 = L1-TA, L2-TA, L3-TA, L4-TA\n   local TxtC = draw.black\n   local LS = 4\n   FillRect(0, L1-2, SX, SY, draw.lightGray)\n   FillRect(2, L1, 40-LS, X1, draw.white)\n   DStr(\"Q\", 10-2, T1, TxtC)\n   FillRect(42-LS, L1, 80-(LS*2), X1, draw.white)\n   DStr(\"W\", 50-4, T1, TxtC)\n   FillRect(82-(LS*2), L1, 120-(LS*3), X1, draw.white)\n   DStr(\"E\", 88-6, T1, TxtC)\n   FillRect(122-(LS*3), L1, 160-(LS*4), X1, draw.white)\n   DStr(\"R\", 126-8, T1, TxtC)\n   FillRect(162-(LS*4), L1, 200-(LS*5), X1, draw.white)\n   DStr(\"T\", 164-10, T1, TxtC)\n   FillRect(202-(LS*5), L1, 240-(LS*6), X1, draw.white)\n   DStr(\"Y\", 202-12, T1, TxtC)\n   FillRect(242-(LS*6), L1, 280-(LS*7), X1, draw.white)\n   DStr(\"U\", 240-14, T1, TxtC)\n   FillRect(282-(LS*7), L1, 320-(LS*8), X1, draw.white)\n   DStr(\"I\", 278-16, T1, TxtC)\n   FillRect(322-(LS*8), L1, 360-(LS*9), X1, draw.white)\n   DStr(\"O\", 316-18, T1, TxtC)\n   FillRect(362-(LS*9), L1, 400-(LS*10), X1, draw.white)\n   DStr(\"P\", 344-16, T1, TxtC)\n\n   FillRect(2, L2, 40, X2, draw.white)\n   DStr(\"A\", 14, T2, TxtC)\n   FillRect(42, L2, 80, X2, draw.white)\n   DStr(\"S\", 54, T2, TxtC)\n   FillRect(82, L2, 120, X2, draw.white)\n   DStr(\"D\", 94, T2, TxtC)\n   FillRect(122, L2, 160, X2, draw.white)\n   DStr(\"F\", 134, T2, TxtC)\n   FillRect(162, L2, 200, X2, draw.white)\n   DStr(\"G\", 174, T2, TxtC)\n   FillRect(202, L2, 240, X2, draw.white)\n   DStr(\"H\", 214, T2, TxtC)\n   FillRect(242, L2, 280, X2, draw.white)\n   DStr(\"J\", 254, T2, TxtC)\n   FillRect(282, L2, 320, X2, draw.white)\n   DStr(\"K\", 294, T2, TxtC)\n   FillRect(322, L2, 360, X2, draw.white)\n   DStr(\"L\", 334, T2, TxtC)\n\n   if Shift then\n      FillRect(2, L3, 40, X3, draw.red)\n   else\n      FillRect(2, L3, 40, X3, draw.cyan)\n   end\n   DStr(\"Shift\", 4, T3, TxtC)\n   FillRect(42, L3, 80, X3, draw.white)\n   DStr(\"Z\", 54, T3, TxtC)\n   FillRect(82, L3, 120, X3, draw.white)\n   DStr(\"X\", 94, T3, TxtC)\n   FillRect(122, L3, 160, X3, draw.white)\n   DStr(\"C\", 134, T3, TxtC)\n   FillRect(162, L3, 200, X3, draw.white)\n   DStr(\"V\", 174, T3, TxtC)\n   FillRect(202, L3, 240, X3, draw.white)\n   DStr(\"B\", 214, T3, TxtC)\n   FillRect(242, L3, 280, X3, draw.white)\n   DStr(\"N\", 254, T3, TxtC)\n   FillRect(282, L3, 320, X3, draw.white)\n   DStr(\"M\", 294, T3, TxtC)\n   FillRect(322, L3, 360, X3, draw.white)\n   DStr(\"Back\", 324, T3, TxtC)\n\n   FillRect(2, L4, 200, X4, draw.white)\n   DStr(\"Space\", 4, T4, TxtC)\n   -- Scroll Bar\n   FillRect(202, L4, 232, X4, draw.white)\n   DStr(\"<\", 204, T4, TxtC)\n   FillRect(292, L4, 320, X4, draw.white)\n   DStr(\">\", 294, T4, TxtC)\n   FillRect(322, L4, 360, X4, draw.white)\n   DStr(\"Enter\", 323, T4, TxtC)\n\n   --Numberpad\n   FillRect(362, L1, 400, X1, draw.white)\n   DStr(\"9\", 384, T1, TxtC)\n   FillRect(402, L1, 440, X1, draw.white)\n   DStr(\"8\", 414, T1, TxtC)\n   FillRect(442, L1, 480, X1, draw.white)\n   DStr(\"7\", 454, T1, TxtC)\n\n   FillRect(362, L2, 400, X2, draw.white)\n   DStr(\"6\", 374, T2, TxtC)\n   FillRect(402, L2, 440, X2, draw.white)\n   DStr(\"5\", 414, T2, TxtC)\n   FillRect(442, L2, 480, X2, draw.white)\n   DStr(\"4\", 454, T2, TxtC)\n\n   FillRect(362, L3, 400, X3, draw.white)\n   DStr(\"3\", 374, T3, TxtC)\n   FillRect(402, L3, 440, X3, draw.white)\n   DStr(\"2\", 414, T3, TxtC)\n   FillRect(442, L3, 480, X3, draw.white)\n   DStr(\"1\", 454, T3, TxtC)\n\n   FillRect(362, L4, 400, X4, draw.white)\n   DStr(\"0\", 374, T4, TxtC)\n   FillRect(402, L4, 440, X4, draw.white)\n   DStr(\"Cancel\", 402, T4, TxtC)\n   FillRect(442, L4, 480, X4, draw.white)\n   DStr(\"\/\", 454, T4, TxtC)\nend\n\nfunction Key.HozScBar(DSTtr, S1)\n   local S2 = math.max(draw.stringsize(DSTtr)-SX, 0)\n   local X1, X2 = 200, 320\n   Y1, Y2 = X1, X2\n   --local BY1 = (((X2-64)-(X1+32))*((ScrollX\/S2)*(1))) + (X1+32)\n   local BY2 = BY1+(((X2-32)-(X1+32))\/S2)\n\n   local BY1 = ((((Y2-64)-(Y1+32))*((S1\/S2)*(1)))*1) + (Y1+34)\n   local BY2 = BY1+32\n\n   FillRect(BY1, SY-32, BY2, SY, draw.cyan)\nend\n\nfunction Key.DrawHistory\n   for k, v in ipairs(Key.History) do\n      draw.roundedrect(2, 64+((k-1)*20), (6+draw.stringsize(v)), 64+(k*20), 2, draw.black)\n      draw.string(v,3,64+((k-1)*20),draw.black)\n   end\nend\n\nfunction Key.TappedHistory(TX,TY)\n   for k, v in ipairs(Key.History) do\n      local Tapped = TRec(2, 64+((k-1)*20), (6+draw.stringsize(v)), 64+(k*20), TX, TY)\n      if Tapped then\n         return k\n      end\n   end\nend\n\nfunction Key.Keyboard(TitleStr, StartStr)\n   local KeyRun = true\n   local Str = StartStr or \"\"\n   local Shift = false\n   local ScrollX = 0\n   while KeyRun do\n      draw.beginframe\n      draw.clear\n      draw.setfont(\"Arial\", 24)\n      draw.string(TitleStr or \"Keyboard\", 2, 2, draw.black)\n      draw.setfont(\"Arial\", 16)\n      if TitleStr~=\"Password\" then\n         DSTtr = Str\n         draw.string(Str, 2 - ScrollX, 32, draw.black)\n      else\n         DSTtr = string.rep(\"*\", #Str)\n         draw.string(DSTtr, 2 - ScrollX, 32, draw.black)\n      end\n      Key.DrawHistory\n      Key.DrawKey(Shift)\n      Key.HozScBar(DSTtr, ScrollX)\n      draw.endframe\n      --Touch\n      TX, TY = draw.waittouch\n      local Answer = Key.Tap(TX,TY)\n      if Answer~=\"\" then alert(\"tock\") end\n      if Answer==\"Back\" then\n         Str = Str:sub(1,-2)\n      elseif Answer==\"Enter\" then\n         KeyRun=false\n         Key.History[#Key.History+1] = Str\n      elseif Answer==\"Shift\" then\n         Shift = not Shift\n      elseif Answer==\"Space\" then\n         Str = Str..\" \"\n      elseif Answer==\"Ca\" then\n         return false\n      elseif Answer==\"SL\" then\n         ScrollX = math.max(ScrollX - 16, 0)\n      elseif Answer==\"SR\" then\n         ScrollX = math.min(ScrollX + 16, math.max(draw.stringsize(DSTtr)-SizeX, 0))\n      elseif Answer~=\"History\" then\n         if Shift then\n            Str = Str..tostring(Answer) or Str\n         else\n            Str = Str..string.lower(tostring(Answer))\n         end\n      else\n         local Hst = Key.TappedHistory(TX,TY)\n         if Hst ~= nil then\n            KeyRun=false\n            return Key.History[Hst]\n         end\n      end\n   end\n   return Str\nend\n\nprint(\"Keyboard loaded\")\nreturn Key","TSWRes HTTP Browser.lua":"if not TSW then require \"TSWRes Game\" end\nlocal HTTPBrowser = {}\nlocal Brow = HTTPBrowser\nBrow.InternalPages = require \"TSWRes HTTP Browser1\"\nBrow.HTMLPage = \n\n\nBrow.Title = \"\"\n\nfunction Brow.getTitle(String)\n   -- Read up to 8KB (avoid problems when trying to parse \/dev\/urandom)\n   local s = string.sub(String, 0, 8192)\n\n   -- Remove optional spaces from the tags.\n   s = string.gsub(s, \"\\n\", \" \")\n   s = string.gsub(s, \" *< *\", \"<\")\n   s = string.gsub(s, \" *> *\", \">\")\n\n   -- Put all the tags in lowercase.\n   s = string.gsub(s, \"(<[^ >]+)\", string.lower)\n\n   local i, f, t = string.find(s, \" (.+)<\/title>\")\n   return t or \"Unnamed page\"\nend\n\n-- Returns contents of the first tag that is named TagName.\nfunction Brow.getTagContents(String, TagName, Start)\n   TagName, Start = string.lower(TagName), Start or 0\n   local s = string.sub(String, Start, Start + 8192)\n\n   -- Remove optional spaces from the tags.\n   s = string.gsub(s, \"\\n\", \" \")\n   s = string.gsub(s, \" *< *\", \"<\")\n   s = string.gsub(s, \" *> *\", \">\")\n\n   -- Put all the tags in lowercase.\n   s = string.gsub(s, \"(<[^ >]+)\", string.lower)\n\n   local i, f, t = string.find(s, \"<\"..TagName..\">(.+)<\/\"..TagName..\">\")\n   return t or false\nend\n\nfunction Brow.LoadPage(URL)\n\nend\n\nfunction Brow.LoadInternalPage(URL)\n   local HTMLString = Brow.InternalPages[URL]\n   Brow.Title = Brow.getTitle(HTMLString) or URL\n   Brow.Body = Brow.getTagContents(HTMLString, \"body\") or \"\"\nend\n\nBrow.LoadInternalPage(\"about:test\")\n\nfunction Brow.DrawBrowser\n   Draw.PodButton(Brow.Title, 0, 0, SizeX - 32, 32, PlayCol1)\n   draw.stringinrect(Brow.Body, 0, 32, SizeX - 32, SizeY, draw.black)\nend\n\nfunction http.Browser\n   for k=1, math.huge do\n      draw.beginframe\n      draw.clear\n      HTTPBrowser.DrawBrowser\n      draw.endframe\n   end\nend\n\n--http.Browser","TSWRes LevelSaveLoad.lua":"if not TSW then require \"TSWRes Game\" end\n-- Deletes a Level.\nfunction GT.DeleteLevel(Level)\n   Level = Level or GT.Vars.CurrentLevel\n   draw.beginframe\n   Draw.BGs.Loading(\"Deleting Level...\")\n   Draw.SaveNotice\n   draw.endframe\n   if type(Level) == \"number\" then\n      --print(MyMoonLevels)\n      --print(MyMoonLevels[\"Levels\"])\n      local SLT = MyMoonLevels[\"SavedLevelTab\"]\n      table.remove(SLT, Level)\n      MyMoonLevels[\"Levels\"] = #MyMoonLevels[\"SavedLevelTab\"]\n      print(\"Saving to MyMoonLevels\")\n      Loader.SaveMyMoonLevels\n   end\n   os.remove(\"SavedData\/LBPLua.Level\"..Level..\".lualevel\")\n   os.remove(\"SavedData\/LBPLua.Level\"..Level..\".lualobj\")\n   os.remove(\"SavedData\/LBPLua.Level\"..Level..\".lualch\")\n   FixLevels\n   print(\"Ok\")\nend\n\nfunction FixLevels\n   local Num = 1\n   for i=1, #MyMoonLevels[\"SavedLevelTab\"] do\n      if io.open(\"SavedData\/LBPLua.Level\"..i..\".lualevel\") == nil then\n         GT.LoadLevel(i + 1)\n         GT.SaveLevel(Num)\n      else\n         Num = Num + 1\n      end\n   end\nend\n\nfunction GT.CompressLevelObjectString\n   local String = \"\" --JSON.EncodeJSON(ObjTab)\n   local Tab = ObjTab--JSON.DecodeJSON(String)\n   local SaveTab = {}\n   for k, v in ipairs(Tab) do\n      SaveTab[k] = {}\n      local OT = SaveTab[k]\n      OT[\"2\"] = true\n      OT[\"CT\"] = v[\"CorTab\"] or \"\"\n      if #v[\"Attach\"] > 0 then\n         OT[\"A\"] = v[\"Attach\"]\n      end\n      if #v[\"Stickers\"] > 0 then\n         OT[\"St\"] = v[\"Stickers\"]\n      end\n      OT[\"X\"] = v[\"X\"]\n      OT[\"Y\"] = v[\"Y\"]\n      OT[\"S\"] = v[\"Size\"]\n      if v[\"Dynam\"] == true then\n         OT[\"D\"] = v[\"Dynam\"]\n      end\n      if v[\"RotRad\"] ~= 0 then\n         OT[\"RR\"] = v[\"RotRad\"]\n      end\n      OT[\"M\"] = v[\"Mat\"]\n      OT[\"TV\"] = v[\"TVal\"]\n      if v[\"Lethal\"] ~= nil then\n         OT[\"L\"] = v[\"Lethal\"]\n      end\n      if v[\"NoCollide\"] ~= false then\n         OT[\"N\"] = v[\"NoCollide\"]\n      end\n   end\n   String = JSON.EncodeJSON(SaveTab)\n   return String\nend\n\nfunction A(Tab)\n   local V = 0\n   for k, v in pairs(Tab) do\n      V = V + 1\n   end\n   return V\nend\n\nfunction GT.UncompressLevelObjectString(String)\n   local Tab = JSON.DecodeJSON(String)\n   local NewObjTab = {}\n   local time = os.clock\n   for k, v in ipairs(Tab) do\n      if os.clock > time + (1\/FR) then\n         Draw.LoadingProg(k, #Tab)\n         time = os.clock\n      end\n      if v[\"2\"] == nil then\n         ObjTab = Tab\n         return\n      end\n      NewObjTab[k] = {}\n      local OT = NewObjTab[k]\n      OT[\"CorTab\"] = v[\"CT\"]\n      OT[\"Attach\"] = {}\n      OT[\"Stickers\"] = {}\n      OT[\"X\"] = v[\"X\"]\n      OT[\"Y\"] = v[\"Y\"]\n      OT[\"Size\"] = v[\"S\"]\n      OT[\"Weight\"] = v[\"S\"]*v[\"S\"]\n      OT[\"Dynam\"] = v[\"D\"] or false\n      OT[\"RotRad\"] = v[\"RR\"] or 0\n      OT[\"Mat\"] = v[\"M\"]\n      OT[\"TVal\"] = tonumber(v[\"TV\"]) or 0\n      OT[\"XVol\"] = 0\n      OT[\"YVol\"] = 0\n      OT[\"RVol\"] = 0\n      OT[\"Lethal\"] = v[\"L\"]\n      OT[\"NoCollide\"] = v[\"N\"]\n      OT[\"Link\"] = 1\n   end\n   ObjTab = NewObjTab\nend\n\n-- Saves a level.\nfunction GT.SaveLevel(Level)\n   Level = Level or GT.Vars.CurrentLevel\n   --print(\"Saving Level\")\n   draw.beginframe\n   Draw.BGs.Loading(\"Your level is being saved...\")\n   Draw.SaveNotice\n   draw.endframe\n   if type(Level) == \"number\" then\n      print(MyMoonLevels)\n      print(MyMoonLevels[\"Levels\"])\n      local SLT = MyMoonLevels[\"SavedLevelTab\"]\n      SLT[Level] = LevelTab\n      MyMoonLevels[\"Levels\"] = #MyMoonLevels[\"SavedLevelTab\"]\n      --print(\"Saving to MyMoonLevels\")\n      Loader.SaveMyMoonLevels\n   end\n   local LObjStr = GT.CompressLevelObjectString\n   local LevelStr = JSON.EncodeJSON(LevelTab,print)\n   local CheStr = JSON.EncodeJSON(ChPtTab,print)\n   local LevelSave = io.open(\"SavedData\/LBPLua.Level\"..Level..\".lualevel\", \"w\")\n   LevelSave:write(LevelStr)\n   LevelSave:close\n   local ObjSave = io.open(\"SavedData\/LBPLua.Level\"..Level..\".lualobj\", \"w\")\n   ObjSave:write(LObjStr)\n   ObjSave:close\n   local ChPtSave = io.open(\"SavedData\/LBPLua.Level\"..Level..\".lualch\", \"w\")\n   ChPtSave:write(CheStr)\n   ChPtSave:close\n   LoaderTab.LoadMyMoonLevels\nend\n\n-- Loads a level\nfunction GT.LoadLevel(Level)\n   draw.beginframe\n   Draw.BGs.Loading\n   Draw.LoadNotice\n   draw.endframe\n   local LevelSave = io.open(\"SavedData\/LBPLua.Level\"..Level..\".lualevel\")\n   if LevelSave == nil then\n      print(\"Level is corrupted!\")\n      return -1\n   end\n   local LSt = LevelSave:read\n   LevelTab = JSON.DecodeJSON(LSt)\n   LevelSave:close\n   local ObjSave = io.open(\"SavedData\/LBPLua.Level\"..Level..\".lualobj\")\n   ObjTabStr = (ObjSave:read)\n   ObjSave:close\n   local ChPtSave = io.open(\"SavedData\/LBPLua.Level\"..Level..\".lualch\")\n   local ChPtStr = ChPtSave:read\n   ChPtSave:close\n   Ok3, ChPtTab = pcall(JSON.DecodeJSON, ChPtStr)\n   --print(string.sub(ObjTab,0, 2000))\n   --pcall(JSON.DecodeJSON, ObjTabStr)\n   GT.UncompressLevelObjectString(ObjTabStr)\n   if Ok3 == false then\n      error(\"Error loading level \"..Level..\" (\"..ChPtTab..\")\")\n   elseif type(ChPtTab) == \"string\" then\n      error(\"ChPtTab is of incorrect type (\"..type(ChPtTab)..\")\")\n   end\n   GT.FixIncLTV\n   if not LevelTab[\"WaterLevel\"] then\n      LevelTab[\"WaterLevel\"] = 10000\n   end\n   CG\nend","TSWRes ObjectsSackboy.lua":"function GT.ResetCostume\n   PlayCostume = {\n      [\"Material\"] = \"Brown Knit\",\n      [\"Eyes\"] = \"Button Eyes\",\n      [\"Glasses\"] = \"Nil\",\n      [\"Hair\"] = \"Nil\",\n      [\"Head\"] = \"Nil\",\n      [\"Mouth\"] = \"Nil\",\n      [\"Mustache\"] = \"Nil\",\n      [\"Feet\"] = \"Nil\",\n      [\"Hands\"] = \"Nil\",\n      [\"Leggings\"] = \"Nil\",\n      [\"Neck\"] = \"Nil\",\n      [\"Torso\"] = \"Nil\",\n      [\"Waist\"] = \"Nil\",\n      [\"Stickers\"] = {},\n      [\"Head\"] = \"Basic\",\n      [\"Belly\"] = \"Basic\"\n   }\nend\n\n\n\nfunction ObjRes.SackboyHead(BellyCol, X, Y, Size, RotRad, Mat, k, black)\n   draw.fillrect(X-(12*Size), Y - (37.98*Size), X+(11*Size), Y-(1*Size), BellyCol)\n   draw.fillrect(X+(16*Size), Y - (8*Size), X+(20*Size), Y-(4*Size), BellyCol)\n   draw.fillcircle(X-(7.81*Size), Y-(14*Size), (16*Size), BellyCol)\n   draw.fillcircle(X+(3.1*Size), Y-(16.99*Size), (19.7*Size), BellyCol)\n   ObjRes.Custom(SbHead, X-(24*Size), Y-(40*Size), (48*Size), 0, BellyCol)\n   -- Mouth\n   ObjRes.SackboyMouth(BellyCol, X, Y, Size, RotRad, Mat, k, black)\n   -- Eyes\n   draw.fillcircle(X-(11*Size), Y-(25*Size), (5*Size), black)\n   draw.fillcircle(X+(11*Size), Y-(25*Size), (5*Size), black)\nend\n\nfunction ObjRes.SackboyBelly(BellyCol, X, Y, Size, RotRad, Mat, k, white)\n   draw.fillrect(X-(8*Size), Y-(10*Size),X+(8*Size), Y+(20*Size), BellyCol)\n   draw.fillcircle(X+(.3*Size), Y+(18*Size), (5*Size), BellyCol)\n   ObjRes.Custom(SbBelly, X-(8*Size), Y, (24*Size), 0, BellyCol)\n   -- Zipper\n   draw.line(X, Y+(4*Size), X, Y + (24*Size), white)\n   draw.rect(X-(4*Size), Y+(4*Size), X+(4*Size), Y+(8*Size), white)\n   draw.fillrect(X-(3*Size), Y+(8*Size), X+(3*Size), Y+(12*Size), white)\n   draw.rect(X-(3*Size), Y+(8*Size), X+(3*Size), Y+(20*Size), white)\nend\n\nfunction ObjRes.SackboyLeftArm(BellyCol, X, Y, Size, RotRad, Mat, k, white)\n\nend\n\nfunction ObjRes.SackboyRightArm(BellyCol, X, Y, Size, RotRad, Mat, k, white)\n\nend\n\nfunction ObjRes.Sackboy(CorTab, X, Y, Size, RotRad, Mat, k, Costume)\n   Size = Size \/ 32\n   local SackMat = Costume[\"SackMat\"]\n   --draw.rect(X-20, Y-40, X+20, Y, draw.black)\n   local BellyCol, black, white = SackboyMaterials[SackMat] or draw.brown, draw.black, draw.white\n   local BellySel, HeadSel = Costume[\"Belly\"], Costume[\"Head\"]\n   if BellySel == nil then\n      GT.ResetCostume\n   end\n   -- Belly\n   SackboyBelly[BellySel](BellyCol, X, Y, Size, RotRad, Mat, k, white)\n   -- Head\n   SackboyHead[HeadSel](BellyCol, X, Y, Size, RotRad, Mat, k, black)\n   -- Left Arm\n\n   -- Right Arm\n\n   -- Left Leg\n\n   -- Right Leg\n\n   if ObjSelected == k then\n\n   end\nend\nlocal Col255 = Draw.Col255\n\nGT.ResetCostume\n\nSackMat = PlayCostume[\"Materials\"]\n\nSackboyMaterials = {\n   [\"Brown Knit\"] = draw.brown,\n   [\"Cheese\"] = draw.yellow,\n   [\"Blue Denim\"] = draw.blue\n}\n\nSbHead = { {.15, .05*.9}, {.5, 0*.9},\n   {.823, .08*.9} --Top Right Corner, {.95, .28*.9},\n   {1, .72*.9}, {.89, .9*.9}, -- Lower Right Corner\n   {.69, .98*.9}, --{.6, .97*.9}, {.4, 1*.9},\n   {.15, .95*.9}, {.02, .8*.9}, --{.03, .75*.9},\n{0, .52*.9} }\nSbBelly = { {.09*.66, 0}, {.93*.66, 0}, {.93*.66, .08}, {1.*.66, .48}, {1*.66, .75}, {.75*.66, .95}, {.5*.66, 1}, {.25*.66, .95}, {0, .56} }\nSbLArm = {\n}\nSbRArm = {\n}\nSbLLeg = {\n}\nSbRLeg = {\n}\nSackboyBelly = { -- For Sackboy's belly\n   [\"Basic\"] = ObjRes.SackboyBelly\n}\nSackboyHead = { -- For Sackboy's head\n   [\"Basic\"] = ObjRes.SackboyHead\n}\n\nrequire \"TSWRes ObjectsSackboyMouth\"\n\nreturn","TSWRes Draw1.lua":"function Draw.PrintIcons(t,X1,Y1,X2,Y2)\n   t2=t2 or t\n   local X2, Y2 = X2 or SizeX, Y2 or SizeY\n   local FunX,FunY = X1, Y1\n   local DwSize, IcoSize = 1, 32\n   local OptSz = 32\n   local DISz = (IcoSize*DwSize)\n   local Odd = false\n   local rect = draw.rect\n   for k,v in ipairs(t) do\n      rect(FunX, FunY, FunX+32, FunY+32,draw.black)\n      --print(ObjTooSiz[v])\n      --assert(ObjIcoSiz[v], \"no Icon size for object \"..v)\n      Draw.Object(v, FunX + 16, FunY + 16, ObjIcoSiz[v] or 16, 0, SelectedMaterial, nil, true, 0)\n      FunX = FunX + OptSz\n      if FunX > X2 then\n         FunX, FunY = X1, FunY + OptSz\n      end\n   end\nend\n\nfunction Draw.PrintLogicIcons(t,X1,Y1,X2,Y2)\n   t2=t2 or t\n   local X2, Y2 = X2 or SizeX, Y2 or SizeY\n   local FunX,FunY = X1, Y1\n   local DwSize, IcoSize = 1, 32\n   local OptSz = 32\n   local DISz = (IcoSize*DwSize)\n   local Odd = false\n   local rect = draw.rect\n   for k,v in ipairs(t) do\n      rect(FunX, FunY, FunX+32, FunY+32,draw.black)\n      --print(ObjTooSiz[v])\n      --assert(ObjIcoSiz[v], \"no Icon size for object \"..v)\n      Draw.LogicObject(v, FunX + 16, FunY + 16, ObjIcoSiz[v] or 16, 0, SelectedMaterial, nil, true, 0)\n      FunX = FunX + OptSz\n      if FunX > X2 then\n         FunX, FunY = X1, FunY + OptSz\n      end\n   end\nend\n\nfunction Draw.PrintCustomObjects(t,X1,Y1,X2,Y2)\n   t2=t2 or t\n   local X2, Y2 = X2 or SizeX, Y2 or SizeY\n   local FunX,FunY = X1, Y1\n   local DwSize, IcoSize = 1, 32\n   local OptSz = 32\n   local DISz = (IcoSize*DwSize)\n   local Odd = false\n   local rect = draw.rect\n   for k,v in ipairs(t) do\n      rect(FunX, FunY, FunX+32, FunY+32,draw.black)\n      Draw.Object(v, FunX + 16, FunY + 16, 16, 0, SelectedMaterial, nil, true, 0)\n      FunX = FunX + OptSz\n      if FunX > X2 then\n         FunX, FunY = X1, FunY + OptSz\n      end\n   end\nend\n\nfunction Draw.PrintStickersPopit(t,X1,Y1,X2,Y2)\n   t2=t2 or t\n   Y1 = Y1 - 32\n   local X2, Y2 = X2 or SizeX, Y2 or SizeY\n   local FunX,FunY = X1, Y1\n   local DwSize, IcoSize = 1, 32\n   local OptSz = 32\n   local DISz = (IcoSize*DwSize)\n   local Odd = false\n   local rect = draw.rect\n   for k,v in ipairs(t) do\n      rect(FunX, FunY, FunX+32, FunY+32,draw.black)\n      --print(ObjTooSiz[v])\n      Stickers[v](FunX + 16, FunY + 16, 16)\n      FunX = FunX + OptSz\n      if FunX > X2 then\n         FunX, FunY = X1, FunY + OptSz\n      end\n   end\nend\n\nfunction Draw.PrintMaterials(t,X1,Y1,X2,Y2)\n   t2=t2 or t\n   local X2, Y2 = X2 or SizeX, Y2 or SizeY\n   local FunX,FunY = X1, Y1\n   local DwSize, IcoSize = 1, 32\n   local OptSz = 32\n   local DISz = (IcoSize*DwSize)\n   local Odd = false\n   local rect = draw.rect\n   for k,v in pairs(t) do\n      draw.fillrect(FunX, FunY-32, FunX+32, FunY, v)\n      rect(FunX, FunY-32, FunX+32, FunY,draw.black)\n      --print(ObjTooSiz[v])\n      FunX = FunX + OptSz\n      if FunX > X2 then\n         FunX, FunY = X1, FunY + OptSz\n      end\n   end\nend\n\nfunction Draw.PrintStickIcons(t,X1,Y1,X2,Y2)\n   t2=t2 or t\n   local X2, Y2 = X2 or SizeX, Y2 or SizeY\n   local FunX,FunY = X1, Y1\n   local DwSize, IcoSize = 1, 64\n   local OptSz = 64\n   local DISz = (IcoSize*DwSize)\n   local Odd = false\n   local Col = nil\n   for k,v in ipairs(t) do\n      local Func = Stickers[k]\n      Odd = not Odd\n      if Odd then\n         Col = PlayCol1\n      else\n         Col = PlayCol2\n      end\n      --print(t)\n      --print(k, v, Func)\n      draw.fillrect(FunX, FunY, FunX+64, FunY+64, Col)\n      Func(FunX + 32, FunY + 32, 32)\n      FunX = FunX + OptSz\n      if FunX + OptSz > X2 then\n         FunX, FunY = X1, FunY + OptSz\n      end\n   end\nend\n\n-- Draw a String Box\nfunction Draw.StringBoxR(Str, X1, Y1, X2, Y2, FCol)\n   local XSize = X2-X1\n   draw.fillroundedrect(X1, Y1, X2, Y2, 4, FCol)\n   draw.roundedrect(X1, Y1, X2, Y2, 4, draw.black)\n   draw.string(Str, X1+( (XSize) \/ 2 - (draw.stringsize(Str)\/2)), Y2 - 24, draw.black)\nend\n\nfunction Draw.StickerEdit\n\nend\n\nfunction Draw.CircleSplitLine(X, Y, Radius, Lines, Space, Col, Start)\n   Start = Start or 0\n   Space = Space\n   -- local St, En = math.pi +\n   local Add = 1\/(Lines)\n   --print(\"Draw.CircleSplitLine\", Add)--\/math.pi)\n   for i=1, Lines do\n      -- Lines\n      --print((Start+(((Add*i)+(Space))*1))\/math.pi, (Start+(((Add*(i+1))-(Space))*1))\/math.pi)\n      draw.arc(X, Y, Radius, Start+(((Add*i)+(Space))*1), Start+(((Add*(i+1))-(Space))*1), Col )\n   end\n   draw.fillcircle(X, Y, Radius-16, draw.black)\nend\n\nfunction Draw.LuaIcon(X1, Y1, X2, Y2)\n   local S = .40\n   local XW, YH = (X2-X1)*S, (Y2-Y1)*S\n   local LuaCol = Draw.Col255(0, 0, 128)\n   draw.fillrect(X1, Y1, X2, Y2, draw.blue)\n   local XO, YO = XW*(1.12-S), YH*(1.12-S)\n   X1, Y1, X2, Y2 = X1 + XO, Y1 + YO, X2 + XO, Y2 + YO\n   draw.circle(X1+(XW*.5), Y1+(YH*.5), XW*1.25, draw.gray)\n   --Draw.CircleSplitLine(X1+(XW*.5), Y1+(YH*.5), XW*1.25, 32, (32\/3), draw.gray, -(.5)) Unused intill function is fixed.\n   draw.fillcircle(X1+(XW*.5), Y1+(YH*.5), XW, LuaCol)\n   draw.fillcircle(X1+(XW*.79), Y1+(YH*.108), XW*.33, draw.white)\n   draw.fillcircle(X1+(XW*1.5), Y1-(YH*.5), XW*.33, LuaCol)\n   draw.setfont(\"Arial\", XW*.82)\n   draw.string(\"Lua\", X1-(XW*.2), Y1+(YH*.33), draw.white)\n   draw.setfont(\"Arial\", 16)\nend\n\nfunction Draw.LevelIcons\n\n\nend\n\nfunction Draw.TxtBoxHeight(String)\n   local SSX = draw.stringsize(String)\n   return (math.ceil(SSX\/((SizeX - 98) - 98)) + 1)*16\nend\n\nfunction Draw.MagicMouthText(String, String2)\n   local BoxHeight = Draw.TxtBoxHeight(String)\n   draw.fillroundedrect(98, 24, SizeX - 98, 24 + BoxHeight, 4, draw.white)\n   draw.stringinrect(String, 98, 24, SizeX - 98, 24 + BoxHeight, draw.black)\n   if String2 then\n      draw.fillroundedrect(98, 8, draw.stringsize(String2) + 98, 24, 4, draw.white)\n      draw.string(String2, 98, 8, draw.black)\n   end\nend\n\nfunction Draw.NoticeText(String, String2)\n   local BoxHeight = Draw.TxtBoxHeight(String)\n   draw.fillroundedrect(98, 24, SizeX - 98, 24 + BoxHeight, 4, draw.black)\n   draw.stringinrect(String, 98, 24, SizeX - 98, 24 + BoxHeight, draw.white)\n   if String2 then\n      draw.fillroundedrect(98, 8, draw.stringsize(String2) + 98, 24, 4, draw.black)\n      draw.string(String2, 98, 8, draw.white)\n   end\nend\n\n\nfunction Draw.Buttons(Amount)\n   draw.rect(SizeX-160, SizeY-96, SizeX-96, SizeY-32, PlayCol1)\n   if Amount > 1 then\n\n   end\nend\n\nreturn","TSWRes DrawSaveIcon.lua":"SaveIcon = {}\nSaveIconS = {}\nfunction Deg(Rad)\n   local Times = 360\/math.pi\n   return (Rad\/Times)*2\nend\nfunction SaveIconS.RotatingLines(X, Y, Size, Frame)\n   Frame = Frame*10\n   draw.fillarc(X + (Size\/2), Y + (Size\/2), Size\/2.8, Deg(Frame), Deg(Frame + 90), draw.white)\n   draw.fillarc(X + (Size\/2), Y + (Size\/2), Size\/2.8, Deg(Frame + 180), Deg(Frame + 270), draw.white)\n   draw.fillcircle(X + (Size\/2), Y + (Size\/2), Size\/3, draw.black)\nend\n\nfunction SaveIco(X, Y, Size, Frame)\n   Size = Size * 48\n   draw.fillcircle(X + (Size\/2), Y + (Size\/2), Size\/2, draw.black)\n   SaveIconS.RotatingLines(X, Y, Size, Frame)\nend\n--draw.setscreen(1)\n\nwhile true do\n   for i=1, 360\/10 do\n      draw.beginframe\n      draw.clear\n      SaveIco(30, 24, 1, i)\n      draw.endframe\n      sys.sleep(1000\/30)\n   end\nend","TSWRes ObjectsSackbot.lua":"function ObjRes.SackbotHead(BellyCol, X, Y, Size, RotRad, Mat, k, black)\n\nend\n\nfunction ObjRes.SackbotHead(BellyCol, X, Y, Size, RotRad, Mat, k, white)\n\nend\n\nfunction ObjRes.SackbotLeftArm(BellyCol, X, Y, Size, RotRad, Mat, k, white)\n\nend\n\nfunction ObjRes.SackbotRightArm(BellyCol, X, Y, Size, RotRad, Mat, k, white)\n\nend\n\nfunction ObjRes.SackbotLeftLeg(BellyCol, X, Y, Size, RotRad, Mat, k, white)\n\nend\n\nfunction ObjRes.SackbotRightLeg(BellyCol, X, Y, Size, RotRad, Mat, k, white)\n\nend\n\nreturn","TSWRes Popit1.lua":"-- This is used for the Tweak Tool --\nif not TSW then require \"TSWRes Game\" end\n\nfunction Draw.TweakerSlider(X, Y, Value, MaxValue)\n   draw.triangle(X, Y + 16, X + 96, Y, X + 96, Y + 32, draw.white)\n   local BarPos = (Value\/MaxValue) * 96\n   draw.fillroundedrect((X - 4) + BarPos, Y, (X + 4) + BarPos, Y + 32, 3, draw.white)\nend\n\nfunction Draw.TweakerColor(X, Y, Color)\n   draw.fillcircle(X + 8, Y + 8, 8, draw.red)\n   draw.fillcircle(X + 24, Y + 8, 8, draw.green)\n   draw.fillcircle(X + 16, Y + 24, 8, draw.blue)\n   draw.fillrect(X + 32, Y, X + 96, Y + 32, Color)\nend\n\nfunction Draw.TweakerValue(X, Y, Value, MaxValue)\n   draw.rect(X, Y + 8, X + 16, Y + 24, draw.black)\n   draw.rect(X + 16, Y + 8, X + 32, Y + 24, draw.black)\n   draw.string(\"+  -\", X, Y + 5, draw.black)\n   draw.string(Value, X + 32, Y + 8, draw.black)\nend\n\nfunction Draw.TweakerYesNo(X, Y, Value)\n\nend\n\nfunction Draw.Tweaker(ObjNum)\n   local Object = ObjTab[ObjNum]\n   if type(Object[\"CorTab\"]) == \"table\" then\n      Draw.TweakerBasic\n   else\n      if Object[\"CorTab\"] == \"Button\" then\n         Draw.TweakerLogicObject\n      else\n         Draw.TweakerBasic\n      end\n   end\nend\n\n-- Tweaker Menus\nfunction Draw.TweakerBasic\n   local Object = ObjTab[ObjSelected]\n   draw.string(\"Actions\", SizeX - 192, 48, draw.black)\n   draw.rect(SizeX - 192, 64, SizeX - 32, 64 + 64, draw.black)\n   draw.image(\"Images\/Copy.png\", SizeX - 192, 64)\nend\n\nfunction Draw.TweakerLogicObject\n   Draw.TweakerBasic\n   Draw.TweakerSlider(SizeX - 128, 128, 0, 1)\n   Draw.TweakerColor(SizeX - 128, 160, draw.lightgray)\n   Draw.TweakerValue(SizeX - 128, 192, 0, 1)\nend\n\n--","TSWRes Saving.lua":"if not TSW then require \"TSWRes Game\" end\n\nfunction GT.LoadProfile\n   if not FS.exists(\"SavedData\/LBPProfileSave.JSON\") then\n      GT.NewProfile\n      return true, \"No file found\"\n   end\n   local FileHandle = io.open(\"SavedData\/LBPProfileSave.JSON\")\n   if not FileHandle then\n      return false, \"Profile is unreadable\"\n   end\n   local STString = FileHandle:read\n   local SaveTable = JSON.DecodeJSON(STString)\n   PlayCol1 = SaveTable[\"PlayCol1\"]\n   PlayCol2 = SaveTable[\"PlayCol2\"]\n   PlayCol3 = SaveTable[\"PlayCol3\"]\n   PlayCostume = SaveTable[\"PlayCostume\"]\n   DrawStatusBar = SaveTable[\"DrawStatusBar\"]\n   UndoFunction = SaveTable[\"UndoFunction\"]\n   return true\nend\n\nfunction GT.SaveSettings\n   GT.SaveProfile\nend\n\nfunction GT.SaveProfile\n   local SaveTable = {}\n   SaveTable[\"PlayCol1\"] = PlayCol1\n   SaveTable[\"PlayCol2\"] = PlayCol2\n   SaveTable[\"PlayCol3\"] = PlayCol3\n   SaveTable[\"PlayCostume\"] = PlayCostume\n   SaveTable[\"DrawStatusBar\"] = DrawStatusBar\n   SaveTable[\"UndoFunction\"] = UndoFunction\n   local STString = JSON.EncodeJSON(SaveTable)\n   local FileHandle = io.open(\"SavedData\/LBPProfileSave.JSON\", \"w\")\n   FileHandle:write(STString)\n   FileHandle:close\n   return true\nend\n\nfunction GT.NewProfile\n   if not FS2.isDirectory(\"SavedData\") then\n      FS2.mkDir(\"SavedData\")\n      FS2.mkDir(\"SavedData\/Levels\")\n      FS2.mkDir(\"SavedData\/Community\")\n      FS2.mkDir(\"SavedData\/MyObjects\")\n      FS2.mkDir(\"SavedData\/Story\")\n      --for k, v in pairs(FS2) do\n         print(k, v)\n      end\n   end\n   MyMoonLevels[\"Levels\"] = 0\n   MyMoonLevels[\"SavedLevelTab\"] = {}\n   GT.SaveProfile\n   LoaderTab.SaveMyMoonLevels\n   Community.LoadFile\n   Community.SaveFile\n   StoryRes.BlankFile\nend\n\n-- End of File.","TSWRes Game2.lua":"-- Collision Scripts --\nif not TSW then require \"TSWRes Game\" end\n\n-- This collision function is broken\n--\nfunction CRec(X1, Y1, X2, Y2, X3, Y3, X4, Y4, XVol, YVol)\n   --print(\"CRec\"..X1,Y1,X2,Y2,X3,Y3,X4,Y4)\n   local L, R, U, D = 0,0,0,0\n   local Col = false\n   local ColX, ColY\n   if X3.2 then\n      R = 1\n      ColX=true\n   end\n   if X4>X2 and XVol<-.2 then\n      L = 1\n      ColX=true\n   end\n   if Y3>Y1 and YVol>.2 then\n      D = 1\n      ColY=true\n   end\n   if Y4 X3 and X2 < X4 then\n      if Y2 > Y3 and Y1 < Y4 then\n         return true\n      end\n   end\n   return false\nend\n\nfunction DrawColBox(X1, Y1, X2, Y2, X3, Y3, X4, Y4)\n   draw.beginframe\n   draw.rect(X1 - CamX, Y1 + CamY, X2 - CamX, Y2 + CamY, draw.black)\n   if X3 then\n      draw.rect(X3 - CamX, Y3 + CamY, X4 - CamX, Y4 + CamY, draw.white)\n   end\n   draw.endframe\nend\n\nfunction CollisionTest(Obj1, Obj2)\n   local Collision, ColX, ColY = false, 0, 0\n   local Obj1X, Obj1Y, Obj1Sz = Obj1[\"X\"], Obj1[\"Y\"], Obj1[\"Size\"]\n   local Obj2X, Obj2Y, Obj2Sz = Obj2[\"X\"], Obj2[\"Y\"], Obj2[\"Size\"]\n   local X1, Y1, X2, Y2 = Obj1X - Obj1Sz, Obj1Y - Obj1Sz, Obj1X + Obj1Sz, Obj1Y + Obj1Sz\n   local X3, Y3, X4, Y4 = Obj2X - Obj2Sz, Obj2Y - Obj2Sz, Obj2X + Obj2Sz, Obj2Y + Obj2Sz\n   if Obj1[\"CorTab\"] == \"Square\" then\n      if Obj2[\"CorTab\"] == \"Square\" then\n         --X3, Y3 = X3 + Obj2Sz, Y3 + Obj2Sz\n         Y3 = Y3\n         --DrawColBox(X3, Y3, X4, Y4)\n         Collision = CRecs(X1, Y1, X2, Y2, X3, Y3, X4, Y4)\n         if Collision then\n            --draw.fillrect(X1 - CamX, Y1 + CamY, X2 - CamX, Y2 + CamY, draw.blue)\n         end\n      elseif Obj2[\"CorTab\"] == \"LevelEdge\" then\n         X3, Y3 = X3 + Obj2Sz, Y3 + Obj2Sz\n         Collision = CRecs(X1, Y1, X2, Y2, X3, Y3, X4, Y4)\n      end\n   elseif Obj1[\"CorTab\"] == \"Sackboy\" then\n      if Obj2[\"CorTab\"] == \"Square\" then\n         Collision = CRecs(X1, Y1, X2, Y2, X3, Y3, X4, Y4)\n      elseif Obj2[\"CorTab\"] == \"LevelEdge\" then\n         X3, Y3 = X3 + Obj2Sz, Y3 + Obj2Sz\n         Collision = CRecs(X1, Y1, X2, Y2, X3, Y3, X4, Y4)\n      elseif Obj2[\"CorTab\"] == \"ScoreBubble\" then\n         X2, Y2 = X2 + Obj1Sz, Y2 + Obj1Sz\n         X3, Y3 = X3 - Obj2Sz, Y3 - Obj2Sz\n         Collision = CRecs(X1, Y1, X2, Y2, X3, Y3, X4, Y4)\n         if Collision == true then\n            GT.PointBubblePop\n            return true, ColX, ColY, true\n         end\n      elseif Obj2[\"CorTab\"] == \"Spikes\" then\n         Collision = CRecs(X1, Y1, X2, Y2, X3, Y3, X4, Y4)\n      end\n      if Collision == true then\n         if Obj2[\"Lethal\"] ~= nil or Obj2[\"CorTab\"] == \"Spikes\" then\n            GT.SackDie\n         end\n      end\n   elseif Obj1[\"CorTab\"] == \"Circle\" then\n   elseif Obj1[\"CorTab\"] == \"Triangle\" then\n   elseif type(Obj1[\"CorTab\"]) == \"table\" then\n   end\n   if Collision == true then\n      ColX, ColY = PushFromObject(Obj1, Obj2)\n   end\n   return Collision, ColX, ColY\nend\n\nfunction CheckForScoreboardEndOfLevel(ScKey)\n   local Scoreboard = ObjTab[ScKey]\n   local Sb = ObjTab[6]\n   Collision = CRecs(Sb[\"X\"] - Sb[\"Size\"],\n   Sb[\"Y\"] - Sb[\"Size\"],\n   Sb[\"X\"] + Sb[\"Size\"],\n   Sb[\"Y\"] + Sb[\"Size\"],\n   Scoreboard[\"X\"] - Scoreboard[\"Size\"],\n   Scoreboard[\"Y\"] - Scoreboard[\"Size\"],\n   Scoreboard[\"X\"] + Scoreboard[\"Size\"],\n   Scoreboard[\"Y\"] + Scoreboard[\"Size\"])\n   if Collision then\n      GT.LevelWon1(ScKey)\n   end\nend\n\nfunction PushFromObject(Obj1, Obj2)\n   local PushForce = (4.8\/(10*1))*(math.abs(Obj1[\"XVol\"])+math.abs(Obj1[\"YVol\"]))\n   local PF = PushForce\n   local ColX, ColY = 0, 0\n   --if Obj1[\"X\"] > Obj2[\"X\"] - Obj2[\"Size\"] and Obj1[\"X\"] < Obj2[\"X\"] + Obj2[\"Size\"] then\n   if Obj1[\"Y\"] > Obj2[\"Y\"] and Obj1[\"YVol\"] > 0 then\n      Obj1[\"YVol\"] = Obj1[\"YVol\"] - PF or -PF\n      ColY = -PF\n   elseif Obj1[\"Y\"] < Obj2[\"Y\"] and Obj1[\"YVol\"] < 0 then\n      Obj1[\"YVol\"] = Obj1[\"YVol\"] + PF or PF\n      ColY = PF\n   end\n   --elseif Obj1[\"Y\"] > Obj2[\"Y\"] - Obj2[\"Size\"] and Obj1[\"Y\"] < Obj2[\"Y\"] + Obj2[\"Size\"] then\n   if Obj1[\"X\"] > Obj2[\"X\"] and Obj1[\"XVol\"] < 0 then\n      Obj1[\"XVol\"] = Obj1[\"XVol\"] + PF or PF\n      ColX = PF\n   elseif Obj1[\"X\"] < Obj2[\"X\"] and Obj1[\"XVol\"] > 0 then\n      Obj1[\"XVol\"] = Obj1[\"XVol\"] - PF or -PF\n      ColX = -PF\n   end\n   --end\n   return ColX, ColY\nend\n\nreturn","TSKeyboard1.lua":"function Key.Tap(TX, TY)\n   local SX, SY = draw.getport\n   local TRec = TRec\n   local RV=\"\"\n   local L1, L2, L3, L4 = SY-128, SY-96, SY-64, SY-32\n   local X1, X2, X3, X4 = L2-2, L3-2, L4-2, SY-2\n   local LS = 4\n   local Q = TRec(2, L1, 40-LS, X1, TX, TY)\n   local W = TRec(42-LS, L1, 80-(LS*2), X1, TX, TY)\n   local E = TRec(82-(LS*2), L1, 120-(LS*3), X1, TX, TY)\n   local R = TRec(122-(LS*3), L1, 160-(LS*4), X1, TX, TY)\n   local T = TRec(162-(LS*4), L1, 200-(LS*5), X1, TX, TY)\n   local Y = TRec(202-(LS*5), L1, 240-(LS*6), X1, TX, TY)\n   local U = TRec(242-(LS*6), L1, 280-(LS*7), X1, TX, TY)\n   local I = TRec(282-(LS*7), L1, 320-(LS*8), X1, TX, TY)\n   local O = TRec(322-(LS*8), L1, 360-(LS*9), X1, TX, TY)\n   local P = TRec(362-(LS*9), L1, 400-(LS*10), X1, TX,  TY)\n\n   local A = TRec(2, L2, 40, X2, TX, TY)\n   local S = TRec(42, L2, 80, X2, TX, TY)\n   local D = TRec(82, L2, 120, X2, TX, TY)\n   local F = TRec(122, L2, 160, X2, TX, TY)\n   local G = TRec(162, L2, 200, X2, TX, TY)\n   local H = TRec(202, L2, 240, X2, TX, TY)\n   local J = TRec(242, L2, 280, X2, TX, TY)\n   local K = TRec(282, L2, 320, X2, TX, TY)\n   local L = TRec(322, L2, 360, X2, TX, TY)\n\n   local Shift = TRec(2, L3, 40, X3, TX, TY)\n   local Z = TRec(42, L3, 80, X3, TX, TY)\n   local X = TRec(82, L3, 120, X3, TX, TY)\n   local C = TRec(122, L3, 160, X3, TX, TY)\n   local V = TRec(162, L3, 200, X3, TX, TY)\n   local B = TRec(202, L3, 240, X3, TX, TY)\n   local N = TRec(242, L3, 280, X3, TX, TY)\n   local M = TRec(282, L3, 320, X3, TX, TY)\n   local Back = TRec(322, L3, 360, X3, TX, TY)\n\n   local Space = TRec(2, L4, 200, X4, TX, TY)\n   local SL = TRec(202, L4, 232, X4, TX, TY)\n   local SR = TRec(290, L4, 320, X4, TX, TY)\n   local Enter = TRec(322, L4, 360, X4, TX, TY)\n\n   --Numberpad\n   local K9 = TRec(362, L1, 400, X1, TX, TY)\n   local K8 = TRec(402, L1, 440, X1, TX, TY)\n   local K7 = TRec(442, L1, 480, X1, TX, TY)\n\n   local K6 = TRec(362, L2, 400, X2, TX, TY)\n   local K5 = TRec(402, L2, 440, X2, TX, TY)\n   local K4 = TRec(442, L2, 480, X2, TX, TY)\n\n   local K3 = TRec(362, L3, 400, X3, TX, TY)\n   local K2 = TRec(402, L3, 440, X3, TX, TY)\n   local K1 = TRec(442, L3, 480, X3, TX, TY)\n\n   local K0 = TRec(362, L4, 400, X4, TX, TY)\n   local Ca = TRec(402, L4, 440, X4, TX, TY)\n   local KSlash = TRec(442, L4, 480, X4, TX, TY)\n   if A then\n      RV=\"A\"\n   elseif B then\n      RV=\"B\"\n   elseif C then\n      RV=\"C\"\n   elseif D then\n      RV=\"D\"\n   elseif E then\n      RV=\"E\"\n   elseif F then\n      RV=\"F\"\n   elseif G then\n      RV=\"G\"\n   elseif H then\n      RV=\"H\"\n   elseif I then\n      RV = \"I\"\n   elseif J then\n      RV = \"J\"\n   elseif K then\n      RV = \"K\"\n   elseif L then\n      RV = \"L\"\n   elseif M then\n      RV = \"M\"\n   elseif N then\n      RV = \"N\"\n   elseif O then\n      RV = \"O\"\n   elseif P then\n      RV = \"P\"\n   elseif Q then\n      RV = \"Q\"\n   elseif R then\n      RV = \"R\"\n   elseif S then\n      RV = \"S\"\n   elseif T then\n      RV = \"T\"\n   elseif U then\n      RV = \"U\"\n   elseif V then\n      RV = \"V\"\n   elseif W then\n      RV = \"W\"\n   elseif X then\n      RV = \"X\"\n   elseif Y then\n      RV = \"Y\"\n   elseif Z then\n      RV = \"Z\"\n   elseif K0 then\n      RV = \"0\"\n   elseif K1 then\n      RV = \"1\"\n   elseif K2 then\n      RV = \"2\"\n   elseif K3 then\n      RV = \"3\"\n   elseif K4 then\n      RV = \"4\"\n   elseif K5 then\n      RV = \"5\"\n   elseif K6 then\n      RV = \"6\"\n   elseif K7 then\n      RV = \"7\"\n   elseif K8 then\n      RV = \"8\"\n   elseif K9 then\n      RV = \"9\"\n   elseif KSlash then\n      RV=\"\/\"\n   elseif Enter then\n      RV=\"Enter\"\n   elseif Back then\n      RV=\"Back\"\n   elseif Space then\n      RV=\"Space\"\n   elseif Shift then\n      RV=\"Shift\"\n   elseif Ca then\n      RV=\"Ca\"\n   elseif SL then\n      RV=\"SL\"\n   elseif SR then\n      RV=\"SR\"\n   else\n      RV = \"History\"\n   end\n   return RV\nend\n\n-- Prevent Crashes by adding a few blocks of text\n-- Prevent Crashes by adding a few blocks of text\n-- Prevent Crashes by adding a few blocks of text\n-- Prevent Crashes by adding a few blocks of text","TSWRes.lua":"local print = print\nprint(\"Loading Files\")\n\nlocal ResTable = {}\nRT = ResTable\n--RT.Draw = require \"TSWRes Draw\"\nRT.Game = require \"TSWRes Game\"\n--RT.Objects = require \"TSWRes Objects\"\n\nprint(\"Ready\")\nreturn ResTable","TSWRes Updates.lua":"-- Current Version is Alpha 0.14\n\n--[[Planned features\n1. Saving multiple Levels. (Added)\n2. Logic parts (Lua Script Microchips being new).\n3. Improved Undo and Redo functionalty.\n4. Collision Tool or Collision Tweaker.\n5. Resize and rotate objects. (Resizing avalible after placing object.)\n6. Drawing functions for Objects that will be in the game are being implemented.\n7. Capture MyObjects.\n8. Stickers.\n9. Score (Score Bubbles, Prize Bubbles, Race Gates, Score Giver, and Score Sensor).\n10. If Lua can handle it, Lighting.\n11. Connect to the Internet and access the Community Moon.\n]]\n\n--[[Bugs\n1. Level Name on My Moon loads as \"Broken Level\" (Fixed)\n\n\n\n]]","TSWRes Tool3.lua":"if not TSW then require \"TSWRes Game\" end\n\nfunction GT.PCTouch(TX, TY)\n  local PopitClosed = TRec(SizeX-96, SizeY-96, SizeX-32, SizeY-32,TX,TY)\n   if ObjSelected == nil then\n      if PopitClosed then\n         ToolClosed = true\n         return \"Close\"\n      end\n      if PCEdgeX ~= nil then\n         print(\"Multiple Object Selecting\")\n         ObjSelected = {}\n         for k, v in pairs(ObjTab) do\n            local X1, Y1, X2, Y2 = PCStartX, PCStartY, PCEdgeX, PCEdgeY\n            X1, X2 = math.min(X1, X2), math.max(X1, X2)\n            Y1, Y2 = math.min(Y1, Y2), math.max(Y1, Y2)\n            local ObjTap = TRec(X1, Y1, X2, Y2, v[\"X\"], v[\"Y\"])\n            if ObjTap == true then\n               if k > 4 then\n                  ObjSelected[#ObjSelected + 1] = k\n               end\n            end\n         end\n         if #ObjSelected == 0 then\n            PCEdgeX, PCEdgeY, PCStartX, PCStartY = nil, nil, nil, nil\n            ObjSelected = nil\n            PopitRes.UnavailSound\n         elseif #ObjSelected == 1 then\n            ObjSelected = ObjSelected[1]\n         else\n            PopitRes.PlaceSound\n         end\n      else\n         print(\"Tapped on Object\")\n         for k,v in pairs(ObjTab) do\n            if v[\"X\"] and v[\"Y\"] and v[\"Size\"] then\n               local ObjTap = TRec(v[\"X\"]- 16 -CamX, v[\"Y\"]- 16 +CamY, (v[\"X\"] + v[\"Size\"])+ 4-CamX, (v[\"Y\"] + v[\"Size\"])+ 4+CamY, TX, TY)\n               if ObjTap == true then\n                  if k > 4 then\n                     ObjSelected = k\n                  end\n               end\n            end\n         end\n      end\n   elseif type(ObjSelected) == \"number\" then\n      if TRec(32, 32, 96, 64,TX, TY) ~= true then\n         local Object = ObjTab[ObjSelected]\n         print(Object[\"Size\"])\n         local Button = ButtonTapped(TX, TY)\n         --print(ObjSelected)\n         if Button == 1 then -- Tweak Mode\n            GT.TweakerTool(ObjSelected)\n            draw.tracktouches(GT.PoCuStart, GT.PopitHold, GT.PCTouch)\n            return\n         elseif Button == 2 then -- Attacher Mode\n            GT.LogicTool\n            draw.tracktouches(GT.PoCuStart, GT.PopitHold, GT.PCTouch)\n            return\n         end\n         if PopitClosed then\n            LTV = LTV - Object[\"TVal\"]\n            table.remove(ObjTab, ObjSelected)\n            PopitRes.DeleteSound\n         end\n         if not Grid then\n            Object[\"X\"] = TX + CamX\n            Object[\"Y\"] = TY - CamY\n         else\n            Object[\"X\"] = math.round((TX + CamX)\/Grid)*Grid\n            Object[\"Y\"] = math.round((TY - CamY)\/Grid)*Grid\n         end\n         ObjSelected = nil\n      end\n   elseif type(ObjSelected) == \"table\" then\n      if PopitClosed then\n         for k, v in ipairs(ObjSelected) do\n            LTV = LTV - ObjTab[k][\"TVal\"]\n            table.remove(ObjTab, k)\n         end\n         PopitRes.DeleteSound\n      end\n      ObjSelected = nil\n   end\nend\n\nfunction GT.PopitHold(TX, TY)\n   CamMove(TX, TY)\n   if type(ObjSelected) == \"number\" then\n      local Object = ObjTab[ObjSelected]\n      local SizeUp = TRec(32, 32, 64, 64,TX,TY)\n      local SizeDown = TRec(64, 32, 96, 64,TX,TY)\n      if SizeUp then\n         Object[\"Size\"] = Object[\"Size\"] + (Grid or 1)\n      elseif SizeDown then\n         if Object[\"Size\"] - (Grid or 1) > 0 then\n            Object[\"Size\"] = Object[\"Size\"] - (Grid or 1)\n         else\n            Object[\"Size\"] = math.round((Object[\"Size\"]\/Grid)*Grid)\n         end\n      end\n   elseif type(ObjSelected) == \"table\" then\n\n   else\n      if not TRec(PCStartX - 16, PCStartY - 16, PCStartX + 16, PCStartY + 16, TX, TY) then\n         PCEdgeX, PCEdgeY = TX + CamX, TY - CamY\n      else\n         PCEdgeX, PCEdgeY = nil, nil\n      end\n   end\nend\n\nfunction GT.PoCuStart(TX, TY)\n   PCStartX, PCStartY = TX + CamX, TY - CamY\nend\n\nfunction GT.PopitCursor\n   --print(\"Tag\")\n   Undo = false\n   ObjSelected = nil\n   draw.tracktouches(GT.PoCuStart, GT.PopitHold, GT.PCTouch)\n   for i=1, math.huge do\n      local OldTime = sys.gettime\n      GT.DrawCMFrame\n      draw.doevents\n      if ToolClosed then\n         return\n      end\n      collectgarbage\n      Sleep(OldTime)\n   end\nend\n\n-- Tweak Tool\n\nfunction GT.TweakStart(TX, TY)\n\nend\n\nfunction GT.TweakHold(TX, TY)\n   CamMove(TX, TY)\nend\n\nfunction GT.TweakTouch(TX, TY)\n   local PopitClosed = TRec(SizeX-64, 32, SizeX-32, 64, TX, TY)\n   if PopitClosed then\n      Back = true\n   end\nend\n\nfunction GT.TweakerTool(ObjSelected)\n   draw.tracktouches(GT.TweakStart, GT.TweakHold, GT.TweakTouch)\n   for i=1, math.huge do\n      local OldTime = sys.gettime\n      draw.beginframe\n      Draw.BGs.Default\n      Draw.Level\n      Draw.Thermometer(DrThV, 24, 24, 48, SizeY-48)\n      Draw.DPad(64, SizeY-96, PlayCol1, PlayCol2)\n      Draw.Popit.LaBg\n      Draw.Tweaker(ObjSelected)\n      local NewTime = sys.gettime\n      local Frame = (NewTime-OldTime)\n      --Draw.StatusBar(Frame)\n      draw.endframe\n\n      draw.doevents\n      if Back then\n         Back = false\n         return\n      end\n      collectgarbage\n      Sleep(OldTime)\n   end\nend\n\n-- Logic Tool\n\nfunction LogicAttachObject(TX, TY)\n   local Object = ObjTab[ObjSelected]\n   for k,v in pairs(ObjTab) do\n      if v[\"X\"] and v[\"Y\"] and v[\"Size\"] then\n         local ObjTap = TRec(v[\"X\"]- 16 -CamX, v[\"Y\"]- 16 +CamY, (v[\"X\"] + v[\"Size\"])+ 4-CamX, (v[\"Y\"] + v[\"Size\"])+ 4+CamY, TX, TY)\n         if ObjTap == true then\n            if k > 4 and v[\"Inputs\"] then\n               Object[\"Outputs\"][1][#Object[\"Outputs\"][1] + 1] = k\n               v[\"Inputs\"][#v[\"Inputs\"] + 1] = ObjSelected\n               PopitRes.PlaceSound\n            end\n         end\n      end\n   end\nend\n\n\nfunction GT.LTTouch(TX, TY)\n   local PopitClosed = TRec(SizeX-96, SizeY-96, SizeX-32, SizeY-32,TX,TY)\n   if ObjSelected then\n      local Button = ButtonTapped(TX, TY)\n      if PopitClosed then\n         ObjSelected = nil\n      elseif Button == 1 then\n         local Object = ObjTab[ObjSelected]\n         Object[\"Outputs\"] = { {} }\n      else\n         LogicAttachObject(TX, TY)\n      end\n   else\n      if PopitClosed then\n         Back = true\n         return\n      end\n      for k,v in pairs(ObjTab) do\n         if v[\"X\"] and v[\"Y\"] and v[\"Size\"] then\n            local ObjTap = TRec(v[\"X\"]- 16 -CamX, v[\"Y\"]- 16 +CamY, (v[\"X\"] + v[\"Size\"])+ 4-CamX, (v[\"Y\"] + v[\"Size\"])+ 4+CamY, TX, TY)\n            if ObjTap == true then\n               if v[\"Outputs\"] then\n                  ObjSelected = k\n                  PopitRes.PlaceSound\n               end\n            end\n         end\n      end\n   end\n   if ObjSelected == nil then\n      PopitRes.UnavailSound\n   end\nend\n\nfunction GT.LogicTool\n   Undo = false\n   draw.tracktouches(GT.PoCuStart, CamMove, GT.LTTouch)\n   if ObjTab[ObjSelected][\"Outputs\"] == nil then\n      ObjTab[ObjSelected][\"Outputs\"] = { {} }\n      PopitRes.PlaceSound\n   end\n   for i=1, math.huge do\n      if Back == true then\n         Back = nil\n         return\n      end\n      GT.DrawCMFrame(1)\n      draw.doevents\n      collectgarbage\n   end\nend","TSWRes Tutorials.lua":"print('Hello World!')","TSWRes CapturedObjects.lua":"if not TSW then require \"TSWRes Game\" end\n\nfunction GT.SaveObject(Object, Key)\n   GT.SaveObjectIcon(Object)\n   local ObjStr = JSON.EncodeJSON(Object)\n   local ObjSave = io.open(\"SavedData\/LBPLuaObj\"..(Key)..\".luaobj\", \"w\")\n   ObjSave:write(ObjStr)\n   ObjSave:close\n   GT.AddToCustomObjects(ObjStr, Key)\nend\n\nfunction GT.LoadObject(Object)\n   local ObjSave = io.open(\"SavedData\/LBPLuaObj\"..Object..\".luaobj\")\n   local Str = ObjSave:read\n   ObjSave:close\n   local Tab = {}\n   if Str then\n      return JSON.DecodeJSON(Str)\n   end\nend\n\nfunction table.clone(Table)\n   local NewTable = {}\n   for k, v in pairs(Table) do\n      if type(v) == \"table\" then\n         NewTable[k] = table.clone(v)\n      else\n         NewTable[k] = v\n      end\n   end\n   return NewTable\nend\n\nfunction GT.AddToCustomObjects(ObjStr, Key)\n   local CO = CapturedObjects[\"Objects\"]\n   CO[Key] = {\n      [\"Name\"] = \"Captured Object\",\n      [\"Description\"] = \"\",\n      [\"Creator\"] = \"Player\",\n      [\"Creators\"] = {},\n      [\"Size\"] = #ObjStr\n   }\n   local NewObjectTabJSON = JSON.EncodeJSON(CO)\n   local ObjSave = io.open(\"SavedData\/LBPLuaObj.luaobjtab\", \"w\")\n   ObjSave:write(NewObjectTabJSON)\n   ObjSave:close\n   local COT = CapturedObjects[\"ObjTabs\"]\n   COT[Key] = JSON.DecodeJSON(ObjStr)\nend\n\nfunction GT.DeleteObject(key)\n   local CO = CapturedObjects[\"Objects\"]\n   os.remove(\"SavedData\/LBPLuaObj\"..key..\".luaobj\")\n   table.remove(CO, key)\n   local NewObjectTabJSON = JSON.EncodeJSON(CO)\n   local ObjSave = io.open(\"SavedData\/LBPLuaObj.luaobjtab\", \"w\")\n   ObjSave:write(NewObjectTabJSON)\n   ObjSave:close\nend\n\nfunction GT.ResetObjects\n   local CO = CapturedObjects[\"Objects\"]\n   for i=1, #CapturedObjects[\"Objects\"] do\n      GT.DeleteObject(i)\n   end\n   os.remove(\"SavedData\/LBPLuaObj.luaobjtab\", \"w\")\nend\n\nfunction GT.LoadObjects\n   local ObjSave = io.open(\"SavedData\/LBPLuaObj.luaobjtab\")\n   local Str = \"{}\"\n   if ObjSave then\n      Str = ObjSave:read\n      ObjSave:close\n   end\n   CapturedObjects = {}\n   CapturedObjects[\"Objects\"] = JSON.DecodeJSON(Str) or {}\n   CapturedObjects[\"ObjTabs\"] = {}\n   local CO = CapturedObjects[\"Objects\"]\n   local COT = CapturedObjects[\"ObjTabs\"]\n   for i=1, #CapturedObjects[\"Objects\"] do\n      COT[i] = GT.LoadObject(i)\n   end\nend\n\nfunction GT.SaveObjectIcon(Object)\n\n\nend\n\nreturn","TSWRes Tool2.lua":"if not TSW then require \"TSWRes Game\" end\n\nfunction SEStickerSelTouch(Obj, TX, TY)\n   if not Obj[\"Stickers\"] then Obj[\"Stickers\"] = {} end\n   for k, v in ipairs(Obj[\"Stickers\"]) do\n      local StX = v[\"X\"] + Obj[\"X\"]\n      local StY = v[\"Y\"] + Obj[\"Y\"]\n      print(\"Sticker \"..k..\": \", \"StX: \"..StX, 'v[\"X\"]: '..v[\"X\"], 'Obj[\"X\"]: '..Obj[\"X\"], \"StY: \"..StY, 'v[\"Y\"]: '..v[\"Y\"], 'Obj[\"Y\"]: '..Obj[\"Y\"])\n      local Tapped = TRec(\n      StX - v[\"Size\"],\n      StY - v[\"Size\"],\n      StX + v[\"Size\"],\n      StY + v[\"Size\"],\n      TX + CamX, TY - CamY)\n      if Tapped then\n         StickerSelected = v\n         table.remove(Obj[\"Stickers\"], k)\n      end\n   end\nend\n\nfunction SCTouch(TX, TY)\n   local PopitClosed = TRec(SizeX-96, SizeY-96, SizeX-32, SizeY-32,TX,TY)\n   if PopitClosed then\n      ToolClosed = true\n      return\n   end\n   ObjSel(TX, TY)\n   if ObjSelected then\n      local Obj = ObjTab[ObjSelected]\n      local ObjSti = Obj[\"Stickers\"]\n      local X = ((Obj[\"X\"] + CamX) - (Obj[\"X\"]*2)) --(-(Obj[\"X\"]) + TX))\n      local Y = ((Obj[\"Y\"] - CamY) - (Obj[\"Y\"]*2)) --TY)\n      print(\"Place: \", \"X: \"..X, 'Obj[\"X\"]: '..Obj[\"X\"], \"CamX: \"..CamX, \"TX: \"..TX, \"Y: \"..Y, 'Obj[\"Y\"]: '..Obj[\"Y\"], \"CamY: \"..CamY, \"TY: \"..TY)\n      local Tag = {}\n      Tag[\"Sticker\"] = StickerSelected[\"Sticker\"] or StickerSelected\n      Tag[\"X\"] = -(TX + X)\n      Tag[\"Y\"] = (TY + Y)\n      Tag[\"Size\"] = StickerSelected[\"Size\"] or 16\n      if Tag[\"Size\"] <= 0 then\n         Tag[\"Size\"] = 16\n         print(Tag[\"Size\"])\n      end\n      ObjSti[#ObjSti+1] = Tag\n      PopitRes.SplatterSound\n      if PopitCuTool ~= \"Sticker Cursor\" then\n         StickerSelected = nil\n      else\n         --StickerSelected = nil\n         local Stick = ObjSti[\n      end\n      ObjSelected = nil\n   end\nend\n\nfunction SETouch(TX, TY)\n   --print(\"Touched \"..TX, TY)\n   assert(TX)\n   local PopitClosed = TRec(SizeX-96, SizeY-96, SizeX-32, SizeY-32,TX,TY)\n   if not StickerSelected then\n      if PopitClosed then\n         ToolClosed = true\n         return\n      end\n      ObjSel(TX, TY)\n      if ObjSelected then\n         local Obj = ObjTab[ObjSelected]\n         SEStickerSelTouch(Obj, TX, TY)\n         if StickerSelected then\n            PopitRes.SplatterSound\n         else\n            PopitRes.SplatterSound\n            PopitRes.UnavailSound\n         end\n         ObjSelected = nil\n      else\n         PopitRes.UnavailSound\n      end\n   else\n      if PopitClosed then\n         StickerSelected = nil\n         PopitRes.DeleteSound\n         return\n      end\n      SCTouch(TX, TY)\n   end\n   return TX, TY\nend\n\nfunction ToolRes.StickerCursor\n   PopitCuTool = \"Sticker Cursor\"\n   ObjSelected = nil\n   draw.tracktouches(Nil, CamMove, SCTouch)\n   for i=1, math.huge do\n      local OldTime = sys.gettime\n      GT.DrawCMFrame\n      draw.doevents\n      if ToolClosed then\n         return\n      end\n      Sleep(OldTime)\n   end\nend\n\nfunction ToolRes.StickerEditor\n   PopitCuTool = \"Sticker Editor\"\n   ObjSelected = nil\n   draw.tracktouches(Nil, CamMove, SETouch)\n   for i=1, math.huge do\n      local OldTime = sys.gettime\n      GT.DrawCMFrame\n      draw.doevents\n      if ToolClosed then\n         return\n      end\n      Sleep(OldTime)\n   end\nend\n\nfunction MCTouch(TX, TY)\n   --print(\"Touched \"..TX, TY)\n   assert(TX)\n   local PopitClosed = TRec(SizeX-96, SizeY-96, SizeX-32, SizeY-32,TX,TY)\n   if PopitClosed then\n      ToolClosed = true\n      return\n   end\n   ObjSel(TX, TY)\n   if ObjSelected then\n      local Obj = ObjTab[ObjSelected]\n      Obj[\"Mat\"] = SelectedMaterial\n      PopitRes.SplatterSound\n      ObjSelected = nil\n   else\n      PopitRes.UnavailSound\n   end\n   return TX, TY\nend\n\nfunction ToolRes.MaterialChanger\n   PopitCuTool = \"Material Changer\"\n   ObjSelected = nil\n   draw.tracktouches(Nil, CamMove, MCTouch)\n   for i=1, math.huge do\n      GT.DrawCMFrame\n      draw.doevents\n      if ToolClosed then\n         return\n      end\n   end\nend\n\nfunction WTTouch(TX, TY)\n   local PopitClosed = TRec(SizeX-96, SizeY-96, SizeX-32, SizeY-32,TX,TY)\n   if PopitClosed then\n      ToolClosed = true\n      return\n   end\n   LevelTab[\"WaterLevel\"] = TY - CamY\n   print(LevelTab[\"WaterLevel\"])\nend\n\nfunction ToolRes.WaterTool\n   PopitCuTool = \"Water Tool\"\n   draw.tracktouches(Nil, CamMove, WTTouch)\n   for i=1, math.huge do\n      local OldTime = sys.gettime\n      GT.DrawCMFrame\n      draw.doevents\n      if ToolClosed then\n         return\n      end\n      Sleep(OldTime)\n   end\nend\n\nfunction CapTouch(TX, TY)\n   local PopitClosed = TRec(SizeX-96, SizeY-96, SizeX-32, SizeY-32,TX,TY)\n   if PopitClosed then\n      ToolClosed = true\n      return\n   end\n   ObjSel(TX, TY)\n   if ObjSelected ~= nil then\n      PopitRes.DeleteSound\n      GT.SaveObject(ObjTab[ObjSelected], #CapturedObjects[\"Objects\"] + 1)\n      PopitRes.DeleteSound\n      ToolClosed = true\n      return\n   end\nend\n\nfunction ToolRes.CaptureTool\n   PopitCuTool = \"Capture Tool\"\n   draw.tracktouches(Nil, CamMove, CapTouch)\n   for i=1, math.huge do\n      GT.DrawCMFrame\n      draw.doevents\n      if ToolClosed then\n         return\n      end\n   end\nend\n\nfunction STTouch(TX, TY)\n   --print(\"Touched \"..TX, TY)\n   assert(TX)\n   local PopitClosed = TRec(SizeX-96, SizeY-96, SizeX-32, SizeY-32,TX,TY)\n   if PopitClosed then\n      ToolClosed = true\n      return\n   end\n   ObjSel(TX, TY)\n   if ObjSelected then\n      local Obj = ObjTab[ObjSelected]\n      Obj[\"Dynam\"] = not Obj[\"Dynam\"]\n      if Obj[\"Dynam\"] == true then\n         PopitRes.SplatterSound\n      else\n         PopitRes.DeleteSound\n      end\n      ObjSelected = nil\n   else\n      PopitRes.UnavailSound\n   end\n   return TX, TY\nend\n\nfunction ToolRes.StaticTool\n   PopitCuTool = \"Static Tool\"\n   ObjSelected = nil\n   draw.tracktouches(Nil, CamMove, STTouch)\n   for i=1, math.huge do\n      GT.DrawCMFrame\n      draw.doevents\n      if ToolClosed then\n         return\n      end\n   end\nend\n\nPopitRes.MaterialChanger = ToolRes.MaterialChanger\nPopitRes.StickerCursor = ToolRes.StickerCursor\nPopitRes.StickerEditor = ToolRes.StickerEditor\nPopitRes.WaterTool = ToolRes.WaterTool\nPopitRes.CaptureTool = ToolRes.CaptureTool\nPopitRes.StaticTool = ToolRes.StaticTool\n\nreturn","TSWRes StoryLevelWelcomeToLittleBigPlanet.lua":"print(\"Test\")","TSWRes Sandbox.lua":"-- The Sandbox Env that Lua Script Microchips run in.\nlocal Sandbox = {}\nSandbox.Env = {}\nlocal Env = Sandbox.Env\n\n-- run code under environment [Lua 5.2]\nfunction Sandbox.Load(untrusted_code)\n   local untrusted_function, message = load(untrusted_code, nil, 't', Sandbox.Env)\n   if not untrusted_function then return nil, message end\n   return true, untrusted_function\nend\n\n-- Prints everything in a table (T).\nfunction printTable(T)\n   print(\"PrintTable\", tostring(T))\n   for k, v in pairs(T) do\n      print(k, tostring(v))\n   end\nend\n\n-- Clones a Table.\nfunction cloneTable(Table)\n   local Clone = {}\n   for k, v in pairs(Table) do\n      if type(v) == \"table\" then\n         Clone[k] = cloneTable(v)\n      else\n         Clone[k] = v\n      end\n   end\n   return Clone\nend\n\n-- functions for if a script attempts to do something not allowed --\nfunction NotAllowedInSandbox\n   error(\"The script attempted to run a function not allowed in the LittleBigPlanet Lua Sandbox.\")\nend\n\nfunction NAISGlobEnv\n   print(\"Script attempted to escape to the global Env!\")\n   error(\"The script attempted to run a function not allowed in the LittleBigPlanet Lua Sandbox.\")\nend\n\n-- NAISGlobEnv\n\n-- Env Vars.\nEnv.assert = assert\nEnv.collectgarbage = NotAllowedInSandbox\nEnv.dofile = NAISGlobEnv\nEnv.error = error\nEnv.print = print\nEnv.printTable = printTable\nEnv._G = NAISGlobEnv\nEnv.getfenv = NAISGlobEnv\nEnv.getmetatable = NotAllowedInSandbox\nEnv.ipairs = ipairs\nEnv.load = NAISGlobEnv\nEnv.next = next\nEnv.pairs = pairs\nEnv.pcall = pcall\nEnv.rawequal = NotAllowedInSandbox\nEnv.rawget = NotAllowedInSandbox\nEnv.rawset = NotAllowedInSandbox\nEnv.setfenv = NAISGlobEnv\nEnv.setmetatable = NotAllowedInSandbox\nEnv.tonumber = tonumber\nEnv.tostring = tostring\nEnv.type = type\nEnv.unpack = unpack\nEnv._VERSION = _VERSION\nEnv.xpcall = xpcall\nEnv.module = NAISGlobEnv\nEnv.require = NAISGlobEnv\n\n-- now for the tables --\n\nEnv.coroutine = {}\nEnv.coroutine.yield = coroutine.yield\n\nEnv.package = {} -- all of this table is unsafe\n\nEnv.string = {}\n\nEnv.table = {}\nEnv.table.insert = table.insert\nEnv.table.maxn = table.maxn\nEnv.table.remove = table.remove\nEnv.table.sort = table.sort\nEnv.table.clone = cloneTable\n\nEnv.math = {}\nEnv.math.huge = math.huge\nEnv.math.rand = math.rand\n\nEnv.io = {}\n\nEnv.os = {}\nEnv.os.clock = os.clock\nEnv.os.difftime = os.difftime\nEnv.os.time = os.time\n\nEnv.debug = {} -- debug.* is unsafe\n\nEnv.LBPLua = {} -- Add LittleBigPlanet Lua Functions\nEnv.LBPLua.Ver = \"LBPLua Alpha 0.12\"\n\n-- The Env is set up. --\n--local RTable = cloneTable(Env)\n--printTable(_G)\n--print(\"Ok\")\n\nreturn Sandbox","TSWRes DrawServer.lua":"Draw.Server = {}\n\nfunction Draw.Server.Main\n  draw.clear(PlayCol1)\n   draw.fillrect(0, 0, SizeX - 128, SizeY, draw.white)\n   draw.stringinrect(PrintBox, 0, 0, SizeX - 128, SizeY, draw.black)\n   Draw.PodButton(\"Shutdown Server\", SizeX - 128, SizeY - 32, SizeX, SizeY, draw.blue)\n   if db then\n      local Pages = tonumber(db:exec(\"PRAGMA page_count;\"))\n      local Max = ServerPageLimit\n      draw.fillrect(SizeX - 128, 0, (SizeX - 128) + ((Pages\/Max)*128), 32, draw.white)\n   end\nend","TSWRes BGs1.lua":"-- CommunityBGs --\nif not TSW then require \"TSWRes Game\" end\n\n-- Community Intro\nfunction Draw.BGs.CommunityIntro\n   draw.clear(Col255(16, 16, 24))\n   draw.string(\"Welcome to the Community Moon!\", 69, 24, draw.white)\n   draw.string(\"Here you can go online and enter the community, \", 33, 63, draw.white)\n   draw.string(\"download and publish levels, make friends, and more!\", 33, 79, draw.white)\nend\n\nfunction Draw.BGs.CommunityIntro1\n   draw.clear(Col255(16, 16, 24))\n   draw.string(\"Features!\", 69, 24, draw.white)\n   draw.string(\"Search for Levels, Players, and Objects.\", 33, 63, draw.white)\n   draw.string(\"Check the recent activtity, add friends, and check the news.\", 33, 79, draw.white)\n   draw.string(\"Purchase Content from the store, and rate levels!\", 33, 90, draw.white)\n   draw.string(\"Check the LBP Picks. They are the best levels around.\", 33, 110, draw.white)\n  Stickers[\"LBPPick\"](32, 200, 32)\n\n   draw.string(\"Coming soon!\", 33, 256, draw.white)\nend\n\nfunction Draw.BGs.CommunityConnectProg\n   draw.clear(Col255(16, 16, 24))\n   draw.fillroundedrect(48, 48, SizeX-48, SizeY-48, 4, PlayCol1)\n   draw.line(48, 96, SizeX-48, 96, draw.white)\n   draw.setfont(\"Arial\", 22)\n   draw.string(\"Connecting to Community Moon...\"..Community.ConnectProg..\"%\", 48, 48, draw.white)\n   draw.setfont(\"Arial\", 16)\n   draw.string(Community.ConnectStage, 48, 98, draw.white)\n   Draw.ProgressBar(Community.ConnectProg\/100, 48, SizeY-120, (SizeX-(48)), SizeY-90)\nend\n\nfunction Draw.BGs.CommunityOfflineMenu\n   draw.clear(Col255(16, 16, 24))\n   Draw.Button(\"Back\", 24, SizeY - 64, 128, SizeY - 32, PlayCol1)\n   draw.fillroundedrect(24, 0, SizeX - 24, 96, 4, draw.gray)\n   draw.fillroundedrect(128, 0, SizeX - 24, 96, 4, Col255(128, 128, 255))\n   Draw.Button(\"Connect!\", 24, 64, 128, 96, PlayCol1)\n   Draw.Button(\"Me\", 24, 32, 128, 64, PlayCol1)\n   Draw.Button(\"Offline News\", 24, 0, 128, 32, PlayCol1)\n   if not Community.SavedFile then\n      CL = Community.SavedFile.SFJSON[\"CommunityLevels\"]\n      if CL then\n         DrCo.PlayerIcon(180, 48, 48, SavedFile.SFJSON[\"Icon\"])\n         if CL[\"Levels\"] > 0 then\n            Draw.Button(\"Levels\", 24, 64, 128, 96, PlayCol1)\n         end\n      end\n   end\nend\n\nfunction Draw.CInfoBox\n   draw.setfont(\"Arial\", 16)\n   local InfoBox = CommunityPage[\"InfoBox\"]\n   draw.fillrect(48, 48, SizeX-200, SizeY-48, PlayCol2)\n   for i=1, #InfoBox do\n      draw.string(InfoBox[i], 48, 48 + (16*(i-1)), draw.white)\n   end\nend\n\nfunction Draw.BGs.CommunityOnlineMenuHome\n   draw.clear(Col255(16, 98, 24))\n   draw.fillrect(SizeX-180, 0, SizeX, SizeY, PlayCol1)\n   Draw.CInfoBox\n   draw.setfont(\"Arial\", 24)\n   draw.string(\"Current News\", SizeX-180, 0, draw.white)\n   draw.string(\"Levels\", SizeX-180, HS, draw.white)\n   draw.string(\"Friends\", SizeX-180, HS*2, draw.white)\n   draw.string(\"Activity\", SizeX-180, HS*3, draw.white)\n   draw.string(\"Store\", SizeX-180, HS*4, draw.white)\n   draw.string(\"Sign Out\", SizeX-180, SizeY-HS, draw.white)\n   draw.setfont(\"Arial\", 16)\n   Draw.Button(\"\", 0, 0, 48, 48, PlayCol1)\n   Draw.Button(\"Signed in as \"..Community.Username, 48, 0, 256, 32, PlayCol1)\n   if SavedFile.SFJSON then\n      DrCo.PlayerIcon(64, 16, 16, SavedFile.SFJSON[\"Icon\"])\n   end\n   draw.line(0,0,48,48,draw.red)\n   draw.line(48,0,0,48,draw.red)\n   Draw.Button(\"Search\", 0, SizeY-32, 256, SizeY, PlayCol1)\nend\n\nfunction Draw.BGs.CommunityOnlineMenuHomeSO\n   draw.clear(Col255(16, 98, 24))\n   draw.fillrect(SizeX-180, 0, SizeX, SizeY, PlayCol1)\n   Draw.CInfoBox\n   draw.setfont(\"Arial\", 24)\n   draw.string(\"Current News\", SizeX-180, 0, draw.white)\n   draw.string(\"Levels\", SizeX-180, 48, draw.white)\n   draw.string(\"Activity\", SizeX-180, 48*2, draw.white)\n   draw.string(\"Sign In\", SizeX-180, SizeY-96, draw.white)\n   draw.string(\"Register\", SizeX-180, SizeY-48, draw.white)\n   draw.setfont(\"Arial\", 16)\n   Draw.PodButton(\"\", 0, 0, 48, 48, PlayCol1)\n   Draw.PodButton(\"Signed Out\", 48, 0, 256, 32, PlayCol1)\n   draw.line(0,0,48,48,draw.red)\n   draw.line(48,0,0,48,draw.red)\nend\n\nfunction Draw.BGs.PlayIconsMenu\n   draw.clear(Col255(128, 164, 255))\n   draw.fillroundedrect(32, 32, SizeX-32, SizeY-32, 4, draw.black)\n   Draw.Button(\"\", 32, 32, 64, 64, PlayCol1)\n   draw.line(32,32,64,64,draw.red)\n   draw.line(64,32,32,64,draw.red)\n   Draw.PrintPlayIcons(PlayIcons, 32, 64, SizeX-64,SizeY-32)\nend\n\nfunction Draw.BGs.CommunityOnlineMenuNews\n   draw.clear(Col255(16, 98, 24))\n   draw.fillrect(SizeX-360, 0, SizeX, SizeY, PlayCol1)\n   draw.string(\"News:\", SizeX-360, 16, draw.white)\n   Draw.PodButton(\"Back\", 0, 0, 48, 48, PlayCol1)\nend\n\nfunction Draw.BGs.CommunityOnlineMenuLevels\n   draw.clear(Col255(16, 98, 24))\n   draw.fillrect(SizeX-180, 0, SizeX, SizeY, PlayCol1)\n   draw.string(\"Levels:\", SizeX-180, 16, draw.white)\n   Draw.Button(\"Back\", 0, 0, 48, 48, PlayCol1)\n   Draw.Button(Community.Username, 48, 0, 180, 32, PlayCol1)\n   Draw.Button(\"Levels\", 180, 0, 256, 32, PlayCol1)\nend\n\n-- End of Community BGs --\n\nreturn","TSWRes DrawPopit.lua":"if not TSW then require \"TSWRes Game\" end\nfunction Draw.PopitMenuPages\n   local PMPages = PopitRes.PMPages\n   local FillColor = PlayCol1\n   --PMPages[PopitCurMen]\n   Draw.PodButton(\"<\", SizeX-(32*6), SizeY-64, SizeX-(32*5), SizeY-32, FillColor)\n   Draw.PodButton(\">\", SizeX-64, SizeY-64, SizeX-32, SizeY-32, FillColor)\nend","TSWInstallerFile.lua":"--\n\n\n\n","TSWRes BGs2.lua":"-- Story BGs --\nif not TSW then require \"TSWRes Game\" end\n\n-- Story Menu\nfunction Draw.BGs.StoryMainMenu\n   draw.clear(Col255(200, 0, 200))\n   draw.setfont(\"Arial\", 48)\n   draw.string(\"Story\", 0, 0, draw.black)\n   draw.setfont(\"Arial\", 16)\n   Draw.Button(\"Back\", 24, SizeY - 64, 128, SizeY - 32, PlayCol1)\n   Draw.Button(\"Levels\", 24, 64, 128, 96, PlayCol1)\n   Draw.Button(\"Prizes\", 24, 96, 128, 128, PlayCol1)\n   Draw.ProgressBar(StoryRes.StoryProg\/100, 128, SizeY-64, (SizeX-(48)), SizeY-32, draw.black)\nend\n\n-- Story Worlds\nfunction Draw.StoryWorlds(Scroll)\n   local StartY = 32\n   draw.setfont(\"Arial\", 48)\n   for k, v in ipairs(Strings.Story.Planets) do\n\n      draw.fillrect(0, StartY + ((k - 1)*48) + Scroll, SizeX - 32, StartY + (k*48) + Scroll, Col255(100, 0, 100))\n      draw.rect(0, StartY + ((k - 1)*48) + Scroll, SizeX - 32, StartY + (k*48) + Scroll, draw.black)\n      draw.string(v, 48, StartY + ((k - 1)*48) + Scroll, draw.black)\n   end\n   draw.setfont(\"Arial\", 16)\nend\n\nfunction Draw.BGs.StoryWorldsMenu(Scroll)\n   draw.clear(Col255(200, 0, 200))\n   Draw.StoryWorlds(Scroll)\n   draw.fillrect(0, SizeY - 64, SizeX, SizeY, Col255(180, 20, 180))\n   Draw.Button(\"Back\", 24, SizeY - 64, 128, SizeY - 32, PlayCol1)\nend\n\n-- Story Levels\nfunction Draw.BGs.StoryLevelMenu(World)\n\n\n\nend\n\n\nreturn","TSWRes HTTP.lua":"http = {}\nfunction http.load(URL)\n\n   if Community.ConnectURL ..Community.SignOutURL then\n      return \"Signed Out\"\n   end\nend\n\nhttp.load(Community.ConnectURL ..Community.SignOutURL)\n\nrequire \"TSWRes HTTP Browser\"\nreturn http","TSWRes Draw3.lua":"-- Status Bar --\nif not TSW then require \"TSWRes Game\" end\n\nlocal function StrIfTrueElse(Boolean, StrT, StrF)\n   if Boolean == true then\n      return StrT\n   end\n   return StrF\nend\n\nlocal function UHOH(Overhead)\n   local Neg = true\n   Overhead = tonumber((1\/FR)-Overhead)\n   if tonumber(Overhead) >=0 then\n      Neg = false\n   end\n   local OveStr=StrIfTrueElse(Neg, \"overhead\", \"underhead\")\n   local OverStr=string.sub(tostring(math.abs(Overhead)),1, 6)\n   local RetStr = (\"(\"..(OverStr)..\"s \"..OveStr..\")\")\n   return RetStr\nend\n\nfunction Draw.StatusBar(FS, DrawTime, ColTime)\n   if DrawStatusBar then\n      local FSSub = string.sub(tostring(FS), 1, 7)\n      local OS = string.sub(tostring(FS*(1\/FR)), 1, 7)\n      local StatStr = \"Frame: \"..FSSub..\"s \"..UHOH(FS)\n      local StatStr2 = \"LTV: \"..LTV..\"\/\"..MT..\" (\"..LTV\/MT..\")\"\n      local DrawStr, ColStr = \"\", \"\"\n      if DrawTime then\n         DrawStr = \"Draw: \"..Math.Fix(DrawTime, 4)..\"s\"\n      end\n      if ColTime then\n         ColStr = \"Collision: \"..Math.Fix(ColTime, 4)..\"s\"\n      end\n      draw.string(StatStr, 24, SizeY - 24, draw.black)\n      draw.string(DrawStr, 24, SizeY - 48, draw.black)\n      draw.string(ColStr, 24, SizeY - 64, draw.black)\n      draw.string(StatStr2, SizeX - 200, 16, draw.black)\n      draw.string(\"RAM: \"..ObjRes.BytesPlus(collectgarbage(\"count\")*1024), SizeX - 200, 32, draw.black)\n      draw.string(\"Objects: \"..#ObjTab, SizeX - 200, 48, draw.black)\n      draw.string(\"Water Level: \"..LevelTab[\"WaterLevel\"] or 0, SizeX - 200, 64, draw.black)\n      draw.string(\"CamPos: \"..math.floor(CamX)..\", \"..math.floor(CamY), SizeX - 200, 80, draw.black)\n      if ObjTab[6] then\n         draw.string(\"Vol: \"..math.floor(ObjTab[6][\"XVol\"])..\", \"..math.floor(ObjTab[6][\"YVol\"]), SizeX - 200, 96, draw.black)\n      end\n   end\nend","TSWRes Objects1.lua":"-- Placeholder for additinal Objects.\nif not TSW then require \"TSWRes Game\" end\n\nfunction ObjRes.StartGate(CorTab, X, Y, Size, RotRad, Mat, k)\n   draw.line(X+(Size*.8), Y+Size, X+(Size*.8), Y-Size, draw.black)\n   draw.fillrect(X, Y-(Size*.7), X+(Size*.8), Y-(Size*.2), draw.gray)\n   draw.fillcircle(X+(Size*.8), Y-Size, Size*.3, draw.white)\n   draw.fillrect(X+(Size*.65), Y+(Size*.7), X+(Size*.95), Y+Size, draw.brown)\n   draw.fillrect(X-Size, Y+(Size*.96), X+Size, Y+Size, draw.brown)\nend\n\nfunction ObjRes.FinishGate(CorTab, X, Y, Size, RotRad, Mat, k)\n   draw.line(X+(Size*.3), Y+Size, X+(Size*.3), Y-Size, draw.black)\n   draw.fillrect(X, Y-(Size*.7), X+(Size*.8), Y-(Size*.2), draw.gray)\n   draw.fillcircle(X+(Size*.3), Y-Size, Size*.3, draw.white)\n   draw.fillrect(X+(Size*.15), Y+(Size*.7), X+(Size*.35), Y+Size, draw.brown)\n   draw.fillrect(X-(Size*.4), Y+(Size*.96), X+(Size*.4), Y+Size, draw.brown)\nend\n\nfunction ObjRes.ClosePost(CorTab, X, Y, Size, RotRad, Mat, k)\n\nend\n\nfunction ObjRes.ScoreBubble(CorTab, X, Y, Size, RotRad, Mat, k)\n   local fillcircle = draw.fillcircle\n   fillcircle(X, Y, Size, draw.white)\n   fillcircle(X, Y, Size*.9, PlayCol1T)\n   fillcircle(X, Y, Size*.8, PlayCol1T)\n   fillcircle(X, Y, Size*.7, PlayCol1T)\n   fillcircle(X, Y, Size*.6, PlayCol1T)\n   fillcircle(X, Y, Size*.5, PlayCol1T)\nend\n\nfunction ObjRes.Spikes(CorTab, X, Y, Size, RotRad, Mat, k)\n   draw.filltriangle(X + (Size*.6), Y + (Size*.3), X + (Size*.4), Y - (Size*.3), X + (Size*.2), Y + (Size*.3), draw.white)\n   draw.filltriangle(X - (Size*.2), Y + (Size*.3), X, Y - (Size*.3), X + (Size*.2), Y + (Size*.3), draw.white)\n   draw.filltriangle(X - (Size*.6), Y + (Size*.3), X - (Size*.4), Y - (Size*.3), X - (Size*.2), Y + (Size*.3), draw.white)\n   draw.fillrect(X - (Size), Y + (Size*.3), X + (Size), Y + (Size*.4), draw.brown)\nend\n\nfunction ObjRes.Button(CorTab, X, Y, Size, RotRad, Mat, k)\n   draw.fillrect(X - (Size*.8), Y - (Size*.2), X + (Size*.8), Y+(Size*.1), draw.red)\n   draw.fillrect(X - (Size), Y, X + (Size), Y + (Size*.2), draw.black)\n   if k then\n      if ObjTab[k] then\n         local Object = ObjTab[k]\n         if Object[\"Outputs\"] then\n            for k2, v in ipairs(Object[\"Outputs\"][1]) do\n               if ObjTab[v] then\n                  local Object2 = ObjTab[v]\n                  local X2, Y2 = (Object2[\"X\"] - CamX), (Object2[\"Y\"] + CamY)\n                  draw.line(X, Y, X2, Y2, draw.green)\n               end\n            end\n         end\n      end\n   end\nend\n\n\nfunction ObjRes.TriggerExp(CorTab, X, Y, Size, RotRad, Mat, k)\n\nend\n\nfunction ObjRes.ImpactExp(CorTab, X, Y, Size, RotRad, Mat, k)\n   draw.fillcircle(X, Y, Size, draw.black)\nend\n\nfunction ObjRes.Scoreboard(CorTab, X, Y, Size, RotRad, Mat, k)\n   draw.fillrect(X-(Size*.3), Y+(Size*.80), X+(Size*.3), Y+Size, draw.brown)\n   draw.fillrect(X-Size, Y+(Size*.96), X+Size, Y+Size, draw.brown)\n   draw.rect(X-Size, Y+(Size*.96), X+Size, Y+Size, draw.black)\n   draw.fillrect(X-Size, Y-(Size), X+Size, Y+(Size*.80), draw.brown)\n   draw.fillrect(X-(Size*.9), Y-(Size*.9), X+(Size*.9), Y+(Size*.7), draw.black)\n   if LvDone and LvDoneScKey == k then\n      draw.fillcircle(X, Y, math.min(TimeTotal-TimeTillMenu, 24), PlayCol1)\n      draw.stringinrect(FinalScore, X - 24, Y - 8, X + 24, Y + 8, draw.white)\n   end\nend\n\nfunction ObjRes.BouncePad(CorTab, X, Y, Size, RotRad, Mat, k)\n   draw.fillrect(X - (Size*.8), Y - (Size*.2), X + (Size*.8), Y + (Size*.2), draw.white)\n   draw.fillrect(X - (Size), Y - (Size*.1), X + (Size), Y - (Size*.3), draw.lightgray)\n   draw.fillrect(X - (Size), Y + (Size*.1), X + (Size), Y + (Size*.3), draw.lightgray)\nend\n\nfunction ObjRes.MagicMouth(CorTab, X, Y, Size, RotRad, Mat, k)\n\nend\n\n\nreturn","TSWRes Game5.lua":"if not TSW then require \"TSWRes Game\" end\n-- Settings Menus --\nfunction GT.DisplaySettings\n   for i=1, math.huge do\n      draw.beginframe\n      Draw.BGs.DisplaySettings\n      draw.endframe\n      local TX, TY = draw.waittouch\n      local BackTap = TRec(24, SizeY - 64, 128, SizeY - 32, TX, TY)\n      if BackTap then\n         return\n      end\n   end\nend\n\n-- Save Management --\nfunction GT.GetSaveDetails\n   local Table = {}\n   Table[\"SizeTaken\"] = {}\n   local MyMoonSize = 0\n   for k, v in ipairs(MyMoonLevels[\"SavedLevelTab\"]) do\n      MyMoonSize = MyMoonSize + v[\"Size\"]\n   end\n   Table[\"SizeTaken\"][\"MyMoonSize\"] = MyMoonSize\n   local CapturedObjectsSize = 0\n   for k, v in ipairs(CapturedObjects[\"Objects\"]) do\n      CapturedObjectsSize = CapturedObjectsSize + v[\"Size\"]\n   end\n   Table[\"SizeTaken\"][\"CapturedObjects\"] = CapturedObjectsSize\n   Table[\"SizeTaken\"][\"Community\"] = FS2.size(\"SavedData\/LBPCommunitySave.JSON\")\n   Table[\"SizeTaken\"][\"MyProfileSize\"] = FS2.size(\"SavedData\/LBPProfileSave.JSON\")\n   local SizeBytes = 0\n   for k, v in pairs(Table[\"SizeTaken\"]) do\n      SizeBytes = SizeBytes + v\n   end\n   Table[\"TotalSize\"] = SizeBytes\n   return Table\nend\n\nfunction GT.SaveManagement\n   GT.SaveDetails = GT.GetSaveDetails\n   for i=1, math.huge do\n      draw.beginframe\n      Draw.BGs.SaveManagement\n      draw.endframe\n      local TX, TY = draw.waittouch\n      local BackTap = TRec(24, SizeY - 64, 128, SizeY - 32, TX, TY)\n      local DeleteTap = TRec(24, SizeY - 96, 128, SizeY - 64, TX, TY)\n      if BackTap then\n         return\n      elseif DeleteTap then\n         if GT.YesNo(\"RESET your profile?\", \"You will lose any progress made, including levels, objects, story, the Community, and also your customizations. Are you sure you want to do this?\", draw.red, PlayCol1, \"This is exactly that I want to do.\", \"I want to keep my progress.\") then\n           if GT.YesNo(\"This action will restart the game, continue?\", \"If you continue, you may lose your progress temporarily or permanently!\", draw.red, PlayCol1, \"Yes\", \"No\") then\n               FS2.rmDir(\"SavedData\")\n               GT.NewProfile\n            end\n         end\n      end\n   end\nend\n\n\nfunction GT.PodMenu\n\nend\n\n-- End of File.","TSWRes ObjectsSackboyMouth.lua":"function ObjRes.SackboyMouth(BellyCol, X, Y, Size, RotRad, Mat, k, black)\n   local SE = Emotion\n   if SE == \"Basic\" then -- Nope, no Emotion\n      draw.line(X-(16*Size), Y-(8*Size), X+(16*Size), Y-(8*Size), black)\n   elseif SE == \"Cheerful\" then\n      local Y1, Y2, Y3 = 9.6, 4.75, 2.2\n      -- Top Portion\n      draw.line(X - (16*Size), Y - (Y1*Size), X, Y - (9*Size), black)\n      draw.line(X, Y - (9*Size), X + (16*Size), Y - (Y1*Size), black)\n      -- Bottom Portion\n      draw.line(X - (16*Size), Y - (Y1*Size), X - (10*Size), Y - (Y2*Size), black)\n      draw.line(X - (10*Size), Y - (Y2*Size), X, Y - (Y3*Size), black)\n      draw.line(X, Y - (Y3*Size), X + (10*Size), Y - (Y2*Size), black)\n      draw.line(X + (10*Size), Y - (Y2*Size), X + (16*Size), Y - (Y1*Size), black)\n   elseif SE == \"Happy\" then\n      local Y1, Y2, Y3, Y4 = 11, 5.3, 2.1, 9.2\n      -- Top Portion\n      draw.line(X - (16*Size), Y - (Y1*Size), X, Y - (Y4*Size), black)\n      draw.line(X, Y - (Y4*Size), X + (16*Size), Y - (Y1*Size), black)\n      -- Bottom Portion\n      draw.line(X - (16*Size), Y - (Y1*Size), X - (10*Size), Y - (Y2*Size), black)\n      draw.line(X - (10*Size), Y - (Y2*Size), X, Y - (Y3*Size), black)\n      draw.line(X, Y - (Y3*Size), X + (10*Size), Y - (Y2*Size), black)\n      draw.line(X + (10*Size), Y - (Y2*Size), X + (16*Size), Y - (Y1*Size), black)\n   elseif SE == \"Ecstatic\" then\n      local Y1, Y2, Y3, Y4 = 11.4, 5.4, 1.8, 9.3\n      -- Top Portion\n      draw.line(X - (16*Size), Y - (Y1*Size), X, Y - (Y4*Size), black)\n      draw.line(X, Y - (Y4*Size), X + (16*Size), Y - (Y1*Size), black)\n      -- Bottom Portion\n      draw.line(X - (16*Size), Y - (Y1*Size), X - (10*Size), Y - (Y2*Size), black)\n      draw.line(X - (10*Size), Y - (Y2*Size), X, Y - (Y3*Size), black)\n      draw.line(X, Y - (Y3*Size), X + (10*Size), Y - (Y2*Size), black)\n      draw.line(X + (10*Size), Y - (Y2*Size), X + (16*Size), Y - (Y1*Size), black)\n      draw.fillrect(X - (5*Size), Y - (Y4*Size), X - (1*Size), Y - ((Y3*.5)*Size), draw.purple)\n   end\nend\n\nreturn","TSWInstallerGen.lua":"local Table = {}\nlocal Images = {}\nfunction CopyToTable(Tab, FileName)\n   local FileHandle = io.open(FileName)\n   if not FileHandle then return end\n   local String = FileHandle:read(\"*a\")\n   FileHandle:close\n   return String\nend\n\nfor k, v in ipairs(sys.dir) do\n   if v ~= \".\" and v ~= \"..\" and v ~= \"TSWInstallerGen\" then\n      Table[v] = CopyToTable(Table, v)\n   end\nend\n\nfor k, v in ipairs(sys.dir(\"Images\/PictureDrawFunctions\")) do\n   if v ~= \".\" and v ~= \"..\" then\n      Images[v] = CopyToTable(Images, \"Images\/PictureDrawFunctions\/\"..v)\n   end\nend\n\nlocal ImageGen = \"\"\nlocal ImageGenLoc = \"Images\/ARegeneratePictures.lua\"\n\nfunction CopyFile(Location)\n   local FileHandle = io.open(Location)\n   if not FileHandle then return end\n   local String = FileHandle:read(\"*a\")\n   FileHandle:close\n   return String\nend\n\nImageGen = CopyFile(ImageGenLoc)\n\nlocal FileSize = 0\n\nfor k, v in pairs(Table) do\n   print(k, #v..\" bytes\")\n   FileSize = FileSize + #v\nend\n\nfor k, v in pairs(Images) do\n   print(k, #v..\" bytes\")\n   FileSize = FileSize + #v\nend\n\nprint(\"Ready to generate Installer...\")\nprint(\"Size of Files: \"..FileSize)\n\nlocal InstallerBeginning = \n--\n\n\n\n\n\nJSON = require \"JSON\"\nFileString = JSON.EncodeJSON(Table)\nFileString2 = JSON.EncodeJSON(Images)\n\nfunction GenerateFile\n   print(\"Creating Installer File...\")\n   local FileHandle = io.open(\"TSWInstaller.lua\", \"w\")\n   FileHandle:write(InstallerBeginning)\n   FileHandle:close\n   FileHandle = io.open(\"TSWInstallerFile1.lua\", \"w\")\n   FileHandle:write(FileString)\n   FileHandle:close\n   FileHandle = io.open(\"TSWInstallerFile2.lua\", \"w\")\n   FileHandle:write(FileString2)\n   FileHandle:close\nend\nGenerateFile\n\n\n-- End of File.","TSWRes Col255MetaTable.lua":"local mt = {\n   __add = function (lhs, rhs) -- \"add\" event handler\n      if not lhs[1] then error(\"Missing values in lhs\") end\n      local Tab = {}\n      print(type(rhs))\n      if type(rhs) == \"table\" then\n         Tab[1] = lhs[1] + rhs[1]\n         Tab[2] = lhs[2] + rhs[2]\n         Tab[3] = lhs[3] + rhs[3]\n         if lhs[4] then Tab[4] = lhs[4] + rhs[4] end\n         return Tab\n      else\n         assert(type(tonumber(rhs)) == \"number\", \"rhs could not be converted to number\")\n         print(lhs[1])\n         Tab[1] = lhs[1] + tonumber(rhs)\n         Tab[2] = lhs[2] + tonumber(rhs)\n         Tab[3] = lhs[3] + tonumber(rhs)\n         if lhs[4] then Tab[4] = lhs[4] + tonumber(rhs) end\n         return Tab\n      end\n   end,\n   __sub = function (lhs, rhs) -- \"sub\" event handler\n      local Tab = {}\n      print(type(rhs))\n      if type(rhs) == \"table\" then\n         Tab[1] = lhs[1] - rhs[1]\n         Tab[2] = lhs[2] - rhs[2]\n         Tab[3] = lhs[3] - rhs[3]\n         if Tab[4] then Tab[4] = lhs[4] - rhs[4] end\n         return Tab\n      else\n         assert(type(tonumber(rhs)) == \"number\", \"rhs could not be converted to number\")\n         Tab[1] = lhs[1] - tonumber(rhs)\n         Tab[2] = lhs[2] - tonumber(rhs)\n         Tab[3] = lhs[3] - tonumber(rhs)\n         if Tab[4] then Tab[4] = lhs[4] - tonumber(rhs) end\n         return Tab\n      end\n   end,\n   __mul = function (lhs, rhs) -- \"mul\" event handler\n      local Tab = {}\n      print(type(rhs))\n      if type(rhs) == \"table\" then\n         Tab[1] = lhs[1] * rhs[1]\n         Tab[2] = lhs[2] * rhs[2]\n         Tab[3] = lhs[3] * rhs[3]\n         if Tab[4] then Tab[4] = lhs[4] * rhs[4] end\n         return Tab\n      else\n         assert(type(tonumber(rhs)) == \"number\", \"rhs could not be converted to number\")\n         Tab[1] = lhs[1] * tonumber(rhs)\n         Tab[2] = lhs[2] * tonumber(rhs)\n         Tab[3] = lhs[3] * tonumber(rhs)\n         if Tab[4] then Tab[4] = lhs[4] * tonumber(rhs) end\n         return Tab\n      end\n   end,\n   __div = function (lhs, rhs) -- \"div\" event handler\n      local Tab = {}\n      print(type(rhs))\n      if type(rhs) == \"table\" then\n         Tab[1] = lhs[1] \/ rhs[1]\n         Tab[2] = lhs[2] \/ rhs[2]\n         Tab[3] = lhs[3] \/ rhs[3]\n         if Tab[4] then Tab[4] = lhs[4] \/ rhs[4] end\n         return Tab\n      else\n         assert(type(tonumber(rhs)) == \"number\", \"rhs could not be converted to number\")\n         Tab[1] = lhs[1] \/ tonumber(rhs)\n         Tab[2] = lhs[2] \/ tonumber(rhs)\n         Tab[3] = lhs[3] \/ tonumber(rhs)\n         if Tab[4] then Tab[4] = lhs[4] \/ tonumber(rhs) end\n         return Tab\n      end\n   end\n}\n\nreturn mt\n\n","TSWRes Community.lua":"if not TSW then require \"TSWRes Game\" end\nCommunity = {}\n\nCommunity.SavedFile= {}\nSavedFile = Community.SavedFile\nlocal SavedFile = Community.SavedFile\nSavedFile[\"CommunityLevels\"] = {}\nSFJSON = SavedFile.SFJSON\n\nCommunity.ConnectURL = \"http:\/\/sacktanklua.wikia.com\/\"\nCommunity.SignInURL = \"wiki\/Special:UserLogin\"\nCommunity.SignOutURL = \"wiki\/Special:UserLogout\"\nCommunity.SignUpURL = \"wiki\/Special:UserSignup\"\nCommunity.PageStart = \"CommunityScriptStart\"\n\nHS = 32\n\nprint(http)\nlocal http\nif not http then\n   http = require \"TSWRes HTTP\"\nend\nKey = require \"TSKeyboard\"\n\nCommunity.Username = \"Guest\"\nCommunityPage = {}\nCommunityPage[\"InfoBox\"] = {}\n\nlocal InfoBox = CommunityPage[\"InfoBox\"]\nInfoBox[1]=\"If you see this, you are not\"\nInfoBox[2]=\"connected!\"\n\nfunction Community.LoadFile\n   if not FS.exists(\"SavedData\/LBPCommunitySave.data\") then\n      Community.ShowIntro = true\n      Community.FirstUse = true\n      SavedFile.SFJSON = {}\n      SavedFile.SFJSON[\"Icon\"] = \"Blue Square\"\n      return true, \"No file found\"\n   end\n   local SavedFile = Community.SavedFile\n   local FileHandle = io.open(\"SavedData\/LBPCommunitySave.data\")\n   if not FileHandle then\n      Community.ShowIntro = true\n      Community.FirstUse = true\n      SavedFile.SFJSON = {}\n      SavedFile.SFJSON[\"Icon\"] = \"Blue Square\"\n      return false, \"Failed to load file\"\n   end\n   Community.ShowIntro = FileHandle:read\n   if Community.ShowIntro==\"1\" then\n      Community.ShowIntro = true\n   end\n   FileHandle:close\n   SavedFile.SFJSON = {}\n   SFJSON = SavedFile.SFJSON\n   SFJSON[\"CommunityLevels\"] = {}\n   local CL = SFJSON[\"CommunityLevels\"]\n   CL[\"Levels\"]=0\n   CL[\"SavedLevelTab\"] = {}\n   print(CL)\n   if not FS.exists(\"SavedData\/LBPCommunitySave.JSON\") then\n      return true, \"No JSON file found\"\n   end\n   local FileHandle2 = io.open(\"SavedData\/LBPCommunitySave.JSON\")\n   if FileHandle2 then\n      local SFS = FileHandle2:read\n      print(SFS)\n      FileHandle2:close\n      if type(SFS) == \"string\" then\n         SavedFile.SFJSON = JSON.DecodeJSON(SFS)\n         if type(SavedFile.SFJSON) == \"string\" then\n            print(SFJSON)\n            return false, \"error loading JSON\"\n         elseif type(SavedFile.SFJSON) ~= \"table\" then\n            print(\"Error while loading Community\")\n            return false, \"error loading JSON\"\n         end\n         --CL[\"Levels\"]=0\n         --CL[\"SavedLevelTab\"] = {}\n         local SLTab = CL[\"SavedLevelTab\"]\n         if not CL[\"SavedLevelTab\"] then\n            print(\"error detected while loading Community Levels\")\n            return false, \"Community Levels error\"\n         end\n         for k, v in ipairs(CL[\"SavedLevelTab\"]) do\n            v[\"Size\"] = GT.LevelSize(k)\n            if not ok then\n               --table.remove( MyMoonLevels[\"SavedLevelTab\"], k)\n            end\n         end\n      else\n         return true, \"error\"\n      end\n   else\n      SavedFile.SFJSON = {}\n      local SFJSON = SavedFile.SFJSON\n      SFJSON[\"CommunityLevels\"] = {}\n      local CL = SFJSON[\"CommunityLevels\"]\n      CL[\"Levels\"]=0\n      CL[\"SavedLevelTab\"] = {}\n      return false, \"Community JSON File is unloadable\"\n   end\n   print(\"Community Savefile Loaded\")\n   return true\nend\n\nfunction Community.Intro\n   draw.beginframe\n   Draw.BGs.CommunityIntro\n   draw.endframe\n   draw.waittouch\n   draw.beginframe\n   Draw.BGs.CommunityIntro1\n   draw.endframe\n   draw.waittouch\nend\n\nfunction Community.Disconnect\n   Community.SignOut\n   Community.Connected = false\nend\n\nfunction Community.Connect\n   Community.ConnectProg = 0\n   Community.ConnectStage = \"Connecting to the Community Moon...\"\n   draw.beginframe\n   Draw.BGs.CommunityConnectProg\n   draw.endframe\n   SX, SY = draw.getport\n   local ConnectTest = http.load(Community.ConnectURL)\n   Community.Connected = true\n   return true\nend\n\nfunction Community.Connect2\n   -- Moderate\n   Community.ConnectProg = 20\n   Community.ConnectStage = \"Moderating...\"\n   draw.beginframe\n   Draw.BGs.CommunityConnectProg\n   draw.endframe\n   print(\"Moderating\")\n   -- Download Community Data\n   --sleep(1000)\n   Community.ConnectProg = 40\n   Community.ConnectStage = \"Downloading Community Data...\"\n   draw.beginframe\n   Draw.BGs.CommunityConnectProg\n   draw.endframe\n   print(\"Downloading Community Data\")\n   -- Upload Offline Data\n   --sleep(1000)\n   Community.ConnectProg = 60\n   Community.ConnectStage = \"Uploading Offline Data...\"\n   draw.beginframe\n   Draw.BGs.CommunityConnectProg\n   draw.endframe\n   print(\"Uploading Offline Data\")\n   -- Almost done\n   --sleep(1000)\n   Community.ConnectProg = 80\n   Community.ConnectStage = \"Almost done...\"\n   draw.beginframe\n   Draw.BGs.CommunityConnectProg\n   draw.endframe\n   --sleep(1000)\n   Community.FullyConnected = true\n   return true\nend\n\nfunction Community.SignIn\n   local Resp = http.load(Community.ConnectURL ..Community.SignInURL)\n   local UserName, Password\n   --if Resp == \"Sign in\" then\n   UserName = Key.Keyboard(\"Username\")\n   Password = Key.Keyboard(\"Password\")\n   --end\n   Community.Username = UserName\n   Community.SignedIn = true\n   return true\nend\n\nfunction Community.SignOut\n   http.load(Community.ConnectURL ..Community.SignOutURL)\n   Community.Username = \"Guest\"\n   Community.SignedIn = false\nend\n\nfunction Community.SaveFile\n   local FileHandle = io.open(\"SavedData\/LBPCommunitySave.data\", \"w\")\n   FileHandle:write(\"0\")\n   FileHandle:close\n   local FileHandle2 = io.open(\"SavedData\/LBPCommunitySave.JSON\", \"w\")\n   local SaveString = JSON.EncodeJSON(SavedFile.SFJSON)\n   print(SaveString)\n   FileHandle2:write(SaveString)\n   FileHandle2:close\nend\n\nfunction Community.Download(Level)\n\nend\n\nfunction Community.FirstConnect\n   print(\"This is your first time connecting to the servers.\")\n   if Community.Connect == true then\n      print(\"Connected to the severs.\")\n   end\n   Community.Connect2\n   local FileHandle = io.open(\"SavedData\/LBPCommunitySave.data\", \"w\")\n   FileHandle:write(\"0\")\n   FileHandle:close\n   Community.OnlineMenuHomeSO\n   return\nend\n\nCommunity.ConnectToCommunity = Community.FirstConnect\n\nrequire \"TSWRes Community1\"\nrequire \"TSWRes Community2\"\nrequire \"TSWRes Community3\"\nrequire \"TSWRes CommunityDraw\"\nrequire \"TSWRes CommunityPlayIcons\"\n\nreturn Community","TSWRes Objects.lua":"if not TSW then require \"TSWRes Game\" end\nlocal print = print\nprint(\"Objects Loading...\")\nObjRes = {}\nCol255 = Draw.Col255\n\n-- *Size)\n\nByteMulti = {\n   [1] = \"Byte\", [2] = \"Kilobyte\", [3] = \"Megabyte\",\n   [4] = \"Gigabyte\", [5] = \"Terabyte\", [6] = \"Petabyte\",\n   [7] = \"Exabyte\", [8] = \"Zettabyte\", [9] = \"Yottabyte\"\n}\nlocal ByteMulti = ByteMulti\n\nObjMaterials = {\n   [\"Cardboard\"] = Draw.Col255(183, 132, 81),\n   [\"Dissolve\"] = Draw.Col255(98, 255, 98),\n   [\"Dark Matter\"] = Draw.Col255(11, 12, 56),\n   [\"Glass\"] = Draw.Col255(200, 200, 255, 64),\n   [\"Peach Floaty\"] = draw.orange,\n   [\"Pink Floaty\"] = Draw.Col255(255, 48, 128),\n   [\"Metal\"] = Draw.Col255(231, 213, 97),\n   [\"Cloth\"] = Col255(250, 190, 160),\n   [\"Sticker Panel\"] = draw.white,\n   [\"Red Cardboard\"] = draw.red,\n   [\"Green Cardboard\"] = draw.green,\n   [\"Blue Cardboard\"] = draw.blue\n}\n\nObjMaterialsBorders = {\n   [\"Cardboard\"] = Draw.Col255(133, 82, 31),\n   [\"Dissolve\"] = Draw.Col255(110, 255, 110),\n   [\"Dark Matter\"] = Draw.Col255(6 + 8, 6 + 8, 24 + 8),\n   [\"Glass\"] = Draw.Col255(248, 248, 255, 64 + 48),\n   [\"Peach Floaty\"] = draw.orange,\n   [\"Pink Floaty\"] = draw.orange,\n   [\"Metal\"] = Col255(231 + 48, 213 + 48, 97 + 48),\n   [\"Cloth\"] = Col255(220, 160, 100),\n   [\"Sticker Panel\"] = draw.white,\n   [\"Red Cardboard\"] = Draw.Col255(255, 48, 48),\n   [\"Green Cardboard\"] = Draw.Col255(48, 255, 48),\n   [\"Blue Cardboard\"] = Draw.Col255(48, 48, 255)\n}\n\ntable.sort(ObjMaterials)\n\n-- Draw Functions for Objects --\n\nrequire \"TSWRes ObjectsMaterial\"\n\n\nfunction ObjRes.CreatureBrain(X, Y, Size)\n   Size=15\n   draw.fillcircle(X, Y, Size, Col255(255,255,255,180))\n   draw.fillcircle(X, Y, Size*.8, PlayCol1)\n   draw.fillrect(X-Size, Y, X+Size, Y+Size, draw.gray)\nend\n\nfunction ObjRes.Entrance(CorTab, X, Y, Size, RotRad, Mat, k)\n   local CCP = ChPtTab[CurChPt]\n   draw.fillcircle(X, Y, Size, draw.black)\n   if CCP[\"Lives\"] <= 0 then\n      draw.fillarc(X, Y, Size, (math.pi * .5) + .2, (math.pi * .5) - .2, Col255(LifePus, 0, 0))\n   else\n      draw.fillarc(X, Y, Size, (math.pi * .5) + .2, ((math.pi * .5)) + ((CCP[\"Lives\"]\/CCP[\"MaxLives\"])*((math.pi*2)-.2)), draw.white)\n   end\n   draw.fillcircle(X, Y, Size-(5*(Size\/32)), Col255(100,33,13))\n   ObjRes.SackboyHead(Col255(105,38,18), X, Y + (Size*.5), Size\/32, RotRad, Mat, k, draw.black)\n   if ObjSelected == k then\n      draw.circle(X, Y, Size, PlayCol1)\n   end\nend\n\nfunction ObjRes.Checkpoint(CorTab, X, Y, Size, RotRad, Mat, k)\n   local CCP = ChPtTab[CurChPt]\n   draw.fillcircle(X, Y, Size, draw.black)\n   if CCP[\"Lives\"] <= 0 then\n      draw.fillarc(X, Y, Size, (math.pi * .5) + .2, (math.pi * .5) - .2, Col255(LifePus, 0, 0))\n   else\n      draw.fillarc(X, Y, Size, (math.pi * .5) + .2, ((math.pi * .5)) + ((CCP[\"Lives\"]\/CCP[\"MaxLives\"])*((math.pi*2)-.2)), draw.white)\n   end\n   draw.fillcircle(X, Y, Size-(5*(Size\/32)), Col255(100,33,13))\n   if ObjSelected == k then\n      draw.circle(X, Y, Size, PlayCol1)\n   end\nend\n\nfunction ObjRes.Tag\n\nend\n\nrequire \"TSWRes Objects1\"\nrequire \"TSWRes Objects2\"\n-- End of Objects --\n\nfunction ObjRes.BytesPlus(Value, Short)\n   local ByteMulti = ByteMulti\n   local DV1024 = 1\/1024\n   local RValue1 = Value\n   local RValue2 = 1\n   for i = 1, #ByteMulti do\n      if (RValue1 * DV1024) >= 1 then\n         RValue1 = (RValue1 * DV1024)\n         RValue2 = RValue2 + 1\n      else\n         break\n      end\n   end\n   local Plural = \"\"\n   if RValue1 > 1 then\n      Plural = \"s\"\n   end\n   return (math.floor(RValue1 * 100) * .01 ..\" \"..ByteMulti[RValue2]..Plural)\nend\n\nrequire \"TSWRes ObjectsSackboy\"\n\n-- Table for Thermometer Usage\nObjRes.TherTab = {}\nObjRes.TherTab[\"Square\"] = 10\nObjRes.TherTab[\"Circle\"] = 10\nObjRes.TherTab[\"Triangle\"] = 10\nObjRes.TherTab[\"Pentagon\"] = 10\nObjRes.TherTab[\"Hexagon\"] = 10\nObjRes.TherTab[\"Octagon\"] = 10\nObjRes.TherTab[\"Entrance\"] = 10\nObjRes.TherTab[\"Checkpoint\"] = 10\nObjRes.TherTab[\"ScoreBubble\"] = 10\nObjRes.TherTab[\"StartGate\"] = 10\nObjRes.TherTab[\"FinishGate\"] = 10\nObjRes.TherTab[\"LuaMicrochip\"] = 10\nObjRes.TherTab[\"Tag\"] = 10\nObjRes.TherTab[\"ScoreBubble\"] = 10\nObjRes.TherTab[\"Scoreboard\"] = 10\n\nObjRes.SizeTab = {}\nObjRes.SizeTab[\"Entrance\"] = 32\nObjRes.SizeTab[\"Checkpoint\"] = 32\nObjRes.SizeTab[\"StartGate\"] = 64\nObjRes.SizeTab[\"FinishGate\"] = 64\nObjRes.SizeTab[\"Scoreboard\"] = 128\n\nObjTooSiz = {} -- Icon Size for the Tool Icon\nObjTooSiz[\"Square\"] = 32\nObjTooSiz[\"Circle\"] = 32\nObjTooSiz[\"Triangle\"] = 32\nObjTooSiz[\"Pentagon\"] = 32\nObjTooSiz[\"Hexagon\"] = 32\nObjTooSiz[\"Octagon\"] = 32\nObjTooSiz[\"Entrance\"] = 32\nObjTooSiz[\"Checkpoint\"] = 32\nObjTooSiz[\"StartGate\"] = 32\nObjTooSiz[\"FinishGate\"] = 32\nObjTooSiz[\"ScoreBubble\"] = 8\nObjTooSiz[\"PrizeBubble\"] = 32\nObjTooSiz[\"Button\"] = 32\nObjTooSiz[\"Spikes\"] = 32\nObjTooSiz[\"Scoreboard\"] = 32\nObjTooSiz[\"TriggerExp\"] = 32\nObjTooSiz[\"ImpactExp\"] = 32\nObjTooSiz[\"Sackboy\"] = 32\n\nObjIcoSiz = {} -- Icon Size in Popit Menus\nObjIcoSiz[\"Square\"] = 24\nObjIcoSiz[\"Circle\"] = 16\nObjIcoSiz[\"Triangle\"] = 24\nObjIcoSiz[\"Pentagon\"] = 16\nObjIcoSiz[\"Hexagon\"] = 16\nObjIcoSiz[\"Octagon\"] = 16\nObjIcoSiz[\"Entrance\"] = 16\nObjIcoSiz[\"Checkpoint\"] = 16\nObjIcoSiz[\"CorEdi\"] = 16\nObjIcoSiz[\"StickerEditor\"] = 16\nObjIcoSiz[\"MatCha\"] = 16\nObjIcoSiz[\"WaterTool\"] = 16\nObjIcoSiz[\"Capture Tool\"] = 16\nObjIcoSiz[\"Static Tool\"] = 16\nObjIcoSiz[\"StartGate\"] = 16\nObjIcoSiz[\"FinishGate\"] = 16\nObjIcoSiz[\"ScoreBubble\"] = 4\nObjIcoSiz[\"PrizeBubble\"] = 16\nObjIcoSiz[\"Button\"] = 16\nObjIcoSiz[\"Spikes\"] = 16\nObjIcoSiz[\"Scoreboard\"] = 16\nObjIcoSiz[\"TriggerExp\"] = 16\nObjIcoSiz[\"ImpactExp\"] = 16\n\nreturn ObjRes","GameRes.lua":"require \"TSWRes Functions\"","TSWRes Logic.lua":"local LogicMicrochips = {}\n\nLogicMicrochips[\"LogicNode\"] = \n\n\n\nLogicMicrochips[\"ANDGate\"] = \n\n\n\n\nLogic = {}\n\nfunction Logic.RunComponent(Com)\n   local _ENV = LogicComponents\n\nend\n--","TSWRes LoadProcess.lua":"if not TSW then require \"TSWRes Game\" end\nLoaderTab = {}\n\nfunction Draw.SaveLoading(Prog, X)\n   if type(X) == \"number\" then Prog = Prog \/ X end\n   --if Prog <= 0 then\n      Strings.Loading = {\"Loading Profile\"}\n   end\n   draw.beginframe\n   Draw.BGs.Loading(\"Loading Profile..\")\n   Draw.LoadNotice\n   draw.rect(24, SizeY - 48, SizeX - 24, SizeY - 24, PlayCol1 or draw.black)\n   draw.fillrect(24, SizeY - 48, (Prog*(SizeX - 48)) + 24, SizeY - 24, PlayCol1 or draw.black)\n   draw.endframe\nend\n\nfunction Draw.LoadingProg(Prog, X)\n   if type(X) == \"number\" then Prog = Prog \/ X end\n   draw.beginframe\n   Draw.BGs.Loading(\"Preparing..\")\n   draw.rect(24, SizeY - 48, SizeX - 24, SizeY - 24, PlayCol1 or draw.black)\n   draw.fillrect(24, SizeY - 48, (Prog*(SizeX - 48)) + 24, SizeY - 24, PlayCol1 or draw.black)\n   draw.endframe\nend\n\nfunction LoaderTab.NewProfile\n   GT.NewProfile\nend\n\nfunction LoaderTab.LoadFullProfile\n   Draw.SaveLoading(0)\n   sleep(40)\n   local ProfileOk = GT.LoadProfile\n   Draw.SaveLoading(.25)\n   local StoryOk = StoryRes.LoadFile\n   Draw.SaveLoading(.50)\n   local MMOk = LoaderTab.LoadMyMoonLevels\n   GT.LoadObjects\n   Draw.SaveLoading(.75)\n   local ComOk = Community.LoadFile\n   Draw.SaveLoading(1)\n   if not ProfileOk or not StoryOk or not MMOk or not ComOk then\n      GT.CorruptProfile(ProfileOk, StoryOk, MMOk, ComOk)\n   end\n   if not MyMoonLevels then\n      print(\"MyMoonLevels is missing!\")\n   end\nend\n\nfunction LoaderTab.LoadMyMoonLevels\n   if not FS.exists(\"SavedData\/LBPTSWMyMoon.info\") then\n      return true, \"No file found\"\n   end\n   local BLs = 0\n   local MyMoonLFile = io.open(\"SavedData\/LBPTSWMyMoon.info\")\n   MyMoonLevels[\"Levels\"] = 0\n   MyMoonLevels[\"SavedLevelTab\"] = {}\n   print(MyMoonLevels)\n   if MyMoonLFile then\n      local MMLSt = MyMoonLFile:read\n      MyMoonLFile:close\n      if type(MMLSt) == \"string\" then\n         MyMoonLevels = JSON.DecodeJSON(MMLSt)\n         if type(MyMoonLevels) == \"string\" then\n            print(MyMoonLevels)\n            MyMoonLevels[\"Levels\"] = 0\n            MyMoonLevels[\"SavedLevelTab\"] = {}\n            return false, \"error\"\n         elseif type(MyMoonLevels) ~= \"table\" then\n            print(\"error detected while loading MyMoonLevels\")\n            MyMoonLevels[\"Levels\"] = 0\n            MyMoonLevels[\"SavedLevelTab\"] = {}\n            return false, \"error\"\n         end\n         local SLTab = MyMoonLevels[\"SavedLevelTab\"]\n         if not MyMoonLevels[\"SavedLevelTab\"] then\n            print(\"error detected while loading MyMoonLevels\")\n            MyMoonLevels[\"Levels\"] = 0\n            MyMoonLevels[\"SavedLevelTab\"] = {}\n            return false, \"error\"\n         end\n         for k, v in ipairs(MyMoonLevels[\"SavedLevelTab\"]) do\n            --if \n            v[\"Size\"] = GT.LevelSize(k)\n            if v[\"Size\"] == -1 then\n\n            end\n            if not ok then\n               --table.remove( MyMoonLevels[\"SavedLevelTab\"], k)\n            end\n         end\n         if (BLs >= #MyMoonLevels[\"SavedLevelTab\"] and BLs ~= 0) then\n            print(\"Only Broken Levels found!\")\n            --MyMoonLevels[\"Levels\"] = 0\n            --MyMoonLevels[\"SavedLevelTab\"] = {}\n            --LoaderTab.SaveMyMoonLevels\n         end\n         if #MyMoonLevels[\"SavedLevelTab\"] == 0 then\n            os.remove(\"SavedData\/LBPTSWMyMoon.info\")\n            MyMoonLevels[\"Levels\"] = 0\n            MyMoonLevels[\"SavedLevelTab\"] = {}\n            LoaderTab.SaveMyMoonLevels\n         end\n      else\n         print(\"Warning: MyMoonLevel File is not a string!\")\n         return false, \"error\"\n         --LoaderTab.SaveMyMoonLevels\n      end\n   else\n      return false, \"failed to load file\"\n   end\n   return true\nend\n\nfunction LoaderTab.SaveMyMoonLevels\n   if type(MyMoonLevels) == \"table\" then\n      local MyMoonLFile = io.open(\"SavedData\/LBPTSWMyMoon.info\", \"w\")\n      print(\"About to Encode\")\n      local MMLSt = JSON.EncodeJSON(MyMoonLevels)\n      print(MMLSt)\n      MyMoonLFile:write(MMLSt)\n      MyMoonLFile:close\n   else\n      error(\"MyMoonLevels is not a table (\"..type(MyMoonLevels)..\"), aborting!\")\n   end\n\nend\n\n\nreturn LoaderTab","TSWRes HelpFile1.lua":"-- Help File for LittleBigPlanet: Tag's Super World\n\nlocal HF = HelpRes.HelpFile\n\nHF.HP.Home = {\n   \"LittleBigPlanet Tag's Super World Help.\",\n   \"\",\n   \"Contents:\",\n   \" HP.HowToPlay How to Play LBP:TSW?<\/link>\",\n   \" HP.CreateMode How to use Create Mode?<\/link>\",\n   \" HP.LuaScripts How to make a Lua Script.<\/link>\",\n   \" HP.Tips Tips and tricks.<\/link>\",\n   \" HP.Links Links.<\/link>\",\n   \"K\",\n   \"K\",\n   \"K\",\n   \"K\",\n   \"K\",\n   \"K\",\n   \"K\",\n   \"K\",\n   \"Test\"\n}\n\nHF.HP.HowToPlay = {\n   \" How to play<\/big>\",\n   \"The boxes on the lower left is the directnal buttons.\",\n   \"Press Left and Right to move Sackboy.\",\n   \" Gameplay<\/big>\",\n   \"Score Bubbles ten points each. Collect five in a row to increase your score multiplyer, which can increase to a maximum of 100x.\",\n  \"Your score multiplyer will multiply your score when it runs out.\",\n   \"Prize Bubbles contain all sorts of stickers, materials, objects, and costumes<\/em> that can be used in your levels.\",\n   \"As you play a level, you'll pass checkpoints that set your respawn point. Sackboy will respawn at the last activated checkpoint.\",\n  \"However, checkpoints do have limited lives, which you use up when Sackboy respawns at a checkpoint.\",\n   \"Checkpoints that are out of lives will flash red, and cannot be reactivated.\",\n   \"If the currently activated checkpoint is out of lives and Sackboy gets killed, you will lose your position in the level.\",\n   \" The Popit Menu<\/big>\",\n   \"The Popit Menu contains all items that Sackboy collects on his adventure.\"\n}\n\nHF.HP.CreateMode = {\n   \"Create Mode.\",\n   \"Welcome to Create Mode, where you get to create your own levels.\",\n   \"The Popit Menu is upgraded to allow you to create levels.\"\n}\n\nHF.HP.Links = {\n   \"Coming Soon.\"\n}\n\nHF.Sidebar = {\n   \"TagShell is a shell made in Lua.\"\n}\n\nHF.HP.NotFound = {\n   \"That page could not be found.\"\n}\n\nHF.URLs = {\n   [\"HelpFile\/Home\"] = HF.HP.Home,\n   [\"HelpFile\/HowToPlay\"] = HF.HP.HowToPlay,\n   [\"HelpFile\/CreateMode\"] = HF.HP.CreateMode,\n   [\"HelpFile\/Tips\"] = HF.HP.Tips,\n   [\"HelpFile\/404\"] = HF.HP.NotFound,\n}\n\nHF.Titles = {\n   [\"HelpFile\/Home\"] = \"Help Home\",\n   [\"HelpFile\/HowToPlay\"] = \"How to play and gameplay\",\n   [\"HelpFile\/CreateMode\"] = \"How to use Create Mode.\",\n   [\"HelpFile\/Tips\"] = \"Tips and tricks\",\n   [\"HelpFile\/404\"] = \"That page could not be found.\"\n}","TSWRes Community2.lua":"if not TSW then require \"TSWRes Game\" end\n\n-- Level Page --\nfunction Community.DrawLevels\n   local StaX, StaY = SizeX - 180, 32\n   local ButX, ButY = SizeX - StaX, 48\n   for k, v in ipairs(Community.LevelsOnPage) do\n      local X, Y = StaX, StaY + ((k - 1)*ButY)\n      Draw.Button(\"\", StaX, StaY + ((k - 1)*ButY), StaX + ButX, StaY + (k*ButY), PlayCol1)\n      -- Level icon\n      if v[\"LBPPicked\"] then\n         Stickers[\"LBPPick\"](X + 24, Y + 24, 24)\n      end\n      draw.fillcircle(X + 24, Y + 24, 20, draw.white)\n      Stickers[v[\"Icon\"] or \"nil\"](X + 24, Y + 24, 20)\n      -- Level details\n      draw.string(v[\"Name\"], X + 48, Y, draw.white)\n      Draw.Plays(X + 48, Y + 24, draw.white)\n      draw.string(v[\"Plays\"], X + 64, Y + 24, draw.white)\n      Draw.Likes(X + 112, Y + 24, draw.white)\n      draw.string(v[\"Likes\"], X + 128, Y + 24, draw.white)\n   end\nend\n\nfunction Draw.Plays(X, Y, Color) -- Draw icon\n   draw.fillcircle(X + 8, Y + 8, 8, Color)\nend\n\nfunction Draw.Likes(X, Y, Color) -- Draw icon\n   draw.fillcircle(X + 8, Y + 8, 8, Color)\nend\n\nfunction Draw.Hearts(X, Y, Color) -- Draw icon\n   draw.fillcircle(X + 8, Y + 8, 8, Color)\nend\n\nfunction Community.GetLevelTap(TX, TY)\n   local StaX, StaY = SizeX - 180, 32\n   local ButX, ButY = SizeX - StaX, 48\n   for k, v in ipairs(Community.LevelsOnPage) do\n      local Clicked = TRec(StaX, StaY + ((k - 1)*ButY), StaX + ButX, StaY + (k*ButY), TX, TY)\n      if Clicked then return k end\n   end\nend\n\n-- For level details while online\nfunction Draw.CommunityLevelDetails(LevelSel)\n   local v = Community.LevelsOnPage[LevelSel]\n   draw.beginframe\n   draw.clear(Col255(16, 98, 24))\n   -- Level icon\n   if v[\"LBPPicked\"] then\n      Stickers[\"LBPPick\"](48, 48, 24*2)\n   end\n   draw.fillcircle(48, 48, 20*2, draw.white)\n   Stickers[v[\"Icon\"] or \"nil\"](48, 48, 20*2)\n   -- Level details\n   draw.setfont(\"Arial\", 24)\n   draw.string(v[\"Name\"], 96, 0, draw.white)\n   draw.setfont(\"Arial\", 16)\n   draw.string(\"By     \"..v[\"Creator\"], 96, 24, draw.white)\n   Draw.Plays(96, 48, draw.white)\n   draw.string(v[\"Plays\"], 96 + 16, 48, draw.white)\n   Draw.Likes(160, 48, draw.white)\n   draw.string(v[\"Likes\"], 160 + 16, 48, draw.white)\n   draw.endframe\nend\n\nfunction Community.LevelDetails(LevelSel)\n   if not Community.LevelsOnPage[LevelSel] then\n      return\n   end\n   for k=1, math.huge do\n      Draw.CommunityLevelDetails(LevelSel)\n   end\nend\n\n-- Gets the icon touched\nfunction PlayIcoTapped(TX, TY, Scroll)\n   t2=t2 or t\n   local X1 = 32\n   local X2, Y2 = SizeX - 32, SizeY-32\n   local FunX,FunY = 32, 64\n   local DwSize, IcoSize = 1, 64\n   local OptSz = 64\n   local DISz = (IcoSize*DwSize)\n   for k,v in pairs(PlayIcons) do\n      local TappedIcon = TRec(FunX, FunY, FunX+64, FunY+64, TX, TY + Scroll)\n      if TappedIcon then\n         SavedFile.SFJSON[\"Icon\"] = k\n         Action = \"Close\"\n         return k\n      end\n      FunX = FunX + OptSz\n      if FunX + OptSz > X2 then\n         FunX, FunY = X1, FunY + OptSz\n      end\n   end\nend\n\n-- Icon Menu Touch\nfunction PlayIcoTouch(TX, TY)\n   local ClosePress = TRec(32, 32, 64, 64, TX, TY)\n   local Scroll = 0\n   if ClosePress then\n      Action = \"Close\"\n      return\n   else\n      PlayIcoTapped(TX, TY, Scroll)\n   end\nend\n\n-- Player Icons\nfunction Community.PlayIconsMenu\n   --sleep(100)\n   for i=1, math.huge do\n      draw.tracktouches(Nil, Nil, PlayIcoTouch)\n      local OldTime = sys.gettime\n      Action = nil\n      draw.beginframe\n      Draw.BGs.PlayIconsMenu\n      draw.endframe\n      draw.doevents\n      if Action == \"Close\" then\n         Action = nil\n         return\n      end\n   end\nend","TSWRes Draw.lua":"local print = print\nprint(\"Draw functions loading\")\nlocal D255 = 1\/255\ndraw.setscreen(1)\nDraw = {}\n\n--Col255MT = require \"TSWRes Col255MetaTable\"\n\ndraw.lightGray = draw.lightgray\ndraw.darkGray = draw.darkgray\n\nfunction Draw.Col255(R,G,B,A)\n   A = A or 255\n   return {R*D255,G*D255,B*D255,A*D255}\nend\nCol255 = Draw.Col255\n\nDraw.BGs = {}\nfunction Draw.BGs.Loading\n   draw.clear(draw.black)\n   draw.string(\"Please Wait...\", 128, 256, draw.white)\nend\n\ndraw.beginframe\nDraw.BGs.Loading\ndraw.endframe\n\nDraw.Popit = {}\nDraw.Icons = {}\n\nfunction Draw.Icons.Save(X,Y,Size)\n   local FillRoundRect, FillTriangle = draw.fillroundedrect, draw.filltriangle\n   local DSR = 4*Size\n   local RX, RY = 32*Size, 32*Size\n   local TX1, TY1, TX2, TY2, TX3 = 4*Size, 8*Size, 16*Size, 28*Size, 28*Size\n   FillRoundRect(X, Y, (X)+RX, (Y)+RY, DSR, draw.blue)\n   FillTriangle(X+TX1, Y+TY1, X+TX2, Y+TY2, X+TX3, Y+TY1, draw.lightGray)\nend\n\nfunction Draw.DPad(DX, DY, BgCol, FgCol)\n   local TSz=32\n   local LSz=TSz*2\n   local XSz=TSz*3\n   draw.rect(DX, DY, DX+XSz, DY+XSz, BgCol)\n   draw.rect(DX+TSz, DY, DX+LSz, DY+XSz, FgCol)\n   draw.rect(DX, DY+TSz, DX+XSz, DY+LSz, FgCol)\nend\n\n-- Backgrounds --\n\nrequire \"TSWRes BGs\"\nrequire \"TSWRes DrawSaveIcon\"\n\nfunction Draw.SaveNotice\n   Draw.Icons.Save(24, SizeY - 96, 2)\nend\n\n\nDraw.LoadNotice = Draw.SaveNotice\n\n-- In-game stuff\n\n\n-- Popit Menu\nfunction Draw.Popit.LaBg\n   local PMPages = PopitRes.PMPages\n   local FillColor = PlayCol1\n   draw.fillroundedrect( SizeX-(32*6), 32, SizeX-32, SizeY-32, 4, FillColor )\n   Draw.PodButton(\"X\", SizeX-64, 32, SizeX-32, 64, FillColor)\n   draw.string(PopitCuMenu, SizeX - (32*5), 36, draw.black)\n   if PMPages[PopitCurMen] then\n      Draw.PopitMenuPages\n   end\nend\n\nfunction Draw.Popit.Home\n   local rect, SizeX = draw.rect, SizeX\n   rect(SizeX-(32*5), 64, SizeX-(32*3.5), 64+(32*1.5), draw.black)\n\n   rect(SizeX-112, 64, SizeX-64, 112, draw.black)\n   draw.image(\"Images\/GoodiesBag.png\", SizeX - (112 + 48), 64)\n\n   draw.setfont(\"Arial\", 32)\n   draw.string(\"?\", SizeX-112, 64, draw.black)\n   draw.setfont(\"Arial\", 16)\n\n   rect(SizeX-(32*5), 112, SizeX-(32*3.5), 160, draw.black)\n   Draw.PopitCursor(SizeX-((32*5)-(24)), 136, 32)\n\n   rect(SizeX-112, 112, SizeX-64, 160, draw.black)\n   Stickers.StickerIcon(SizeX-((32*5)-(24)), 136, 32)\n\n   rect(SizeX-(32*5), 160, SizeX-(32*3.5), 208, draw.black)\n\n   rect(SizeX-112, 160, SizeX-64, 208, draw.black)\n\n   rect(SizeX-(32*5), 208, SizeX-(32*3.5), 256, draw.black)\n   Draw.Icons.Save(SizeX-(32*5),208,1.5)\n\n   rect(SizeX-112, 208, SizeX-64, 256, draw.black)\n   draw.filltriangle( SizeX-112, 208, SizeX-64, 256-24, SizeX-112, 256, PlayCol2 )\nend\n\nfunction Draw.Popit.ContentMenu\n   Draw.PrintIcons(PMPage[PopitCuMenu], SizeX-(32*6), 96, SizeX-64, SizeY-32)\nend\n\nfunction Draw.Popit.LogicObjectsMenu\n   Draw.PrintLogicIcons( PopitRes.PMPage[PopitCuMenu], SizeX-(32*6), 64, SizeX-64, SizeY-32)\nend\n\n\nfunction Draw.Popit.MaterialsMenu\n   Draw.PrintMaterials(ObjMaterials, SizeX-(32*6), 96, SizeX-64, SizeY-32)\nend\n\nfunction Draw.Popit.SackboyMaterialsMenu\n   Draw.PrintMaterials(SackboyMaterials, SizeX-(32*6), 96, SizeX-64, SizeY-32)\nend\n\nfunction Draw.Popit.StickersMenu\n   Draw.PrintStickersPopit( PopitRes.PMPage[\"Stickers\"],SizeX-(32*6), 96, SizeX-64, SizeY-32)\nend\n\nfunction Draw.Popit.Menu\n   if PopitOpen == false then return end\n   Draw.Popit.LaBg\n   if PopitCuMenu == \"Home\" then\n      Draw.Popit.Home\n   elseif PopitCuMenu == \"Costume Materials\" then\n      Draw.Popit.SackboyMaterialsMenu\n   elseif PopitCuMenu == \"Materials\" then\n      Draw.Popit.MaterialsMenu\n   elseif PopitCuMenu == \"Stickers\" then\n      Draw.Popit.StickersMenu\n   elseif PopitCuMenu == \"Logic Objects\" then\n      Draw.Popit.LogicObjectsMenu\n   elseif PopitCuMenu == \"Captured Objects\" then\n      local COT = CapturedObjects[\"ObjTabs\"]\n      PopitRes.PMPage[PopitCuMenu] = COT\n      Draw.PrintCustomObjects(COT, SizeX-(32*6), 64, SizeX-64, SizeY-32)\n   else\n      Draw.PrintIcons( PopitRes.PMPage[PopitCuMenu], SizeX-(32*6), 64, SizeX-64, SizeY-32)\n   end\nend\n\n-- Draw Tools --\nrequire \"TSWRes DrawToolIco\"\n\n-- Draw Objects\nrequire \"TSWRes DrawObjects\"\n\nrequire \"TSWRes Draw1\"\nrequire \"TSWRes Draw2\"\nrequire \"TSWRes Draw3\"\nrequire \"TSWRes DrawPopit\"\nrequire \"TSWRes DrawCM\"\n\nreturn Draw","TSWRes GameCreatures.lua":"-- Creature Stuff --\n\n-- Create A Creature table.\nfunction GT.CreateCreTab\n   local CreTab = {}\n   CreTab[\"SackResp\"] = \"Ignore\"\n   CreTab[\"Speed\"] = 1\n   CreTab[\"JumpFrame\"] = 0\n   CreTab[\"JumpPwr\"] = 1\n   CreTab[\"JumpInt\"] = 1\n   CreTab[\"JumpPhs\"] = 1\n   CreTab[\"X\"] = 0\n   CreTab[\"Y\"] = 0\n   CreTab[\"Size\"] = 24\n   return CreTab\nend\n\nfunction GT.CreatureObject(Obj, Key)\n   local CreTab = Obj[\"CreTab\"]\n   if CreTab[\"Dead\"] then\n      table.remove(ObjTab, Key)\n      return\n   end\n   Obj[\"XVol\"] = CreTab[\"Speed\"] * 4\n   CreTab[\"JumpFrame\"] = CreTab[\"JumpFrame\"] + 1\n   if CreTab[\"JumpFrame\"] > 20 * CreTab[\"JumpPhs\"] then\n      print(CreTab[\"JumpFrame\"])\n      Obj[\"Y\"] = Obj[\"Y\"] -1\n      Obj[\"YVol\"] = -(3 * CreTab[\"JumpPwr\"])\n      if CreTab[\"JumpFrame\"] > 20 * CreTab[\"JumpPhs\"] + CreTab[\"JumpInt\"] then\n         CreTab[\"JumpFrame\"] = 0\n      end\n   end\nend\n\nreturn","TSWRes Game.lua":"--local print = print\ndraw.settitle(\"Please Wait...\")\nTSW = true\nprint(\"Game Loading...\")\ndraw.setscreen(1)\nlocal GameT = {}\nGT = GameT\n\n--function draw.clear end\n\n--function draw.getport\n   return 200, 300\nend--[[\n\nGrid, Zoom = nil, 1\nfunction Nil end\n\n-- Resorces\nrequire(\"GameRes\")\nDraw = require \"TSWRes Draw\"\nStickers = require \"TSWRes Stick\"\nObjRes = require \"TSWRes Objects\"\nPopitRes = require \"TSWRes Popit\"\nJSON = require \"JSON\"\nStrings = require \"TSWRes Strings\"\nLoader = require \"TSWRes LoadProcess\"\nSandbox = require \"TSWRes Sandbox\"\nFS = require \"ModuleFS\"\nrequire \"TSWRes Cache\"\nFS2 = require \"FileSystem\"\nrequire \"TSWRes Saving\"\n\nSizeX, SizeY = draw.getport\n\nCG = collectgarbage\nlocal CG = CG\nlocal draw = draw\nCG\n\n-- Game Stuff\nObjTab = {nil, nil, nil, nil, nil}\n--local ObjTab = ObjTab\nLifePus, LPS = 0, 00\n\nLevelTab = {[\"Name\"] = \"Unnamed Level\", [\"Description\"] = \"Add a description to this level.\",\n[\"Icon\"] = \"nil\", [\"Labels\"] = {}}\nLuaCorTab = {}\nMyMoonLevels = {} -- For the My Moon Levels\n\nScore = 0\nScoreMultiplier = 0\nScoreMultiplierTime = 0\nScoreMultiplierPoints = 0\n\nlocal LevelTab = LevelTab\nDrawStatusBar = true\nChPtTab = {}\nLTV = 0 -- Level Thermometer Value\nMT = 20000 -- Max Themometer Value\nPopitOpen, PopitCuMenu = false, \"Home\"\nCurChPt = 1 -- Currently activated Checkpoint\nCamX, CamY = 0, 250 -- Camera Position\nLogicCoroutines = {} -- Coroutines\nPlayCol1, PlayCol2, PCBG = Draw.Col255(64, 64, 255), Draw.Col255(232, 64, 255), Draw.Col255(0,0,0)\nPlayCol1T = Col255(64, 64, 255, 255*.25)\nEmotion = \"Basic\"\nMagicMouthText = \"\"\nNoticeText = \"\"\nThermoPus, TPS = 16, 0\n\ndraw.beginframe\nDraw.BGs.Loading\ndraw.endframe\n\n\n-- Other\nFR = 30 -- Frame Rate (FPS)\nGT.Vars = {}\nGT.Vars.CreatedLevels = 0\n\n-- Creates an Object Table used for the Game\nfunction GT.CreObjTab(CorTab, X, Y, Size, TVal, Dynamic, Mat, RotRad)\n   local OT = {}\n   OT[\"CorTab\"] = CorTab\n   OT[\"Attach\"] = {}\n   OT[\"Stickers\"] = {}\n   OT[\"X\"] = X\n   OT[\"Y\"] = Y\n   OT[\"Size\"] = Size\n   OT[\"Weight\"] = Size*Size\n   OT[\"Dynam\"] = Dynamic or false --(CorTab ~= \"Scoreboard\")--#ObjTab >= 4\n   OT[\"RotRad\"] = RotRad or 0\n   OT[\"Mat\"] = Mat\n   OT[\"TVal\"] = TVal or 0\n   OT[\"XVol\"] = 0\n   OT[\"YVol\"] = 0\n   OT[\"RVol\"] = 0\n   OT[\"Lethal\"] = nil\n   OT[\"NoCollide\"] = (CorTab == \"Entrance\" or CorTab == \"Checkpoint\" or CorTab == \"LevelEdge\")\n   OT[\"Link\"] = 1\n   return OT\nend\n\nfunction GT.CreChPtTab(Type, MaxLives, Lives, Active, Link, X, Y)\n   local OT = {}\n   OT[\"CorTab\"] = Type\n   OT[\"Lives\"] = Lives or ChPtLives(Type)\n   OT[\"MaxLives\"] = MaxLives or Lives or ChPtLives(Type)\n   OT[\"Link\"] = Link\n   OT[\"Active\"] = Active or false\n   OT[\"X\"] = X\n   OT[\"Y\"] = Y\n   return OT\nend\n\nfunction GT.CreStiTab(Sticker, X, Y, Size)\n   local OT = {}\n   OT[\"Sticker\"] = Sticker\n   OT[\"X\"] = X or 0\n   OT[\"Y\"] = Y or 0\n   OT[\"Size\"] = Size or 256\n   return OT\nend\n\nfunction TRec(X1,Y1,X2,Y2,TX,TY)\n   --print(\"TRec\",X1,Y1,X2,Y2,TX,TY)\n   if not TX then return false end\n   if TX>=X1 and TX<=X2 then\n      if TY>=Y1 and TY<=Y2 then\n         return true\n      end\n   end\n   return false\nend\n\nfunction MagicMouthTextRemove(TX, TY)\n   local String = NoticeText or MagicMouthText\n   local BoxHeight = Draw.TxtBoxHeight(String)\n   local Close = TRec(98, 24, SizeX - 98, 24 + BoxHeight, TX, TY)\n   if Close then\n      if NoticeText ~= \"\" then\n         NoticeText = \"\"\n      else\n         MagicMouthText = \"\"\n      end\n   end\nend\n\nfunction GetTouch(TX, TY)\n   return TX, TY\nend\n\nfunction GetTouch2(LTX, LTY)\n   TX, TY = LTX, LTY\nend\n\nfunction CamMove(TX, TY)\n   local TDirH, TDirV = TDPad(64, SizeY-96, TX, TY)\n   CamX, CamY = CamX + TDirH, CamY + TDirV\nend\n\nfunction TDPad(DX,DY,TX,TY)\n   local TSz=32\n   local LSz=TSz*2\n   local XSz=TSz*3\n   local U=TRec(DX+TSz, DY, DX+LSz, DY+TSz, TX, TY)\n   local D=TRec(DX+TSz, DY+LSz, DX+LSz, DY+XSz, TX, TY)\n   local L=TRec(DX, DY+TSz, DX+TSz, DY+LSz, TX, TY)\n   local R=TRec(DX+LSz, DY+TSz, DX+XSz, DY+LSz, TX, TY)\n   if U then return 0, 10\n   elseif D then return 0, -10\n   elseif L then return -10, 0\n   elseif R then return 10, 0\nelse return 0, 0 end\nend\n\n-- Builds the Blank Level\nfunction GT.BlankLevel\n   CamX, CamY = 0, 250\n   ObjTab = {true, true, true, true, true, true}\n   ChPtTab = {true}\n   LevelTab = {[\"Name\"] = \"Unnamed Level\", [\"Description\"] = \"Add a description to this level.\"}\n   LevelTab[\"WaterLevel\"] = 2000000\n   ObjTab[1] = GT.CreObjTab(\"LevelEdge\", -10000, 0, 30000)\n   ObjTab[2] = GT.CreObjTab(\"LevelEdge\", -10000, -40000, 30000)\n   ObjTab[3] = GT.CreObjTab(\"LevelEdge\", -30000, -10000, 30000)\n   ObjTab[4] = GT.CreObjTab(\"LevelEdge\", 10000, -10000, 30000)\n   ObjTab[5] = GT.CreObjTab(\"Entrance\", 48, -48, 32, 10, false)\n   ObjTab[6] = GT.CreObjTab(\"Sackboy\", 48, -48, 32, 10, true)\n   --ObjTab[7] = GT.CreObjTab(\"Square\", 48*2, 200, 32*4, 10, true)\n   local Tag = ObjTab[7]\n   local Stick = Tag[\"Stickers\"]\n   Stick[1] = GT.CreStiTab(\"LBPPick\", -10, -10, 32)\n   ChPtTab[1] = GT.CreChPtTab(\"Entrance\", 3, 3, true, 5, 48, -48)\n   GT.FixIncLTV\nend\n\n-- Gets the value of the Thermometer.\nfunction GT.FixIncLTV\n   LTV = 0\n   for k,v in ipairs(ObjTab) do\n      LTV = LTV+v[\"TVal\"]\n   end\nend\n\nfunction DrThV return LTV\/MT end\n\n\n--function CorTest\nLuaCorTab[1] = \"\"--\n\n--LogicCoroutines[1] = coroutine.create(CorTest)\n\n--GT.PlayMode = GT.TestMode\n\nrequire \"TSWRes Game1\"\nrequire \"TSWRes Game2\"\nrequire \"TSWRes Game3\"\nrequire \"TSWRes Game4\"\nrequire \"TSWRes Game5\"\nrequire \"TSWRes GameCreatures\"\nrequire \"TSWRes GameCM\"\nStoryRes = require \"TSWRes Story\"\nrequire \"TSWRes Community\"\nrequire \"TSWRes CapturedObjects\"\nrequire \"TSWRes HandleSackboy\"\n\nLoaderTab.LoadFullProfile\nReloadLoadingStrings\n\n--GetTouch2 = error\n\nif Startup == nil then GT.Menu end\n\nreturn GameT","TSWRes Help.lua":"HelpRes = {}\n\nTprint = print -- Print to Text\nDprint = function end --Debug print to Text\nrequire \"TSWRes HelpFile\"\nrequire \"TSAppTest\"\nif not Key then\n   require \"TSKeyboard\"\nend\n\n--function DrawScrBar(X1, Y1, X2, Y2, S1, S2)\n   local Rect, Line, FillRect = draw.rect, draw.line, draw.fillrect\n   Rect(X1, Y1, X2, Y2, draw.black)\n\n   Rect(X1, Y1, X2, Y1+(X2-X1), draw.blue)\n   Line(X1, Y1+(X2-X1), X1+((X2-X1)*.5), Y1, draw.black)\n   Line(X1+((X2-X1)*.5), Y1, X2, Y1+(X2-X1), draw.black)\n\n   Rect(X1, Y2-(X2-X1), X2, Y2, draw.blue)\n   Line(X1, Y2-(X2-X1), X1+((X2-X1)*.5), Y2, draw.black)\n   Line(X1+((X2-X1)*.5), Y2, X2, Y2-(X2-X1), draw.black)\n\n   Dprint(S1, S2, S1\/S2)\n   local BY1 = (((Y2-64)-(Y1+32))*((S1\/S2)*(1))) + (Y1+32)\n   local BY2 = BY1+32\n\n   FillRect(X1, BY1, X2, BY2, draw.cyan)\n   Rect(X1, BY1, X2, BY2, draw.black)\nend\n\nfunction HelpRes.HelpMenu\n   AppFunc.Help(HelpRes.HelpFile)\nend\n\nreturn HelpRes\n\n","TSWRes Community1.lua":"if not TSW then require \"TSWRes Game\" end\nfunction Community.OfflineMenu\n   for i=1, math.huge do\n      draw.beginframe\n      Draw.BGs.CommunityOfflineMenu\n      draw.endframe\n      print(\"Offline\")\n      TX, TY = draw.waittouch\n      local BackTap = TRec(24, SizeY - 64, 128, SizeY - 24, TX, TY)\n      local ChangeIconTap = TRec(24, 32, 128, 64, TX, TY)\n      local ConnectTap = TRec(24, 64, 128, 96, TX, TY)\n      if BackTap then\n         return\n      elseif ConnectTap then\n         if Community.ShowIntro == true then\n            Community.Intro\n         end\n         if Community.FirstUse then\n            Community.FirstConnect\n         else\n            Community.ConnectToCommunity\n         end\n      elseif LevelsTap then\n\n      elseif ChangeIconTap then\n         Community.PlayIconsMenu\n      end\n   end\nend\n\nfunction Community.OnlineMenuHome\n   for i=1, math.huge do\n      draw.beginframe\n      Draw.BGs.CommunityOnlineMenuHome\n      draw.endframe\n      TX, TY = draw.waittouch\n      local DisconnectTap = TRec(0, 0, 48, 48, TX, TY)\n      local NewsTap = TRec(SizeX-180, 0, SizeX, HS, TX, TY)\n      local LevelsTap = TRec(SizeX-180, HS, SizeX, HS*2, TX, TY)\n      local FriendsTap = TRec(SizeX-180, HS*2, SizeX, HS*3, TX, TY)\n      local ActivityTap = TRec(SizeX-180, HS*3, SizeX, HS*4, TX, TY)\n      local StoreTap = TRec(SizeX-180, HS*4, SizeX, HS*5, TX, TY)\n      local MeTap = TRec(SizeX-180, HS*5, SizeX, HS*6, TX, TY)\n      local HelpTap = TRec(SizeX-180, HS*6, SizeX, HS*7, TX, TY)\n      local SignOutTap = TRec(SizeX-180, SizeY-HS, SizeX, SizeY, TX, TY)\n      local SearchTap = TRec(0, SizeY-32, 256, SizeY, TX, TY)\n      if DisconnectTap then\n         Community.SaveFile\n         Community.Disconnect\n         sys.alert(\"drop\")\n         return\n      elseif NewsTap then\n         Community.OnlineMenuNews\n      elseif LevelsTap then\n         Community.OnlineMenuLevels\n      elseif FriendsTap then\n         --Community.OnlineMenuFriends\n      elseif ActivityTap then\n         --Community.OnlineMenuActivity\n      elseif StoreTap then\n         --Community.OnlineMenuStore\n      elseif MeTap then\n         Community.PlayIconsMenu\n      elseif SignOutTap then\n         if Community.SignedIn then\n            Community.SignOut\n            Community.OnlineMenuHomeSO\n            return\n         end\n      elseif SearchTap then\n         local SearchTerm = Key.Keyboard(\"Search\")\n         http.load(Community.ConnectURL.. \"MediaWiki:Search\/\"..SearchTerm)\n      end\n   end\nend\n\nfunction Community.OnlineMenuHomeSO -- Signed out\n   for i=1, math.huge do\n      draw.beginframe\n      Draw.BGs.CommunityOnlineMenuHomeSO\n      draw.endframe\n      TX, TY = draw.waittouch\n      local DisconnectTap = TRec(0, 0, 48, 48, TX, TY)\n      local NewsTap = TRec(SizeX-180, 0, SizeX, 48, TX, TY)\n      local LevelsTap = TRec(SizeX-180, 48, SizeX, 48*2, TX, TY)\n      local ActivityTap = TRec(SizeX-180, 48*2, SizeX, 48*3, TX, TY)\n      local SignInTap = TRec(SizeX-180, SizeY-96, SizeX, SizeY-48, TX, TY)\n      local RegisterTap = TRec(SizeX-180, SizeY-48, SizeX, SizeY, TX, TY)\n      if DisconnectTap then\n         Community.Disconnect\n         sys.alert(\"drop\")\n         return\n      elseif NewsTap then\n         Community.OnlineMenuNews\n      elseif LevelsTap then\n         Community.OnlineMenuLevels\n      elseif ActivityTap then\n         --Community.OnlineMenuActivity\n         http.Browser\n      elseif SignInTap then\n         Community.SignIn\n         if Community.SignedIn then\n            Community.OnlineMenuHome\n            return\n         end\n      end\n   end\nend\n\nfunction Community.OnlineMenuNews\n   for i=1, math.huge do\n      draw.beginframe\n      Draw.BGs.CommunityOnlineMenuNews\n      draw.endframe\n      TX, TY = draw.waittouch\n      local BackTap = TRec(0, 0, 48, 48, TX, TY)\n      if BackTap then\n         return\n      end\n   end\nend\n\nfunction Community.OnlineMenuLevels\n   Community.GetLevelsOnPage(Search)\n   for i=1, math.huge do\n      draw.beginframe\n      Draw.BGs.CommunityOnlineMenuLevels\n      Community.DrawLevels\n      draw.endframe\n      TX, TY = draw.waittouch\n      local BackTap = TRec(0, 0, 48, 48, TX, TY)\n      if BackTap then\n         return\n      else\n         local LevelSel = Community.GetLevelTap(TX, TY)\n         Community.LevelDetails(LevelSel)\n      end\n   end\nend\n\nfunction Community.OnlineMenuFriends\n   for i=1, math.huge do\n      draw.beginframe\n      Draw.BGs.CommunityOnlineMenuFriends\n      draw.endframe\n      TX, TY = draw.waittouch\n      local BackTap = TRec(0, 0, 48, 48, TX, TY)\n      if BackTap then\n         return\n      end\n   end\nend\n\nfunction Community.OnlineMenuActivity\n   for i=1, math.huge do\n      draw.beginframe\n      Draw.BGs.CommunityOnlineMenuActivity\n      draw.endframe\n      TX, TY = draw.waittouch\n      local BackTap = TRec(0, 0, 48, 48, TX, TY)\n      if BackTap then\n         return\n      end\n   end\nend\n\nfunction Community.OnlineMenuStore\n   for i=1, math.huge do\n      draw.beginframe\n      Draw.BGs.CommunityOnlineMenuStore\n      draw.endframe\n      TX, TY = draw.waittouch\n      local BackTap = TRec(0, 0, 48, 48, TX, TY)\n      if BackTap then\n         return\n      end\n   end\nend"}