Basically, I'm not new to scripting; but I am new to Lua scripts and integrating it into my C++ programs. Now, I have already found libraries to do that, so everything's fine for that particular concept. My problem, is that I'm not sure what should be scripted. I understand the "logic" should be what's scripted, but I'm not visualizing it in my mind correctly. How should I separate the C++ classes and code from the LUA script's tasks?
Say I am making a 2D car game. The psuedo-C++ file of the car might look something like this:
class Car : public Drawable, Entity
{
public:
Car(...) { ... lua_do("CarLogic.lua") }
void onDraw() { ... }
void onUpdate( ... )
void onEnd() { ... }
}
I am assuming the script wouldn't do anything for onDraw() but am I on the right track for the rest of the functions? Also, what about other auxiliary functions I may want to add? Would I simply define them in the script? What would that look like for one script to define a class? I'm skeptical about the whole thing I suppose.
Thanks so much for any enlightenment on this.