short attention span
home
luminance
project blogs
documentation
video clips
behind the screen
links
contact us


A modified version of wandering dots. This retains the basic wandering behavior as well as a modified version of the Barslund Repulsion code. The guts of this algorithm, modified by us, are:

xDif = _root._xmouse-this._x;
yDif = _root._ymouse-this._y;
distance = Math.sqrt(xDif*xDif+yDif*yDif);
if(distance < 120){
tempX = this._x-(force/distance)*(xDif/distance);
tempY = this._y-(force/distance)*(yDif/distance);
this._x=(((this._x-(vx))-this._x)/2+tempX);
this._y=(((this._y-(vy))-this._y)/2+tempY);
}

back to Behind the Screen

Last Update Date: March 15, 2005



Creative Commons License
This work is licensed under a Creative Commons License.