NPC Code:
//ex.
function onCreated() {
dx = 2;
dy = 5;
setTimer(5);
}
function onTimeout() {
distance = inaccurateDistance(9,20);
}
function inaccurateDistance(dx,dy) {
dx-=2
dy-=2
return (dx^2+dy^2) ^0.5;
}
Would the values of dx and dy set in onCreated change in that script because they are set by receiving parameters? Would they change within the function inaccurateDistance?
What would be really nice to hear is that the variable scope of function params remained local to the function.