• 11
• 9
• 10
• 9
• 10
• entries
686
1952
• views
386918

# More scripting stuff

63 views

I finished converting most of my global variables to script variables. Now I can access them as strings rather than the actual variable.

For instance:
// check if the game is runningif(gameFlagOn("run"))   // do stuff// get the mouse coordinatesint m_x = getGameVar("mouse_x");int m_y = getGameVar("mouse_y");// update the mouse coordinates using SDL eventsetGameVar("mouse_x", event.motion.x);setGameVar("mouse_y", event.motion.y);// shut the game offsetGameFlag("run", false);

The reason I did this, is for one I wanted to learn a little about scripting(no matter what I can't seem to escape from trying new things). The second reason is that I think it will be easier to write the GUI system now that I have this in place.

In all of this scripting stuff, I forgot to actually make the soldiers be able to fight each other, so that is up next.

There are no comments to display.