feat: add some map utils
This commit is contained in:
parent
37036760a3
commit
27cf265287
1 changed files with 19 additions and 0 deletions
19
sonic-radiance.love/game/modules/utils/init.lua
Normal file
19
sonic-radiance.love/game/modules/utils/init.lua
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
local gameutils = {}
|
||||||
|
|
||||||
|
function gameutils.getMapPath(maptype, mapname)
|
||||||
|
if (maptype ~= "battle") then
|
||||||
|
error("Map type " .. maptype .. " doesn't exist.")
|
||||||
|
end
|
||||||
|
|
||||||
|
return "datas.gamedata.maps." .. maptype .. "." .. mapname
|
||||||
|
end
|
||||||
|
|
||||||
|
function gameutils.getMapDirectory(maptype, mapname)
|
||||||
|
if (maptype ~= "battle") then
|
||||||
|
error("Map type " .. maptype .. " doesn't exist.")
|
||||||
|
end
|
||||||
|
|
||||||
|
return "datas/gamedata/maps/" .. maptype .. "/" .. mapname .. "/"
|
||||||
|
end
|
||||||
|
|
||||||
|
return gameutils
|
Loading…
Reference in a new issue