Advertisement Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

More scripting stuff

Sign in to follow this  


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
// 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  


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

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!