Basic export system (press S to display level in terminal)

This commit is contained in:
KikooDX 2020-02-22 20:09:01 +01:00
parent 6b089e4e43
commit ce76188407
3 changed files with 15 additions and 0 deletions

View File

@ -21,6 +21,7 @@ function update_keyboard()
local buffer = k_s
k_s = love.keyboard.isDown("s")
if k_s and not buffer then
print(save())
end
local buffer = k_o
k_o = love.keyboard.isDown("o")

View File

@ -5,4 +5,5 @@ function love.load()
require("mouse")
require("keyboard")
require("tiles")
require("save")
end

13
save.lua Normal file
View File

@ -0,0 +1,13 @@
function save()
output = "\n-"
for i = 1, 28, 1 do output = "-"..output end
for i = 1, #selected_screen, 1 do
output = output..selected_screen:sub(i, i)
if i % 26 == 0 then output = output.."-\n-" end
end
for i = 1, 26, 1 do output = output.."-" end
return output
end
function load()
end