[bla bla bla]
if (class == MELEE) then
include("melee.lua");
elseif (class == RANGED) then
include("ranged.lua");
end
[bla bla bla]
function main()
while(1) do
mainloop()
end
end
While the mainloop function resides in both melee.lua and ranged.lua? So different mainloop can be created for each class...
Yes. Lua can be strange when it comes to prototyping functions, so I would suggest NOT creating a default mainloop() and to do exactly like in your own example.