nefD/impact-tween — pull request #4 by damassi (2013-09-05 03:39:07+00:00)
Title: Returned reference to tweenTarget in onComplete

Useful for situations where runtime property evaluation is necessary without a clear reference to the original object performing the tween. With .chain() ref properties are evaluated at the time of instantiation, and no longer accurately describe the game-world.

For example,

```
var player = this.getEntitiesByType( EntityPlayer )[0];
var enemy = this.getEntitiesByType( EntityEnemy )[0];

var jumpTween = player.tween({ y: player.pos.y + 100}, .5 );
var landOnEnemyTween = player.tween({ y: enemy.pos.y }, .5 );

jumpTween.chain( landOnEnemyTween )

// After the first tween starts, the second, chained tween has a y-pos ref to an enemy that may have moved to a new location
jumpTween.start()
```

This pull request fixes this by allowing for something like

```
player.tween({ y: player.pos.y + 100 }, .5, {
onComplete: function( target ) {

// This will accurately return the enemy pos and tween the original target which may or may not have been lost (think, iterating over instances a for loop)
target.tween({ y: enemy.pos.y }, .5 )
}
);
```