Code: Select all
Tileset = love.graphics.newImage('images/dg_edging132.gif') --- Tileset
Tree = love.graphics.newImage('images/tree1.png')
TileW, TileH = 32,32 --- Determine length and width of every tile (32 in this case)
local tilesetW, tilesetH = Tileset:getWidth(), Tileset:getHeight() --- Determines length and width of entire tileset
local quadInfo = {
{0, 0}, -- 1 (Left Corner)
{32, 0}, -- 2 (Top Shore)
{96, 0}, -- 3 (Right Corner)
{96, 32}, -- 4 (Right Shore)
{0, 32}, -- 5 (Left Shore)
{0, 96}, -- 6 (Left Bottom Corner)
{32, 480}, -- 7 (Solid Grass)
{32, 96}, -- 8 (Bottom Shore)
{96, 96}, -- 9 (Right Bottom Corner)
{32, 64}, -- 10 (Bottom Right Curve)
{64, 64}, -- 11 (Bottom Left Curve)
{32, 32}, -- 12 (Top Right Curve)
{64, 32} -- 13 (Top Left Curve)
}
Quads = {}
for i,info in ipairs(quadInfo) do
-- info[1] = x, info[2] = y
Quads[i] = love.graphics.newQuad(info[1], info[2], TileW, TileH, tilesetW, tilesetH)
end
TileTable = { --- Edit this to design level
{1,2,2,2,2,3,1,2,2,2,2,3,1,2,2,2,2,2,3,1,2,2,2,2,3},
{5,7,7,7,7,4,5,7,7,7,7,4,5,7,7,7,7,7,4,5,7,7,7,7,4},
{5,7,7,7,7,4,5,7,7,7,7,4,5,7,7,7,7,7,4,5,7,7,7,7,4},
{5,7,7,7,7,4,5,7,7,7,7,4,5,7,7,7,7,7,4,5,7,7,7,7,4},
{5,7,7,7,7,4,5,7,7,7,7,4,5,7,7,7,7,7,4,5,7,7,7,7,4},
{5,7,7,7,7,10,11,7,7,7,7,10,11,7,7,7,7,7,10,11,7,7,7,7,4},
{5,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,4},
{5,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,4},
{5,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,12,13,7,7,7,7,4},
{5,7,7,7,7,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