diff --git a/assets/tileset/books.png b/assets/tileset/books.png deleted file mode 100644 index c558133..0000000 Binary files a/assets/tileset/books.png and /dev/null differ diff --git a/data/scripts/editor.lua b/data/scripts/editor.lua index d9a7bb4..c9c5c54 100644 --- a/data/scripts/editor.lua +++ b/data/scripts/editor.lua @@ -25,6 +25,32 @@ function EditorStep() Camera.pos.y = Camera.pos.y + 3*game.scale end + if palette then + if Keybind:HasPressed(Keybind.debug.debug) then + local next = false + local export = nil + for k, v in pairs(tileset) do + if export == nil then + export = v + end + if next then + LevelData.tileset = v + next = false + break + end + + if v == LevelData.tileset then + next = true + end + end + if next then + LevelData.tileset = export + end + LevelGetTileData() + LevelIndexTiles() + end + end + if Keybind:HasPressed(Keybind.debug.reload) then ExportLevel("test") end diff --git a/data/scripts/enums.lua b/data/scripts/enums.lua index e70546d..c1ce6ee 100644 --- a/data/scripts/enums.lua +++ b/data/scripts/enums.lua @@ -133,7 +133,6 @@ levelProperties = { tileset = { bricks = love.graphics.newImage("assets/tileset/bricks.png"), - books = love.graphics.newImage("assets/tileset/bricks.png"), library = love.graphics.newImage("assets/tileset/library.png") } diff --git a/data/scripts/level.lua b/data/scripts/level.lua index 87bb839..b193a95 100644 --- a/data/scripts/level.lua +++ b/data/scripts/level.lua @@ -2,9 +2,6 @@ function LevelLoadTiles() LevelData = dofile("Mothback/data/levels/"..currLevel..".lua") - -- tiles data - TileData = dofile("Mothback/data/tileset/library.lua") - --[[ on level format: @@ -15,12 +12,21 @@ function LevelLoadTiles() overlay_depth = foreground/background overlay depth type = collision type ]] + LevelGetTileData() LevelTiles = LevelData.tiles LevelUpdateDimensions() LevelIndexTiles() TileCreateObjects() end +function LevelGetTileData() + for k, v in pairs(tileset) do + if v == LevelData.tileset then + TileData = dofile("Mothback/data/tileset/"..k..".lua") + end + end +end + function LevelReloadTiles() LevelUpdateDimensions() TileCreateObjects() diff --git a/data/tileset/bricks.lua b/data/tileset/bricks.lua index 6e4603c..bdd82b9 100644 --- a/data/tileset/bricks.lua +++ b/data/tileset/bricks.lua @@ -1,350 +1,349 @@ -return { - { - id = 1, - force = 0, - overlay_tileset = tileset.books, - type = "whole", - depth = "foreground" - }, - { - id = 2, - type = "whole", - depth = "foreground" - }, - { - id = 3, - type = "whole", - depth = "foreground" - }, - { - id = 4, - type = "whole", - depth = "foreground" - }, - { - id = 5, - type = "whole", - depth = "foreground" - }, - { - id = 6, - type = "whole", - depth = "foreground" - }, - { - id = 7, - type = "whole", - depth = "foreground" - }, - { - id = 8, - type = "whole", - depth = "foreground" - }, - { - id = 9, - type = "whole", - depth = "foreground" - }, - { - id = 10, - type = "half_bottom", - depth = "foreground" - }, - { - id = 11, - type = "half_bottom", - depth = "foreground" - }, - { - id = 12, - type = "whole", - depth = "foreground" - }, - { - id = 13, - type = "whole", - depth = "foreground" - }, - { - id = 14, - type = "whole", - depth = "foreground" - }, - { - id = 15, - type = "half_right", - depth = "foreground" - }, - { - id = 16, - type = "half_left", - depth = "foreground" - }, - { - id = 17, - type = "half_bottom", - depth = "foreground" - }, - { - id = 18, - type = "half_top", - depth = "foreground" - }, - { - id = 19, - type = "whole", - depth = "foreground" - }, - { - id = 20, - type = "whole", - depth = "foreground" - }, - { - id = 21, - type = "whole", - depth = "foreground" - }, - { - id = 22, - type = "whole", - depth = "foreground" - }, - { - id = 23, - type = "half_top", - depth = "foreground" - }, - { - id = 24, - type = "half_top", - depth = "foreground" - }, - { - id = 25, - type = "whole", - depth = "foreground" - }, - { - id = 26, - type = "whole", - depth = "foreground" - }, - { - id = 27, - type = "ramp2_bot_right_half", - depth = "foreground" - }, - { - id = 28, - type = "ramp2_bot_right_whole", - depth = "foreground" - }, - { - id = 29, - type = "whole", - depth = "foreground" - }, - { - id = 30, - type = "whole", - depth = "foreground" - }, - { - id = 31, - type = "ramp2_bot_left_whole", - depth = "foreground" - }, - { - id = 32, - type = "ramp2_bot_left_half", - depth = "foreground" - }, - { - id = 33, - type = "empty", - depth = "foreground" - }, - { - id = 34, - type = "empty", - depth = "foreground" - }, - { - id = 35, - type = "empty", - depth = "foreground" - }, - { - id = 36, - type = "empty", - depth = "foreground" - }, - { - id = 37, - type = "empty", - depth = "foreground" - }, - { - id = 38, - type = "empty", - depth = "foreground" - }, - { - id = 39, - type = "whole", - depth = "foreground" - }, - { - id = 40, - type = "empty", - depth = "foreground" - }, - { - id = 41, - type = "empty", - depth = "foreground" - }, - { - id = 42, - type = "empty", - depth = "foreground" - }, - { - id = 43, - type = "empty", - depth = "foreground" - }, - { - id = 44, - type = "empty", - depth = "foreground" - }, - { - id = 45, - type = "empty", - depth = "foreground" - }, - { - id = 46, - type = "empty", - depth = "foreground" - }, - { - id = 47, - type = "empty", - depth = "foreground" - }, - { - id = 48, - type = "empty", - depth = "foreground" - }, - { - id = 49, - type = "whole", - depth = "foreground" - }, - { - id = 50, - type = "whole", - depth = "foreground" - }, - { - id = 51, - type = "whole", - depth = "foreground" - }, - { - id = 52, - type = "whole", - depth = "foreground" - }, - { - id = 53, - type = "empty", - depth = "foreground" - }, - { - id = 54, - type = "empty", - depth = "foreground" - }, - { - id = 55, - type = "empty", - depth = "foreground", - light = 60 - }, - { - id = 56, - type = "empty", - depth = "foreground" - }, - { - id = 57, - type = "empty", - depth = "foreground" - }, - { - id = 58, - type = "empty", - depth = "foreground" - }, - { - id = 59, - type = "empty", - depth = "foreground" - }, - { - id = 60, - type = "empty", - depth = "foreground" - }, - { - id = 61, - type = "empty", - depth = "foreground" - }, - { - id = 62, - type = "empty", - depth = "foreground" - }, - { - id = 63, - type = "empty", - depth = "foreground" - }, - { - id = 64, - type = "empty", - depth = "foreground" - }, - { - id = 65, - type = "whole", - depth = "foreground" - }, - { - id = 66, - type = "whole", - depth = "foreground" - }, - { - id = 67, - type = "whole", - depth = "foreground" - }, - { - id = 68, - type = "whole", - depth = "foreground" - }, - { - id = 119, - type = "whole", - depth = "foreground" - } +local properties = {} + +properties[1] = { + type = "whole", + depth = "foreground" } + +properties[2] = { + type = "whole", + depth = "foreground" +} + +properties[3] = { + type = "whole", + depth = "foreground" +} + +properties[4] = { + type = "whole", + depth = "foreground" +} + +properties[5] = { + type = "whole", + depth = "foreground" +} + +properties[6] = { + type = "whole", + depth = "foreground" +} + +properties[7] = { + type = "whole", + depth = "foreground" +} + +properties[8] = { + type = "whole", + depth = "foreground" +} + +properties[9] = { + type = "whole", + depth = "foreground" +} + +properties[10] = { + type = "half_bottom", + depth = "foreground" +} + +properties[11] = { + type = "half_bottom", + depth = "foreground" +} + +properties[12] = { + type = "whole", + depth = "foreground" +} + +properties[13] = { + type = "whole", + depth = "foreground" +} + +properties[14] = { + type = "whole", + depth = "foreground" +} + +properties[15] = { + type = "half_right", + depth = "foreground" +} + +properties[16] = { + type = "half_left", + depth = "foreground" +} + +properties[17] = { + type = "half_bottom", + depth = "foreground" +} + +properties[18] = { + type = "half_top", + depth = "foreground" +} + +properties[19] = { + type = "whole", + depth = "foreground" +} + +properties[20] = { + type = "whole", + depth = "foreground" +} + +properties[21] = { + type = "whole", + depth = "foreground" +} + +properties[22] = { + type = "whole", + depth = "foreground" +} + +properties[23] = { + type = "half_top", + depth = "foreground" +} + +properties[24] = { + type = "half_top", + depth = "foreground" +} + +properties[25] = { + type = "whole", + depth = "foreground" +} + +properties[26] = { + type = "whole", + depth = "foreground" +} + +properties[27] = { + type = "ramp2_bot_right_half", + depth = "foreground" +} + +properties[28] = { + type = "ramp2_bot_right_whole", + depth = "foreground" +} + +properties[29] = { + type = "whole", + depth = "foreground" +} + +properties[30] = { + type = "whole", + depth = "foreground" +} + +properties[31] = { + type = "ramp2_bot_left_whole", + depth = "foreground" +} + +properties[32] = { + type = "ramp2_bot_left_half", + depth = "foreground" +} + +properties[33] = { + type = "empty", + depth = "foreground" +} + +properties[34] = { + type = "empty", + depth = "foreground" +} + +properties[35] = { + type = "empty", + depth = "foreground" +} + +properties[36] = { + type = "empty", + depth = "foreground" +} + +properties[37] = { + type = "empty", + depth = "foreground" +} + +properties[38] = { + type = "empty", + depth = "foreground" +} + +properties[39] = { + type = "whole", + depth = "foreground" +} + +properties[40] = { + type = "empty", + depth = "foreground" +} + +properties[41] = { + type = "empty", + depth = "foreground" +} + +properties[42] = { + type = "empty", + depth = "foreground" +} + +properties[43] = { + type = "empty", + depth = "foreground" +} + +properties[44] = { + type = "empty", + depth = "foreground" +} + +properties[45] = { + type = "empty", + depth = "foreground" +} + +properties[46] = { + type = "empty", + depth = "foreground" +} + +properties[47] = { + type = "empty", + depth = "foreground" +} + +properties[48] = { + type = "empty", + depth = "foreground" +} + +properties[49] = { + type = "whole", + depth = "foreground" +} + +properties[50] = { + type = "whole", + depth = "foreground" +} + +properties[51] = { + type = "whole", + depth = "foreground" +} + +properties[52] = { + type = "whole", + depth = "foreground" +} + +properties[53] = { + type = "empty", + depth = "foreground" +} + +properties[54] = { + type = "empty", + depth = "foreground" +} + +properties[55] = { + type = "empty", + depth = "foreground", + light = 60 +} + +properties[56] = { + type = "empty", + depth = "foreground" +} + +properties[57] = { + type = "empty", + depth = "foreground" +} + +properties[58] = { + type = "empty", + depth = "foreground" +} + +properties[59] = { + type = "empty", + depth = "foreground" +} + +properties[60] = { + type = "empty", + depth = "foreground" +} + +properties[61] = { + type = "empty", + depth = "foreground" +} + +properties[62] = { + type = "empty", + depth = "foreground" +} + +properties[63] = { + type = "empty", + depth = "foreground" +} + +properties[64] = { + type = "empty", + depth = "foreground" +} + +properties[65] = { + type = "whole", + depth = "foreground" +} + +properties[66] = { + type = "whole", + depth = "foreground" +} + +properties[67] = { + type = "whole", + depth = "foreground" +} + +properties[68] = { + type = "whole", + depth = "foreground" +} + +properties[119] = { + type = "whole", + depth = "foreground" +} + +return properties