Have a Level class that holds most of the logic of how your game works. Create an instance of that Level to play in it and when you have to transition just create another instance and store or delete the first one.
If you want to be able to store the state of a level after you left (such as enemies killed, items picked up/destroyed) so that when you load it again that state is also loaded (instead of rebuilding the whole level again), then yes. Otherwise you can just do it without saving anything and consequently without using the filesystem.
map = "map1" --the current map
mapTable = {}
function map_add(name,picture)
table.insert(mapTable,{name = name,picture = picture})
end
--this function draws the map(s)
function map_draw()
for i,v in ipairs(mapTable) do
if v.x == map then
love.graphics.draw(v.picture,0,0)
end
end
end
--the list of maps
function map_list()
function map_add("map1",pic1)
function map_add("map2",pic2)
end
in order to understand this simple example you need to know how to draw and load a picture and also know how to use "tables".
I am one of the people who are working with Jack in this game.
But we do not know really make a game. So we would like to know how we can do to add more levels in our game.
We have several versions of the game, each with a different level, but we do not know how to put it all together, do not know how to identify the player reached the end of the level, not as we do to end a level and start again.