PHP Code:
NPC A:
function onMoved( initx, inity, newx, newy )
{
dx = newx - initx;
dy = newy - inity;
for ( item: this.items )
{
with ( item )
{
this.x += dx;
this.y += dy;
this.trigger( "Moved","" );
}
}
}
PHP Code:
NPC 'item':
function onMoved()
{
this.x = this.x;
this.y = this.y;
}
... Without this, when setting item.x += dx, the item position doesn't update. It only does when you actually set it this.x = this.x; in it's own script. Awkward character of GS2!