# Mouse seeking sharks

**URL:** <https://forum.kirupa.com/t/mouse-seeking-sharks/175661>\
**Category:** Uncategorized\
**Created:** [January 16, 2006, 9:21pm UTC](https://forum.kirupa.com/t/mouse-seeking-sharks/175661 "2006-01-16T21:21:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![McGiver](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@McGiver](https://forum.kirupa.com/u/McGiver)\
**Post date:** [January 16, 2006, 9:21pm UTC](https://forum.kirupa.com/t/mouse-seeking-sharks/175661/1 "2006-01-16T21:21:34Z")

</div>

they circle slowly around your mouse - sharks have time, and your cursor smells very appetising.  
Hold down the left mouse button and your cursor will dissappear … the sharks get confused and will look where it’s gone.

```auto
Formarray = [0, 0, 3.5, 3, 1.5, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 6, 7, 11, 8.5, 9, 8, 6, 3];
onMouseDown = function () {
	mod = 270;
	Mouse.hide()
};
onMouseUp = function () {
	mod = 0;
	Mouse.show()
};
onEnterFrame = function () {
	for (fn=1; fn<=3; fn++) {
		npangle = (Math.atan((((_root["mpointarr"+fn] == undefined) ? _root["mpointarr"+fn]=[0, 0, 0, 0] : _root["mpointarr"+fn])[i+1]-_ymouse)/(_xmouse-_root["mpointarr"+fn]*))/(Math.PI/180)+(((_xmouse-_root["mpointarr"+fn]*)>=0) ? ((_xmouse-_root["mpointarr"+fn]*)>=0 && (_root["mpointarr"+fn][i+1]-_ymouse)>=0) ? 540 : 180 : 0))+360+mod*Math.cos(Math.PI*fn);
		(Math.sqrt(Math.pow(_xmouse-_root["mpointarr"+fn]*, 2)+Math.pow(_root["mpointarr"+fn][i+1]-_ymouse, 2))>40 && !_root["task"+fn]>0) ? 1 : ((_root["task"+fn]>0) ? _root["task"+fn]-- : _root["task"+fn]=60);
		(Math.sqrt(Math.pow(_xmouse-_root["mpointarr"+fn]*, 2)+Math.pow(_root["mpointarr"+fn][i+1]-_ymouse, 2))>40 && !_root["task"+fn]>0) ? _root["mpointarr"+fn].push(Math.cos(Math.PI*fn)*Math.sin((npangle-15*Math.cos(Math.PI*fn)+3*fn)*Math.PI/180)*(4-fn/20)+_root["mpointarr"+fn][i+2]) : _root["mpointarr"+fn].push(Math.cos((npangle+15*Math.cos(Math.PI*fn)+3*fn)*Math.PI/180)*(4-fn/20)+_root["mpointarr"+fn][i+2]);
		(Math.sqrt(Math.pow(_xmouse-_root["mpointarr"+fn]*, 2)+Math.pow(_root["mpointarr"+fn][i+1]-_ymouse, 2))>40 && !_root["task"+fn]>0) ? _root["mpointarr"+fn].push(Math.cos(Math.PI*fn)*Math.cos((npangle-15*Math.cos(Math.PI*fn)+3*fn)*Math.PI/180)*(4-fn/20)+_root["mpointarr"+fn][i+3]) : _root["mpointarr"+fn].push(Math.sin((npangle+15*Math.cos(Math.PI*fn)+3*fn)*Math.PI/180)*(4-fn/20)+_root["mpointarr"+fn][i+3]);
		(_root["mpointarr"+fn].length>40) ? _root["mpointarr"+fn].splice(0, _root["mpointarr"+fn].length-40) : 1;
		for (createEmptyMovieClip("fish"+fn, 70+fn+(i=0)); i<_root["mpointarr"+fn].length-4; i += 2) {
			angle2 = (Math.atan((_root["mpointarr"+fn][i+3]-_root["mpointarr"+fn][i+1])/(_root["mpointarr"+fn]*-_root["mpointarr"+fn][i+2]))/(Math.PI/180)+(((_root["mpointarr"+fn]*-_root["mpointarr"+fn][i+2])>=0) ? ((_root["mpointarr"+fn]*-_root["mpointarr"+fn][i+2])>=0 && (_root["mpointarr"+fn][i+3]-_root["mpointarr"+fn][i+1])>=0) ? 540 : 180 : 0));
			angle22 = (Math.atan((_root["mpointarr"+fn][i+5]-_root["mpointarr"+fn][i+3])/(_root["mpointarr"+fn][i+2]-_root["mpointarr"+fn][i+4]))/(Math.PI/180)+(((_root["mpointarr"+fn][i+2]-_root["mpointarr"+fn][i+4])>=0) ? ((_root["mpointarr"+fn][i+2]-_root["mpointarr"+fn][i+4])>=0 && (_root["mpointarr"+fn][i+5]-_root["mpointarr"+fn][i+3])>=0) ? 540 : 180 : 0));
			_root["fish"+fn].beginFill(0x000000, 100);
			_root["fish"+fn].moveTo(Math.sin(angle2*Math.PI/180)*Formarray[i/2+2]+_root["mpointarr"+fn][i+2], Math.cos(angle2*Math.PI/180)*Formarray[i/2+2]+_root["mpointarr"+fn][i+3]);
			_root["fish"+fn].lineTo(Math.sin(angle22*Math.PI/180)*Formarray[i/2+3]+_root["mpointarr"+fn][i+4], Math.cos(angle22*Math.PI/180)*Formarray[i/2+3]+_root["mpointarr"+fn][i+5]);
			_root["fish"+fn].curveTo(_root["mpointarr"+fn][i+2], _root["mpointarr"+fn][i+3], Math.sin((angle22+180)*Math.PI/180)*Formarray[i/2+3]+_root["mpointarr"+fn][i+4], Math.cos((angle22+180)*Math.PI/180)*Formarray[i/2+3]+_root["mpointarr"+fn][i+5]);
			_root["fish"+fn].lineTo(Math.sin((angle2+180)*Math.PI/180)*Formarray[i/2+2]+_root["mpointarr"+fn][i+2], Math.cos((angle2+180)*Math.PI/180)*Formarray[i/2+2]+_root["mpointarr"+fn][i+3]);
			_root["fish"+fn].curveTo(_root["mpointarr"+fn]*, _root["mpointarr"+fn][i+1], Math.sin(angle2*Math.PI/180)*Formarray[i/2+2]+_root["mpointarr"+fn][i+2], Math.cos(angle2*Math.PI/180)*Formarray[i/2+2]+_root["mpointarr"+fn][i+3]);
		}
		_root["fish"+fn].lineStyle(1, 0xffffff, 50);
		(_root["mpointarr"+fn].length>26) ? _root["fish"+fn].moveTo(_root["mpointarr"+fn][20], _root["mpointarr"+fn][21]) : 1;
		(_root["mpointarr"+fn].length>26) ? _root["fish"+fn].curveTo(_root["mpointarr"+fn][22], _root["mpointarr"+fn][23],_root["mpointarr"+fn][24], _root["mpointarr"+fn][25]) : 1;
		(_root["mpointarr"+fn].length>12) ? _root["fish"+fn].moveTo(_root["mpointarr"+fn][8], _root["mpointarr"+fn][9]) : 1;
		(_root["mpointarr"+fn].length>12) ? _root["fish"+fn].lineTo(_root["mpointarr"+fn][10], _root["mpointarr"+fn][11]) : 1;
	}
};

```

again something I did before - far less complex than the BF compiler, but probably worth wasting a little time 😉

see also  
[COLOR=“DarkOrange”]-\>[flower chain](http://www.kirupa.com/forum/showthread.php?t=205347)  
-\>[Bf compiler/interpreter](http://www.kirupa.com/forum/showthread.php?t=205641)[/COLOR]
