So I’m using the .fla attached as a basis for an image scroller (thanks TheCanadian!) and I was just wondering what the process would be to invert it so the “follow” MC is being repelled by the mouse, rather than attracted.
Here’s the code for quick reference…
“follow” is the MC following the mouse and “bounds” is the area in which “follow” can move freely.
follow.onEnterFrame = function() {
this._x += (Math.max(bounds._x + this._width / 2, Math.min(_xmouse, bounds._x + bounds._width - this._width / 2)) - this._x) / 5;
this._y += (Math.max(bounds._y + this._height / 2, Math.min(_ymouse, bounds._y + bounds._height - this._height / 2)) - this._y) / 5;
};
Thanks!