Fixed indentation from spaces to tabs, and cleaned up the code a bit.

This commit is contained in:
David Gomes 2012-06-09 23:17:13 +02:00
parent e1be2f1b7c
commit 778e2c82b0

View File

@ -2,8 +2,6 @@
--
-- simple LIVECODING environment with löve, overwrites love.run, pressing all errors to the terminal/console
local lick = {}
lick.file = "main.lua"
lick.debug = false
@ -31,16 +29,17 @@ local function update(dt)
lick.debugoutput = chunk .. "\n"
end
ok,err = xpcall(chunk, handle)
if not ok then
print(tostring(err))
if lick.debugoutput then
lick.debugoutput = (lick.debugoutput .."ERROR: ".. err .. "\n" )
else lick.debugoutput = err .. "\n" end
end
if ok then
else
print("CHUNK LOADED\n")
lick.debugoutput = nil
end
if lick.reset then
loadok, err = xpcall(love.load, handle)
if not loadok and not loadok_old then
@ -74,6 +73,7 @@ local function draw()
lick.debugoutput = (lick.debugoutput .. err .. "\n" )
else lick.debugoutput = err .. "\n" end
end
if lick.debug and lick.debugoutput then
love.graphics.setColor(255,255,255,120)
love.graphics.printf(lick.debugoutput, (love.graphics.getWidth()/2)+50, 0, 400, "right")
@ -83,12 +83,10 @@ end
function love.run()
math.randomseed(os.time())
math.random() math.random()
load()
local dt = 0
-- Main loop time.
@ -105,6 +103,7 @@ function love.run()
return
end
end
love.handlers[e](a,b,c,d)
end
end
@ -124,9 +123,7 @@ function love.run()
if love.timer then love.timer.sleep(0.001) end
if love.graphics then love.graphics.present() end
end
end
return lick