c++ - How can I implement scripting in my game? -
I'm trying to write a game and implement scripting so that in later development I can compile everything I do not need to change the number I want to change.
My problem is that I do not know how to interact with the script game. The scripting language I am using is that.
Right now, I have a state: Introduction state, which I use for most modules in my game "engine" (this is more like a loose collection of classes) and it will load Drag and drop text, and use scripting to update itself, and later switch to the dummy status to check for the State Manager.
While writing this, I realized that for using most of the script, I need to use the script, and take a lot of code into the scripting language. Most part of the + part was to work, and the scripting language comes with numbers to use in sources / drawing / whatever.
However, if I am fine, doing so in this way can contain many different update modules for most things in the game, which needs to be updated, and they need it That they all be loaded, and C ++ code will have to run each update function individually.
Or, there is a way to gain script and program interoperability which I am ignoring. Either way, does anyone help me to explain that what is the best way to implement scripting in my game?
There is really no correct answer to such a big question, you do it in the same way Define the API that the engine / game logic separator will do in C ++ define the script that allows it to do whatever you want. Register the scripts with the script in that API, and use the ADI as ADI. That API should be completely dependent on your needs and what type of power you want to give a scripter.
Comments
Post a Comment