sonic-radiance/sonic-radiance.love/game/modules/utils/init.lua

19 lines
492 B
Lua
Raw Normal View History

2019-07-26 17:36:25 +02:00
local gameutils = {}
function gameutils.getMapPath(maptype, mapname)
local dir = gameutils.getMapDirectory(maptype, mapname)
local path = dir .. "map.lua"
core.debug:print("game/utils", "path is " .. path)
return path
2019-07-26 17:36:25 +02:00
end
function gameutils.getMapDirectory(maptype, mapname)
if (maptype ~= "battle") and (maptype ~= "sti") then
2019-07-26 17:36:25 +02:00
error("Map type " .. maptype .. " doesn't exist.")
end
return "datas/gamedata/maps/" .. maptype .. "/" .. mapname .. "/"
end
return gameutils