home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Aventura / Frizzle_fraz.swf / scripts / Code / LOGIC / OBJECTS / GRAPHICS / _wv496.as < prev    next >
Encoding:
Text File  |  2008-09-26  |  6.7 KB  |  211 lines

  1. package Code.LOGIC.OBJECTS.GRAPHICS
  2. {
  3.    import Code.LIB._bm350;
  4.    import Code.LIB._iv163;
  5.    import Code.LIB._pd424;
  6.    import Code.LIB._uu24;
  7.    import Code.LIB._yd42;
  8.    import Code.LOGIC.OBJECTS.ACTORS.BLOB._be439;
  9.    import Code.OPTIONS._dx111;
  10.    import Code.org.cove.ape._be271;
  11.    import Code.org.cove.ape._ms106;
  12.    import flash.display.DisplayObject;
  13.    import flash.display.Sprite;
  14.    import flash.geom.Point;
  15.    
  16.    public class _wv496 extends _ms106
  17.    {
  18.       
  19.       public static const stNormal:int = 0;
  20.       
  21.       public static const stSwim:int = 1;
  22.        
  23.       
  24.       private var mount:DisplayObject;
  25.       
  26.       private var _nu27:Array;
  27.       
  28.       private var swimIndex:int;
  29.       
  30.       private var eyes:DisplayObject;
  31.       
  32.       private var smallBlobsC:_pd424;
  33.       
  34.       private var state:int;
  35.       
  36.       private var blob:_be439;
  37.       
  38.       private var _radius:int;
  39.       
  40.       private var smallBlobsP:_iv163;
  41.       
  42.       public function _wv496(param1:_be439)
  43.       {
  44.          var _loc2_:DisplayObject = null;
  45.          super();
  46.          _radius = param1.radius;
  47.          blob = param1;
  48.          mount = new _dx111.GPlayerBlobNormal() as Sprite;
  49.          mount.scaleX = mount.scaleY = _bm350._tc204 * (_radius / 25);
  50.          eyes = new _dx111.GPlayerEyes() as Sprite;
  51.          eyes.scaleX = eyes.scaleY = _bm350._tc204 * (_radius / 25);
  52.          this._nu27 = new Array(0,0,0);
  53.          _loc2_ = new _dx111.TPS1() as Sprite;
  54.          _loc2_.scaleX = _loc2_.scaleY = _bm350._tc204 * (_radius / 25);
  55.          _nu27[2] = _loc2_;
  56.          _loc2_ = new _dx111.TPS2() as Sprite;
  57.          _loc2_.scaleX = _loc2_.scaleY = _bm350._tc204 * (_radius / 25);
  58.          _nu27[0] = _loc2_;
  59.          _loc2_ = new _dx111.TPS3() as Sprite;
  60.          _loc2_.scaleX = _loc2_.scaleY = _bm350._tc204 * (_radius / 25);
  61.          _nu27[1] = _loc2_;
  62.          this.smallBlobsC = new _pd424();
  63.          this.smallBlobsP = new _iv163();
  64.          State = stNormal;
  65.       }
  66.       
  67.       public static function _fy383(param1:Number) : Sprite
  68.       {
  69.          var _loc2_:Sprite = null;
  70.          var _loc3_:Sprite = null;
  71.          var _loc4_:Sprite = null;
  72.          _loc2_ = new _dx111.GPlayerBlobNormal() as Sprite;
  73.          _loc2_.scaleX = _loc2_.scaleY = param1 / 25;
  74.          _loc3_ = new _dx111.GPlayerEyes() as Sprite;
  75.          _loc3_.scaleX = _loc3_.scaleY = param1 / 25;
  76.          (_loc4_ = new Sprite()).addChild(_loc2_);
  77.          _loc4_.addChild(_loc3_);
  78.          return _loc4_;
  79.       }
  80.       
  81.       public function _cj212(param1:_iv163) : void
  82.       {
  83.          var _loc2_:Point = null;
  84.          var _loc3_:_iv163 = null;
  85.          var _loc4_:int = 0;
  86.          var _loc5_:int = 0;
  87.          _loc2_ = new Point(-1,1);
  88.          if(smallBlobsC.numChildren <= 5)
  89.          {
  90.             _loc4_ = smallBlobsC.numChildren / 4;
  91.             _loc5_ = smallBlobsC.numChildren - 4 * _loc4_;
  92.             _loc2_ = _yd42._sv247(_loc2_,45 * _loc5_);
  93.             _loc2_.normalize(blob.radius * 0.4 + blob.radius * 0.2 * _loc4_);
  94.             param1._vt351 = _loc2_.x;
  95.             param1._lh238 = _loc2_.y;
  96.          }
  97.          else
  98.          {
  99.             param1._vt351 = -Math.random() * blob.radius + 5;
  100.             param1._lh238 = -Math.random() * blob.radius + Math.random() * blob.radius;
  101.          }
  102.          smallBlobsC.addChild(param1);
  103.          _loc3_ = _uu24._ec508(smallBlobsC);
  104.          _loc3_._dn458(smallBlobsP);
  105.       }
  106.       
  107.       override public function onEnterFrame() : void
  108.       {
  109.          var _loc1_:_be271 = null;
  110.          var _loc2_:int = 0;
  111.          var _loc3_:Number = NaN;
  112.          switch(state)
  113.          {
  114.             case stNormal:
  115.                if(blob._rx33.x > 1 && scaleX < 0 || blob._rx33.x < -1 && scaleX > 0)
  116.                {
  117.                   scaleX *= -1;
  118.                }
  119.                if(blob.inSect)
  120.                {
  121.                   State = stSwim;
  122.                }
  123.                break;
  124.             case stSwim:
  125.                ++swimIndex;
  126.                switch(swimIndex)
  127.                {
  128.                   case 1:
  129.                      _nu27[0].visible = true;
  130.                      _nu27[1].visible = false;
  131.                      _nu27[2].visible = false;
  132.                      break;
  133.                   case 3:
  134.                      _nu27[0].visible = false;
  135.                      _nu27[1].visible = true;
  136.                      _nu27[2].visible = false;
  137.                      break;
  138.                   case 6:
  139.                      _nu27[0].visible = false;
  140.                      _nu27[1].visible = false;
  141.                      _nu27[2].visible = true;
  142.                      break;
  143.                   case 9:
  144.                      _nu27[0].visible = false;
  145.                      _nu27[1].visible = true;
  146.                      _nu27[2].visible = false;
  147.                      break;
  148.                   case 12:
  149.                      swimIndex = 0;
  150.                }
  151.                if(!blob.inSect)
  152.                {
  153.                   State = stNormal;
  154.                }
  155.                _loc1_ = blob._rx33;
  156.                _loc2_ = -99999;
  157.                if(Math.abs(_loc1_.x) > 0.1 || Math.abs(_loc1_.y) > 0.1)
  158.                {
  159.                   _loc3_ = Math.atan(_loc1_.y / _loc1_.x) * (180 / Math.PI);
  160.                   _loc2_ = super.rotation < _loc3_ ? 1 : -1;
  161.                   super.rotation += _loc2_;
  162.                }
  163.                if(blob._rx33.x > 1 && scaleX < 0 || blob._rx33.x < -1 && scaleX > 0)
  164.                {
  165.                   scaleX *= -1;
  166.                   if(_loc2_ > -9999)
  167.                   {
  168.                      super.rotation = _loc2_;
  169.                   }
  170.                }
  171.          }
  172.       }
  173.       
  174.       public function set State(param1:int) : void
  175.       {
  176.          state = param1;
  177.          switch(state)
  178.          {
  179.             case stNormal:
  180.                while(this.numChildren != 0)
  181.                {
  182.                   removeChildAt(0);
  183.                }
  184.                addChild(mount);
  185.                addChild(eyes);
  186.                addChild(smallBlobsP);
  187.                super.rotation = 0;
  188.                break;
  189.             case stSwim:
  190.                while(this.numChildren != 0)
  191.                {
  192.                   removeChildAt(0);
  193.                }
  194.                addChild(_nu27[0]);
  195.                addChild(_nu27[1]);
  196.                addChild(_nu27[2]);
  197.                _nu27[0].visible = false;
  198.                _nu27[1].visible = false;
  199.                _nu27[2].visible = false;
  200.                swimIndex = 0;
  201.                addChild(smallBlobsP);
  202.          }
  203.       }
  204.       
  205.       override public function set rotation(param1:Number) : void
  206.       {
  207.          mount.rotation = param1;
  208.       }
  209.    }
  210. }
  211.