Game Development Community

how to setup a cs file to store all the global variable,and which folder should the file be located

by jack518 · in Torque Game Engine Advanced · 09/07/2009 (6:46 am) · 1 replies

Hi, I am a beginer of TGB, here i am in trouble by some problems, when i tried to put all the global variable in a cs file named arg.cs and put this file in the folder of game. and execute it in this way:

codes in arg.cs file

$camarea=SceneWindow2D.getCurrentCameraArea();
$bgarea=background.getAreaMax(); // background is some object name

some part of codes in main.cs file under the game folder

function initializeProject()
{
// Load up the in game gui.
exec("~/gui/mainScreen.gui");

// Exec game scripts.
exec("./gameScripts/game.cs");
exec("./arg.cs");
......
}

The problem is that I can not get the right answers when i checked the values of $camarea and $bgarea by
echo($camarea);
echo($bgarea);

Actually for $camerea should be -400 -400 400 400 and $bgarea should be 300 300, but the answers were always -50.000 -37.5000 50.000 37.5000 and 50.000 37.5000

Is there anything wrong with the location of arg.cs file or .. what other reasons?

Best thanks


#1
09/07/2009 (7:03 am)
Quote:I am a beginer of TGB

Wrong forum mate ... try the TGB forum.

Secondly you need to reduce the length of your topic ... it is extremely annoying to have such a long topic.