[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: coroutines
- From: "Nick Trout" <nick@...>
- Date: Mon, 22 Nov 2004 16:12:23 -0800
> I'd like to have my game ai (it's a shoot em up) running as scripts.
> I've figured what I want to do is use coroutines. I've looked them
> got a handle on how they work from the lua script side but how does
> tie up with the C side? What's the best way of calling scripts?
> wouldn't dofile be a bad idea in game? if not dostring?
There is an example of coroutines in Doris. See http://doris.sf.net/
You'll need to get the coroutine example from CVS:
Look at the gravity.lua example. It's lots of objects under the
influence of each others mass.
Doris is bound to OpenGL so this is an example of how you run a main
loop using GLUT, with Lua listening to update callbacks and then calling
GL. You could write your game using GL and Doris using a similar set up
to the one here.
I'm, very slowly admittedly, adding SDL and network support to Doris so
it should have sound, joystick and net support in the future.