home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Aventura / Frizzle_fraz.swf / scripts / Code / LOGIC / OBJECTS / ACTORS / RECTS / _tr528.as < prev   
Encoding:
Text File  |  2008-09-26  |  5.3 KB  |  200 lines

  1. package Code.LOGIC.OBJECTS.ACTORS.RECTS
  2. {
  3.    import Code.LOGIC.OBJECTS.ACTORS.INTERFACES._xn130;
  4.    import Code.LOGIC.OBJECTS.GRAPHICS._hi161;
  5.    import Code.LOGIC.OBJECTS.GRAPHICS._px156;
  6.    import Code.LOGIC._cd449;
  7.    import Code.org.cove.ape._be271;
  8.    
  9.    public class _tr528 extends _gg531 implements _xn130
  10.    {
  11.       
  12.       public static const stMove:int = 1;
  13.       
  14.       public static const stFixed:int = 0;
  15.       
  16.       public static const stFree:int = 2;
  17.        
  18.       
  19.       private var initalActive:Boolean;
  20.       
  21.       private var movingDist:int;
  22.       
  23.       private var _active:Boolean = true;
  24.       
  25.       private var initalCoords:_be271;
  26.       
  27.       private var _action:String;
  28.       
  29.       private var _boundable:Boolean;
  30.       
  31.       private var moveObj:Object;
  32.       
  33.       private var rotation:int;
  34.       
  35.       private var _dm39:int;
  36.       
  37.       private var state:int;
  38.       
  39.       private var vel:_be271;
  40.       
  41.       public function _tr528(param1:Object)
  42.       {
  43.          _active = true;
  44.          vel = new _be271();
  45.          super(param1);
  46.          _yt549 = true;
  47.          _boundable = Boolean(param1._ew250);
  48.          if(param1.rotation != 0)
  49.          {
  50.             _boundable = false;
  51.          }
  52.          if(param1.State == stMove)
  53.          {
  54.             moveObj = new Object();
  55.             moveObj.dx = param1.dx;
  56.             moveObj.dy = param1.dy;
  57.             moveObj.dist = param1.dist;
  58.             Move(param1.dx,param1.dy,param1.dist);
  59.             this._mb474(new _hi161(param1.width,param1.height));
  60.          }
  61.          else
  62.          {
  63.             this.rotation = param1.rotation;
  64.             this._mb474(new _px156(this));
  65.          }
  66.          initalCoords = new _be271(param1.x,param1.y);
  67.          _active = param1.active;
  68.          initalActive = _active == true;
  69.          _action = param1.action;
  70.          State = param1.State;
  71.       }
  72.       
  73.       public static function _lu255() : Object
  74.       {
  75.          var _loc1_:Object = null;
  76.          return {
  77.             "toolClass":_tr528,
  78.             "name":"wall",
  79.             "params":{
  80.                "_tp253":0,
  81.                "x":0,
  82.                "y":0,
  83.                "action":"",
  84.                "active":false,
  85.                "width":50,
  86.                "height":50,
  87.                "rotation":0,
  88.                "_ew250":1,
  89.                "states":[["fixed",_tr528.stFixed],["free",_tr528.stFree],["move",_tr528.stMove,[["dx",0],["dy",0],["dist",0]]]]
  90.             }
  91.          };
  92.       }
  93.       
  94.       public function get active() : Boolean
  95.       {
  96.          return _active == true;
  97.       }
  98.       
  99.       public function get action() : String
  100.       {
  101.          return _action.substr(0,_action.length);
  102.       }
  103.       
  104.       public function get _ew250() : Boolean
  105.       {
  106.          return _boundable == true;
  107.       }
  108.       
  109.       public function _he73(param1:String) : void
  110.       {
  111.          switch(param1)
  112.          {
  113.             case "disable":
  114.                _active = false;
  115.          }
  116.       }
  117.       
  118.       public function _eu538() : Object
  119.       {
  120.          var _loc1_:Object = null;
  121.          _loc1_ = new Object();
  122.          _loc1_.prClass = "TWall";
  123.          _loc1_._tp253 = _tp253;
  124.          _loc1_.x = initalCoords.x;
  125.          _loc1_.y = initalCoords.y;
  126.          _loc1_.width = width;
  127.          _loc1_.height = height;
  128.          _loc1_.State = state;
  129.          _loc1_.rotation = this.rotation;
  130.          _loc1_.action = action;
  131.          _loc1_.active = initalActive;
  132.          _loc1_._ew250 = _boundable;
  133.          if(state == stMove)
  134.          {
  135.             _loc1_.dx = moveObj.dx;
  136.             _loc1_.dy = moveObj.dy;
  137.             _loc1_.dist = moveObj.dist;
  138.          }
  139.          return _loc1_;
  140.       }
  141.       
  142.       public function _ur45() : Object
  143.       {
  144.          var _loc1_:Object = null;
  145.          _loc1_ = _lu255();
  146.          _loc1_.params._tp253 = _tp253;
  147.          _loc1_.params.x = initalCoords.x;
  148.          _loc1_.params.y = initalCoords.y;
  149.          _loc1_.params.width = width;
  150.          _loc1_.params.height = height;
  151.          _loc1_.params.rotation = this.rotation;
  152.          _loc1_.params._ew250 = _boundable;
  153.          _loc1_.params.active = initalActive;
  154.          _loc1_.params.action = action;
  155.          _loc1_.State = state;
  156.          return _loc1_;
  157.       }
  158.       
  159.       override public function update(param1:Number) : void
  160.       {
  161.          var _loc2_:_be271 = null;
  162.          super.update(param1);
  163.          switch(state)
  164.          {
  165.             case stMove:
  166.                _loc2_ = new _be271(0,-_cd449.G);
  167.                _pj361(_loc2_);
  168.                position = new _be271(_ej28 + vel.x,_th99 + vel.y);
  169.                if(++_dm39 >= movingDist)
  170.                {
  171.                   vel.x *= -1;
  172.                   vel.y *= -1;
  173.                   State = stMove;
  174.                }
  175.          }
  176.       }
  177.       
  178.       public function set State(param1:int) : void
  179.       {
  180.          state = param1;
  181.          switch(state)
  182.          {
  183.             case stMove:
  184.                _dm39 = 0;
  185.                break;
  186.             case stFree:
  187.                fixed = false;
  188.          }
  189.       }
  190.       
  191.       public function Move(param1:Number, param2:Number, param3:int) : void
  192.       {
  193.          vel.x = param1;
  194.          vel.y = param2;
  195.          movingDist = param3;
  196.          State = stMove;
  197.       }
  198.    }
  199. }
  200.