dcearth/main.lua

30 lines
792 B
Lua

local love = assert( love, "This tool requires LOVE: love2d.org" )
local map = require 'map'
local SAVEDIRECTORY = "out/"
function love.load()
local lfs = assert( love.filesystem )
lfs.setIdentity( "dcearth", false )
assert( lfs.createDirectory( SAVEDIRECTORY.."data/earth" ))
assert( lfs.createDirectory( SAVEDIRECTORY.."data/graphics" ))
map.load()
end
local canvas = love.graphics.newCanvas()
function love.update( dt )
love.graphics.setCanvas( canvas )
map.draw()
love.graphics.setCanvas()
end
function love.draw()
love.graphics.draw( canvas )
end
function love.keypressed(key)
if key == "s" then
-- To open a file or folder, "file://" must be prepended to the path.
love.system.openURL("file://"..love.filesystem.getSaveDirectory())
end
end