I didn't designed the maps. They are "borrowed" from the CPC sokoban version.
Ofc I will add more maps than the 10 already included.
But you are welcome to design more maps, I can include them in next releases, of you can load your own maps with the next command line:
Maps can have any extension, the game engine just reads the file that you provided.
Here you have how the map format works. Some comments included:
Code: Select all
gameMap = nil -- just delete what the map was
mapPreffix = "maps/" -- used for abbreviation
playerImg = { -- images of N, S, W and E player images
["n"] = love.graphics.newImage(mapPreffix .. "guyn.png"),
["s"] = love.graphics.newImage(mapPreffix .. "guys.png"),
["e"] = love.graphics.newImage(mapPreffix .. "guye.png"),
["w"] = love.graphics.newImage(mapPreffix .. "guyw.png")
}
-- Here starts the tiles that will be used in the map for either floor or walls
wall1 = love.graphics.newImage(mapPreffix .. "wall1.png") -- normal
wall2 = love.graphics.newImage(mapPreffix .. "wall2.png") -- pot large
wall3 = love.graphics.newImage(mapPreffix .. "wall3.png") -- pot short
wall4 = love.graphics.newImage(mapPreffix .. "wall4.png") -- pillar red ball up (match with the one below)
wall5 = love.graphics.newImage(mapPreffix .. "wall5.png") -- pillar red ball down (match with the one before)
wall6 = love.graphics.newImage(mapPreffix .. "wall6.png") -- small tombstone "#"
wall7 = love.graphics.newImage(mapPreffix .. "wall7.png") -- broken pedestal
wall8 = love.graphics.newImage(mapPreffix .. "wall8.png") -- squared pillar up (match with the one below)
wall9 = love.graphics.newImage(mapPreffix .. "wall9.png") -- squared pillar down (match with the one before)
wall10 = love.graphics.newImage(mapPreffix .. "wall10.png") -- gate decoration S-W (match with the one below)
wall11 = love.graphics.newImage(mapPreffix .. "wall11.png") -- gate decoration S-E (match with the one below)
wall12 = love.graphics.newImage(mapPreffix .. "wall12.png") -- gate decoration N-W (match with the one below)
wall13 = love.graphics.newImage(mapPreffix .. "wall13.png") -- gate decoration N-E (match with the one before)
black = love.graphics.newImage(mapPreffix .. "black.png")
floor1 = love.graphics.newImage(mapPreffix .. "floor1.png") -- normal
floor2 = love.graphics.newImage(mapPreffix .. "floor2.png") -- greenish
-- images of the boxes and the goals tiles
boxImg = love.graphics.newImage(mapPreffix .. "box.png")
goalImg = love.graphics.newImage(mapPreffix .. "goal.png")
-- starts map definition
gameMap = {
nextMap = "", -- path to the next map
title = "Diamond Crypt 10", -- descriptive title
mapAuthor = "Miguel A. G. Prada", -- map author, some credit are given
sizeX = 16, -- number of tiles in horizontal axis
sizeY = 10, -- in vertical axis
sX = 14, -- player start X pos
sY = 9, -- player start Y pos
aims = 14, -- amount of goals to fullfill
image = { -- this contains the tile images for each board cell
{wall1, wall1, wall1, wall1, wall1, wall1, wall12, wall13, wall1, wall1, wall1, wall1, wall1, wall1, black, black},
{wall1, floor1, floor1, floor1, floor1, wall1, wall10, wall11, floor1, floor1, floor1, floor1, floor1, floor1, wall1, black},
{wall1, floor1, floor1, floor1, floor1, floor1, floor1, floor1, floor1, floor1, floor1, floor1, floor1, floor1, floor1, wall4},
{wall1, floor1, wall8, floor1, floor1, floor1, floor1, floor1, floor1, floor1, floor1, floor1, floor1, wall6, floor1, wall5},
{wall1, floor1, wall9, wall1, wall1, wall6, wall1, floor1, wall1, wall1, floor1, floor1, floor1, floor1, floor1, wall1},
{wall1, floor1, wall1, floor1, floor1, floor1, floor1, floor1, floor1, floor1, floor1, wall7, floor1, floor1, floor1, wall1},
{wall1, floor1, wall8, floor1, wall1, wall1, wall6, wall1, wall1, wall1, floor1, wall1, wall3, floor1, floor1, wall1},
{wall1, floor1, wall9, floor1, floor1, floor1, floor1, floor1, floor1, floor1, floor1, floor1, wall1, floor1, floor1, wall1},
{wall1, wall1, wall1, wall1, wall1, floor1, floor1, floor1, floor1, floor1, floor1, floor1, wall1, floor1, floor1, wall1},
{black, black, black, black, wall1, wall1, wall1, wall1, wall1, wall1, wall1, wall1, wall1, wall1, wall1, wall1}
},
block = { -- this contains which cells are blocking and which not
{"#", "#", "#", "#", "#", "#", " ", "#", "#", "#", "#", "#", "#", "#", " ", " "},
{"#", " ", " ", " ", " ", "#", "#", "#", " ", " ", " ", " ", " ", " ", "#", " "},
{"#", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", "#"},
{"#", " ", "#", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", "#", " ", "#"},
{"#", " ", "#", "#", "#", "#", "#", " ", "#", "#", " ", " ", " ", " ", " ", "#"},
{"#", " ", "#", " ", " ", " ", " ", " ", " ", " ", " ", "#", " ", " ", " ", "#"},
{"#", " ", "#", " ", "#", "#", "#", "#", "#", "#", " ", "#", "#", " ", " ", "#"},
{"#", " ", "#", " ", " ", " ", " ", " ", " ", " ", " ", " ", "#", " ", " ", "#"},
{"#", "#", "#", "#", "#", " ", " ", " ", " ", " ", " ", " ", "#", " ", " ", "#"},
{" ", " ", " ", " ", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#"}
},
box = { -- where the boxes are placed when the map is loaded
{"#", "#", "#", "#", "#", "#", " ", "#", "#", "#", "#", "#", "#", "#", " ", " "},
{"#", " ", " ", " ", " ", "#", "#", "#", " ", " ", " ", " ", " ", " ", "#", " "},
{"#", " ", " ", " ", "b", " ", " ", " ", " ", " ", "b", " ", " ", "b", " ", "#"},
{"#", " ", "#", " ", "b", " ", "b", " ", "b", " ", " ", "b", "b", "#", " ", "#"},
{"#", " ", "#", "#", "#", "#", "#", "b", "#", "#", " ", " ", "b", " ", " ", "#"},
{"#", " ", "#", " ", " ", " ", " ", "b", " ", " ", " ", "#", " ", "b", " ", "#"},
{"#", " ", "#", " ", "#", "#", "#", "#", "#", "#", " ", "#", "#", " ", " ", "#"},
{"#", " ", "#", " ", " ", " ", " ", "b", " ", "b", " ", " ", "#", " ", " ", "#"},
{"#", "#", "#", "#", "#", " ", " ", " ", " ", " ", " ", " ", "#", " ", " ", "#"},
{" ", " ", " ", " ", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#"}
},
goal = { -- where are the goals or places where the player must move the boxes
{"#", "#", "#", "#", "#", "#", " ", "#", "#", "#", "#", "#", "#", "#", " ", " "},
{"#", "g", " ", " ", "g", "#", "#", "#", " ", " ", " ", " ", " ", " ", "#", " "},
{"#", "g", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", "#"},
{"#", "g", "#", "g", " ", " ", " ", " ", " ", " ", " ", " ", " ", "#", " ", "#"},
{"#", "g", "#", "#", "#", "#", "#", " ", "#", "#", " ", " ", " ", " ", " ", "#"},
{"#", "g", "#", " ", " ", " ", " ", " ", " ", " ", " ", "#", " ", " ", " ", "#"},
{"#", "g", "#", " ", "#", "#", "#", "#", "#", "#", " ", "#", "#", " ", " ", "#"},
{"#", "g", "#", " ", " ", " ", " ", " ", " ", " ", " ", "g", "#", "g", "g", "#"},
{"#", "#", "#", "#", "#", " ", " ", " ", " ", " ", " ", "g", "#", " ", "g", "#"},
{" ", " ", " ", " ", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#"}
},
}