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

More scripting stuff

Sign in to follow this  
Stompy9999

71 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!