home *** CD-ROM | disk | FTP | other *** search
- moverLine = function()
- {
- var _loc1_ = this;
- _loc1_.actPos += _loc1_.v.pos;
- if(_loc1_.actPos > 1)
- {
- if(_loc1_.moverPingPong)
- {
- _loc1_.actPos = 1;
- _loc1_.v.pos = Math.abs(_loc1_.v.pos) * -1;
- }
- else
- {
- _loc1_.actPos = 0;
- }
- }
- else if(_loc1_.actPos < 0)
- {
- if(_loc1_.moverPingPong)
- {
- _loc1_.actPos = 0;
- _loc1_.v.pos = Math.abs(_loc1_.v.pos);
- }
- else
- {
- _loc1_.actPos = 1;
- }
- }
- _loc1_.x = _loc1_.rootPos.x + _loc1_.actPos * _loc1_.moverDx;
- _loc1_.y = _loc1_.rootPos.y + _loc1_.actPos * _loc1_.moverDy;
- _loc1_.v.x = _loc1_.x - _loc1_._x;
- _loc1_.v.y = _loc1_.y - _loc1_._y;
- _loc1_._x = _loc1_.x;
- _loc1_._y = _loc1_.y;
- if(_loc1_.behaviour == "monster")
- {
- if(_loc1_.v.x > 0)
- {
- _loc1_.gfx.gfx._xscale = Math.abs(_loc1_.gfx.gfx._xscale);
- }
- else
- {
- _loc1_.gfx.gfx._xscale = Math.abs(_loc1_.gfx.gfx._xscale) * -1;
- }
- }
- if(_loc1_.chain)
- {
- _loc1_.chain._height = _loc1_.chain.minHeight + _loc1_.actPos * _loc1_.moverDy;
- }
- };
- moverLineInit = function(mc, engine)
- {
- var _loc1_ = mc;
- _loc1_.d = Math.vectorLength({x:int(_loc1_.moverDx),y:int(_loc1_.moverDy)});
- _loc1_.v = {pos:Number(_loc1_.moverV) / _loc1_.d};
- _loc1_.rootPos = Math.pos(_loc1_);
- if(_loc1_.moverPingPong eq "")
- {
- _loc1_.moverPingPong = 1;
- }
- _loc1_.actPos = Number(_loc1_.moverStartPos);
- if(_loc1_.moverChain ne "")
- {
- _loc1_.chain = _loc1_._parent[_loc1_.moverChain];
- _loc1_.chain.minHeight = _loc1_.chain._height;
- }
- };
- moverCircle = function()
- {
- var _loc1_ = this;
- _loc1_.actPos = (_loc1_.actPos + 1 + _loc1_.v.pos) % 1;
- if(_loc1_.chain)
- {
- _loc1_.chain._rotation = _loc1_.actPos * 360;
- }
- _loc1_.x = _loc1_.rootPos.x + Math.cos(_loc1_.actPos * 2 * 3.141592653589793) * _loc1_.moverRadius;
- _loc1_.y = _loc1_.rootPos.y + Math.sin(_loc1_.actPos * 2 * 3.141592653589793) * _loc1_.moverRadius;
- _loc1_._x = _loc1_.x;
- _loc1_._y = _loc1_.y;
- };
- moverCircleInit = function(mc, engine)
- {
- var _loc1_ = mc;
- _loc1_.v = {pos:Number(_loc1_.moverV) / (6.283185307179586 * int(_loc1_.moverRadius))};
- _loc1_.rootPos = Math.pos(_loc1_);
- _loc1_.actPos = Number(_loc1_.moverStartPos);
- if(_loc1_.moverChain ne "")
- {
- _loc1_.chain = _loc1_._parent[_loc1_.moverChain];
- }
- };
- moverSwing = function()
- {
- var _loc1_ = this;
- _loc1_.actPos = (_loc1_.actPos + 1 + _loc1_.v.pos) % 1;
- var _loc2_ = 1.5707963267948966 + Math.sin(_loc1_.actPos * 2 * 3.141592653589793) * _loc1_.moverAngle;
- _loc1_.chain = _loc1_._parent[_loc1_.moverChain];
- if(_loc1_.chain)
- {
- _loc1_.chain._rotation = _loc2_ / 3.141592653589793 * 180;
- }
- _loc1_.x = _loc1_.rootPos.x + Math.cos(_loc2_) * _loc1_.moverRadius;
- _loc1_.y = _loc1_.rootPos.y + Math.sin(_loc2_) * _loc1_.moverRadius;
- _loc1_._x = _loc1_.x;
- _loc1_._y = _loc1_.y;
- };
- moverSwingInit = function(mc, engine)
- {
- var _loc1_ = mc;
- _loc1_.v = {pos:Number(_loc1_.moverV) / (6.283185307179586 * int(_loc1_.moverRadius))};
- _loc1_.moverAngle = _loc1_.moverDegrees / 360 * 3.141592653589793;
- _loc1_.rootPos = Math.pos(_loc1_);
- _loc1_.actPos = Number(_loc1_.moverStartPos);
- if(_loc1_.moverChain ne "")
- {
- _loc1_.chain = _loc1_._parent[_loc1_.moverChain];
- trace("chain: " + _loc1_.moverChain + " => " + _loc1_.chain);
- for(var _loc2_ in _loc1_._parent)
- {
- trace("mc." + _loc2_);
- }
- }
- };
- moverElastic = function()
- {
- var _loc1_ = this;
- if(_loc1_.stepTokens)
- {
- _loc1_.stepTokens = 0;
- _loc1_.y += Math.cos(_loc1_.moverAngle) * _loc1_.moverStepWeight;
- _loc1_.x += Math.sin(_loc1_.moverAngle) * _loc1_.moverStepWeight;
- }
- _loc1_.y = _loc1_.rootPos.y * _loc1_.moverFlex + _loc1_.y * (1 - _loc1_.moverFlex);
- _loc1_.x = _loc1_.rootPos.x * _loc1_.moverFlex + _loc1_.x * (1 - _loc1_.moverFlex);
- _loc1_.v.x = _loc1_.x - _loc1_._x;
- _loc1_.v.y = _loc1_.y - _loc1_._y;
- _loc1_._x = _loc1_.x;
- _loc1_._y = _loc1_.y;
- };
- moverElasticOnStep = function()
- {
- this.stepTokens = 1;
- };
- moverElasticInit = function(mc, engine)
- {
- var _loc1_ = mc;
- _loc1_.v = {pos:Number(_loc1_.moverV) / _loc1_.d};
- _loc1_.rootPos = Math.pos(_loc1_);
- _loc1_.moverAngle = int(_loc1_.moverAngle) / 180 * 3.141592653589793;
- _loc1_.actPos = Number(_loc1_.moverStartPos);
- _loc1_.onStep = _root.moverElasticOnStep;
- };
-