I'm desadoc/Erivaldo from Brazil, I'm new to love2D and this is my first post here. Please forgive my english and typos
Early today I wrote some code with resume/yield that didn't work. The code was +- like this:
Code: Select all
-- main.lua
function love.load()
local co = coroutine.create(function() dofile("myscript.lua") end)
coroutine.resume(co)
end
-- myscript.lua
coroutine.yield()
Code: Select all
local function hook(event, line)
print(debug.traceback())
coroutine.yield()
end
local pr = assert(load("print\"hi?\""))
local cr = coroutine.create(pr)
debug.sethook(cr, hook, "clr")
print(coroutine.resume(cr))