I have two lua scripts which represents levels.
Each time a level is loaded it's respective StartLevel script
is called in another thread like this:
*thr = lua_newthread(LuaMain);
0, 0, 0);
In first script I'm trying to call C function
(StartExplosion) and then I want to wait until it's over.
After that I'm trying to start that coroutine again to load
another level (LoadLevel) function.
I've tried returning lua_yield() from StartExplosion function
and then calling lua_resume from main game loop after 10s have
elapsed, but it doesn't work at all.
It seems that I need to use lua_pcallk but there is no
example how to use it, can you please help me by writing a small
Or is it done in a completely different way?
my lua function looks like this: