31
Technical forum / AddScore function...
« on: January 27, 2007, 01:25:52 AM »
Hi,
I'm implementing a simple scoring feature in the game, but I'm still a bit foggy on how to use your own functions. I've created a pretty simple function for adding to a score text, but I'm not sure WHERE to put it and HOW to use it. I tried sticking it in the game.script file and calling it from a scene object script, but it didn't work. I guess I'm not sure if I have to add an "#include" everywhere I want to use it (a bit tedious) or somehow attach it to a game object...it would be ideal if I could somehow stick the function onto the Game object and just call Game.AddScore() when I need it. Is this possible?
I'm implementing a simple scoring feature in the game, but I'm still a bit foggy on how to use your own functions. I've created a pretty simple function for adding to a score text, but I'm not sure WHERE to put it and HOW to use it. I tried sticking it in the game.script file and calling it from a scene object script, but it didn't work. I guess I'm not sure if I have to add an "#include" everywhere I want to use it (a bit tedious) or somehow attach it to a game object...it would be ideal if I could somehow stick the function onto the Game object and just call Game.AddScore() when I need it. Is this possible?