lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,

For my hobby game project (or a portfolio to get a job), I'm trying 
to use Lua-4.0.1 to control in-game characters. A Lua program would 
be:


pion={}
function pion.LookAt
   goto(100, 120) -- move PC in front of this NPC
   message("You see a strange looking man.")
end


The problem is, if I just call function pion.LookAt, message will be 
shown before the player character going to the position (100, 120). I 
want the PC to go to the position (100, 120) first and then the 
message get displayed. 

I heard there's a 'coroutine' feature in Lua, but that's all 
infomation I have in my hand.

Is there any documents/tutorials/sources on the web for me to solve 
the problem? Can anyone help me?

Thank you in advance.


Won-Seok "Pion" Chang