• Advertisement
Sign in to follow this  
  • entries
    686
  • comments
    1952
  • views
    386918

More scripting stuff

Sign in to follow this  

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 running
if(gameFlagOn("run"))
// do stuff

// get the mouse coordinates
int m_x = getGameVar("mouse_x");
int m_y = getGameVar("mouse_y");

// update the mouse coordinates using SDL event
setGameVar("mouse_x", event.motion.x);
setGameVar("mouse_y", event.motion.y);

// shut the game off
setGameFlag("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.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement