home *** CD-ROM | disk | FTP | other *** search
- function buzzflight(mcp)
- {
- mcp.distx = _level0.dweeb._x - mcp._x;
- mcp.disty = _level0.dweeb._y - (_level0.dweeb._height + 25) - mcp._y;
- if(_level0.dweeb._x < mcp._x)
- {
- mcp._xscale = 100;
- mcp.d = Math.tan(mcp.disty / mcp.distx);
- }
- else
- {
- mcp._xscale = -100;
- mcp.d = Math.tan(mcp.disty / mcp.distx) - 180;
- }
- mcp.xstep = (- mcp.speed) * Math.cos(mcp.d);
- mcp.ystep = mcp.speed * Math.sin(mcp.d);
- if(mcp._y < _level0.dweeb._y)
- {
- mcp._x += mcp.xstep;
- mcp._y -= mcp.ystep;
- }
- else
- {
- mcp._x -= mcp.xstep;
- mcp._y -= mcp.ystep;
- }
- if(mcp.throwrock == true && 0 < mcp._y - mcp._height && (_level0.dweeb._x < mcp._x + mcp._width / 2 && mcp._x - mcp._width / 2 < _level0.dweeb._x))
- {
- _level0.attachMovie("rock","rock" + _level0.itemdepth,_level0.itemdepth);
- _level0["rock" + _level0.itemdepth]._x = mcp._x;
- _level0["rock" + _level0.itemdepth]._y = mcp._y;
- _level0["rock" + _level0.itemdepth].parent = mcp;
- _level0.itemdepth = _level0.itemdepth + 1;
- mcp.throwcount = 12;
- mcp.throwrock = false;
- }
- else if(mcp.throwrock == false)
- {
- mcp.throwcount--;
- if(0 >= mcp.throwcount)
- {
- mcp.throwrock = true;
- }
- }
- if(_level0.maxy < mcp._y)
- {
- for(i in "_level0:itemSet")
- {
- if(mcp == _level0.itemSet[i])
- {
- mcp.index = i;
- }
- }
- _level0.itemSet.splice(mcp.index,1);
- mcp.removeMovieClip();
- }
- }
-