Re: How do you use threads?
Posted: Sun Nov 07, 2010 10:28 am
I didn't fail to see it, I just didn't know if zac wanted to use LÖVE.bartbes wrote:I wonder how you guys fail to see it as easy as it is:
I didn't fail to see it, I just didn't know if zac wanted to use LÖVE.bartbes wrote:I wonder how you guys fail to see it as easy as it is:
I had no idea that existed. It's not in 0.6.2 and not included in the love module's index on the Wiki. Are you guys all using 0.7?bartbes wrote:I wonder how you guys fail to see [..] .thread.newThread("input", "input.lua")
A simply console interface for debugging? That's what I assumed.bartbes wrote:I have no idea why you would want to do this.
Yeah it's introduced in 0.7.0. It's on the wiki, just not in the sidebar.Mud wrote: I had no idea that existed. It's not in 0.6.2 and not included in the love module's index on the Wiki. Are you guys all using 0.7?
debug.debug()A simply console interface for debugging? That's what I assumed.
Ahh, very nice.debug.debug()
Because you need to receive command input from a user and run your server's physics and other services simultaneously... And doing that from a graphical input is not only laggy, but a pain to code...bartbes wrote: That being said, I have no idea why you would want to do this.
debug.debug() is almost identical to:Mud wrote:Ahh, very nice.debug.debug()
Code: Select all
debug=function()
while true do
local s=io.stdin:read()
if s=="cont" then break end
local f,e=loadstring(s)
assert(f,e)
assert(pcall(f))
end
end
You're writing a server in LÖVE? That doesn't sound very efficient to me.zac352 wrote:Because you need to receive command input from a user and run your server's physics and other services simultaneously... And doing that from a graphical input is not only laggy, but a pain to code...
Why would I use box2d? We don't get along well.thelinx wrote:You're writing a server in LÖVE? That doesn't sound very efficient to me.zac352 wrote:Because you need to receive command input from a user and run your server's physics and other services simultaneously... And doing that from a graphical input is not only laggy, but a pain to code...
You should just write it in pure Lua. I know I've seen a Box2D library for Lua somewhere...
The best thing I've found is POSIX only. >_<thelinx wrote:You find a thread library for Lua. I don't know any off-hand, so try googling around.