lua-users home
lua-l archive

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


Hello.

How do I call a compiled chunk by the original file
name?

For example, I have the files:

Enemy1.lua
  some code..
  

Enemy2.lua
  some code..


etc...


I compile the files:

luac -o enemies.dat Enemy1.lua Enemy2.lua ...

Then, in C or Lua code, I would like to call the code
in some archive, for example, Enemy1.lua.

I wouldn't like to create a function for each enemy,
like this:

function Enemy1()
  some code..
end
  

function Enemy2()
  some code..
end


then call Enemy1().




______________________________________________________________________

Yahoo! GeoCities: 15MB de espaço grátis para criar seu web site!
http://br.geocities.yahoo.com/