Community Curator/Source/TSWRes Objects

local print = print print("Objects Loading...") ObjRes = {} Col255 = Draw.Col255

-- *Size)

ByteMulti = { [1] = "Byte", [2] = "Kilobyte", [3] = "Megabyte", [4] = "Gigabyte", [5] = "Terabyte", [6] = "Petabyte", [7] = "Exabyte", [8] = "Zettabyte", [9] = "Yottabyte" } local ByteMulti = ByteMulti

ObjMaterials = { ["Cardboard"] = draw.brown, ["Dissolve"] = Draw.Col255(90, 255, 90), ["Dark Matter"] = Draw.Col255(6, 6, 24), ["Glass"] = Draw.Col255(200, 200, 255, 64), ["Peach Floaty"] = draw.orange, ["Pink Floaty"] = draw.orange, ["Metal"] = Draw.Col255(231, 213, 97), ["Sticker Panel"] = draw.white, ["Red Cardboard"] = draw.red, ["Green Cardboard"] = draw.green, ["Blue Cardboard"] = draw.blue }

ObjMaterialsBorders = { ["Cardboard"] = draw.brown, ["Dissolve"] = Draw.Col255(110, 255, 110), ["Dark Matter"] = Draw.Col255(6+8, 6+8, 24+8), ["Glass"] = Draw.Col255(248, 248, 255, 64+48), ["Peach Floaty"] = draw.orange, ["Pink Floaty"] = draw.orange, ["Metal"] = Draw.Col255(231+48, 213+48, 97+48), ["Sticker Panel"] = draw.white, ["Red Cardboard"] = Draw.Col255(255, 48, 48), ["Green Cardboard"] = Draw.Col255(48, 255, 48), ["Blue Cardboard"] = Draw.Col255(48, 48, 255) }

table.sort(ObjMaterials)

-- Draw Functions for Objects --

require "TSWRes ObjectsMaterial"

function ObjRes.CreatureBrain(X, Y, Size) Size=15 draw.fillcircle(X, Y, Size, Col255(255,255,255,180)) draw.fillcircle(X, Y, Size*.8, PlayCol1) draw.fillrect(X-Size, Y, X+Size, Y+Size, draw.gray) end

function ObjRes.Entrance(CorTab, X, Y, Size, RotRad, Mat, k)  local CCP = ChPtTab[CurChPt] draw.fillcircle(X, Y, Size, draw.black) if CCP["Lives"] <= 0 then draw.fillarc(X, Y, Size, (math.pi * .5) + .2, (math.pi * .5) - .2, draw.red) else draw.fillarc(X, Y, Size, (math.pi * .5) + .2, ((math.pi * .5)) + ((CCP["Lives"]/CCP["MaxLives"])*((math.pi*2)-.2)), draw.white) end draw.fillcircle(X, Y, Size-(5*(Size/32)), Col255(100,33,13)) if ObjSelected == k then draw.circle(X, Y, Size, PlayCol1) end end

function ObjRes.Checkpoint(CorTab, X, Y, Size, RotRad, Mat, k)  draw.circle(X, Y, Size, draw.black) draw.fillarc(X, Y, Size, (math.pi * .5) + .2, (math.pi * .5) - .2, draw.white) draw.fillcircle(X, Y, Size-(5*(Size/32)), draw.brown) if ObjSelected == k then draw.circle(X, Y, Size, PlayCol1) end end

function ObjRes.Tag

end

require "TSWRes Objects1" -- End of Objects --

function ObjRes.BytesPlus(Value, Short) local ByteMulti = ByteMulti local DV1024 = 1/1024 local RValue1 = Value local RValue2 = 1 for i = 1, #ByteMulti do     if (RValue1 * DV1024) >= 1 then RValue1 = (RValue1 * DV1024) RValue2 = RValue2 + 1 else break end end local Plural = "" if RValue1 > 1 then Plural = "s" end return (math.floor(RValue1 * 100) * .01 .." "..ByteMulti[RValue2]..Plural) end

require "TSWRes ObjectsSackboy"

-- Table for Thermometer Usage ObjRes.TherTab = {} ObjRes.TherTab["Square"] = 10 ObjRes.TherTab["Circle"] = 10 ObjRes.TherTab["Triangle"] = 10 ObjRes.TherTab["Pentagon"] = 10 ObjRes.TherTab["Hexagon"] = 10 ObjRes.TherTab["Octagon"] = 10 ObjRes.TherTab["Entrance"] = 10 ObjRes.TherTab["Checkpoint"] = 10 ObjRes.TherTab["ScoreBubble"] = 10 ObjRes.TherTab["StartGate"] = 10 ObjRes.TherTab["FinishGate"] = 10 ObjRes.TherTab["LuaMicrochip"] = 10 ObjRes.TherTab["Tag"] = 10 ObjRes.TherTab["ScoreBubble"] = 10 ObjRes.TherTab["Scoreboard"] = 10

ObjRes.SizeTab = {} ObjRes.SizeTab["Scoreboard"] = 128

ObjTooSiz = {} -- Icon Size for the Tool Icon ObjTooSiz["Square"] = 32 ObjTooSiz["Circle"] = 32 ObjTooSiz["Triangle"] = 32 ObjTooSiz["Pentagon"] = 32 ObjTooSiz["Hexagon"] = 32 ObjTooSiz["Octagon"] = 32 ObjTooSiz["Entrance"] = 32 ObjTooSiz["Checkpoint"] = 32 ObjTooSiz["StartGate"] = 32 ObjTooSiz["FinishGate"] = 32 ObjTooSiz["ScoreBubble"] = 8 ObjTooSiz["PrizeBubble"] = 32 ObjTooSiz["Scoreboard"] = 32 ObjTooSiz["Sackboy"] = 32

ObjIcoSiz = {} -- Icon Size in Popit Menus ObjIcoSiz["Square"] = 24 ObjIcoSiz["Circle"] = 16 ObjIcoSiz["Triangle"] = 24 ObjIcoSiz["Pentagon"] = 16 ObjIcoSiz["Hexagon"] = 16 ObjIcoSiz["Octagon"] = 16 ObjIcoSiz["Entrance"] = 16 ObjIcoSiz["Checkpoint"] = 16 ObjIcoSiz["CorEdi"] = 16 ObjIcoSiz["StickerEditor"] = 16 ObjIcoSiz["MatCha"] = 16 ObjIcoSiz["StartGate"] = 16 ObjIcoSiz["FinishGate"] = 16 ObjIcoSiz["ScoreBubble"] = 4 ObjIcoSiz["PrizeBubble"] = 16 ObjIcoSiz["Scoreboard"] = 16

return ObjRes