F1 to change tileset

This commit is contained in:
lustlion 2022-01-30 12:01:10 +01:00
parent a703af5e8d
commit 727592ac55
5 changed files with 383 additions and 353 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -25,6 +25,32 @@ function EditorStep()
Camera.pos.y = Camera.pos.y + 3*game.scale Camera.pos.y = Camera.pos.y + 3*game.scale
end 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 if Keybind:HasPressed(Keybind.debug.reload) then
ExportLevel("test") ExportLevel("test")
end end

View File

@ -133,7 +133,6 @@ levelProperties = {
tileset = { tileset = {
bricks = love.graphics.newImage("assets/tileset/bricks.png"), bricks = love.graphics.newImage("assets/tileset/bricks.png"),
books = love.graphics.newImage("assets/tileset/bricks.png"),
library = love.graphics.newImage("assets/tileset/library.png") library = love.graphics.newImage("assets/tileset/library.png")
} }

View File

@ -2,9 +2,6 @@ function LevelLoadTiles()
LevelData = dofile("Mothback/data/levels/"..currLevel..".lua") LevelData = dofile("Mothback/data/levels/"..currLevel..".lua")
-- tiles data
TileData = dofile("Mothback/data/tileset/library.lua")
--[[ --[[
on level format: on level format:
@ -15,12 +12,21 @@ function LevelLoadTiles()
overlay_depth = foreground/background overlay depth overlay_depth = foreground/background overlay depth
type = collision type type = collision type
]] ]]
LevelGetTileData()
LevelTiles = LevelData.tiles LevelTiles = LevelData.tiles
LevelUpdateDimensions() LevelUpdateDimensions()
LevelIndexTiles() LevelIndexTiles()
TileCreateObjects() TileCreateObjects()
end 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() function LevelReloadTiles()
LevelUpdateDimensions() LevelUpdateDimensions()
TileCreateObjects() TileCreateObjects()

View File

@ -1,350 +1,349 @@
return { local properties = {}
{
id = 1, properties[1] = {
force = 0,
overlay_tileset = tileset.books,
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 2, properties[2] = {
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 3, properties[3] = {
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 4, properties[4] = {
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 5, properties[5] = {
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 6, properties[6] = {
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 7, properties[7] = {
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 8, properties[8] = {
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 9, properties[9] = {
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 10, properties[10] = {
type = "half_bottom", type = "half_bottom",
depth = "foreground" depth = "foreground"
}, }
{
id = 11, properties[11] = {
type = "half_bottom", type = "half_bottom",
depth = "foreground" depth = "foreground"
}, }
{
id = 12, properties[12] = {
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 13, properties[13] = {
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 14, properties[14] = {
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 15, properties[15] = {
type = "half_right", type = "half_right",
depth = "foreground" depth = "foreground"
}, }
{
id = 16, properties[16] = {
type = "half_left", type = "half_left",
depth = "foreground" depth = "foreground"
}, }
{
id = 17, properties[17] = {
type = "half_bottom", type = "half_bottom",
depth = "foreground" depth = "foreground"
}, }
{
id = 18, properties[18] = {
type = "half_top", type = "half_top",
depth = "foreground" depth = "foreground"
}, }
{
id = 19, properties[19] = {
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 20, properties[20] = {
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 21, properties[21] = {
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 22, properties[22] = {
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 23, properties[23] = {
type = "half_top", type = "half_top",
depth = "foreground" depth = "foreground"
}, }
{
id = 24, properties[24] = {
type = "half_top", type = "half_top",
depth = "foreground" depth = "foreground"
}, }
{
id = 25, properties[25] = {
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 26, properties[26] = {
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 27, properties[27] = {
type = "ramp2_bot_right_half", type = "ramp2_bot_right_half",
depth = "foreground" depth = "foreground"
}, }
{
id = 28, properties[28] = {
type = "ramp2_bot_right_whole", type = "ramp2_bot_right_whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 29, properties[29] = {
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 30, properties[30] = {
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 31, properties[31] = {
type = "ramp2_bot_left_whole", type = "ramp2_bot_left_whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 32, properties[32] = {
type = "ramp2_bot_left_half", type = "ramp2_bot_left_half",
depth = "foreground" depth = "foreground"
}, }
{
id = 33, properties[33] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 34, properties[34] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 35, properties[35] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 36, properties[36] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 37, properties[37] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 38, properties[38] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 39, properties[39] = {
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 40, properties[40] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 41, properties[41] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 42, properties[42] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 43, properties[43] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 44, properties[44] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 45, properties[45] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 46, properties[46] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 47, properties[47] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 48, properties[48] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 49, properties[49] = {
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 50, properties[50] = {
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 51, properties[51] = {
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 52, properties[52] = {
type = "whole", type = "whole",
depth = "foreground" depth = "foreground"
}, }
{
id = 53, properties[53] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 54, properties[54] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 55, properties[55] = {
type = "empty", type = "empty",
depth = "foreground", depth = "foreground",
light = 60 light = 60
}, }
{
id = 56, properties[56] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 57, properties[57] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 58, properties[58] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 59, properties[59] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 60, properties[60] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 61, properties[61] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 62, properties[62] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 63, properties[63] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 64, properties[64] = {
type = "empty", type = "empty",
depth = "foreground" depth = "foreground"
}, }
{
id = 65, properties[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", type = "whole",
depth = "foreground" 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