Here's an issue I'm having. I'm using GraalControl.onMouseDown() and call a function from within side this. Now within this function I call another and same again in the next function. The params in getDist() are always the params of onMouseDown(), not the ones I send.
PHP Code:
function GraalControl.onMouseDown()
{
doActions();
}
function doActions()
{
someFunction();
}
function someFunction()
{
temp.dist = getDist( player.x, temp.nx);
}
function getDist( temp.x1, temp.x2, temp.y1, temp.y2)
{
if ( params.size() == 4)
return (((( temp.x2 - temp.x1) ^ 2) + (( temp.y2 - temp.y1) ^ 2)) ^ 0.5);
if ( params.size() == 2)
return ((( temp.x2 - temp.x1) ^ 2) ^ 0.5);
}
Basically in getDist the params are that of onMouseDown() regardless.