home *** CD-ROM | disk | FTP | other *** search
/ Equipe de France et Bonbons / EquipeFrancePromoCD.iso / pages / cs_cadbury / loadergfx.swf / scripts / __Packages / Ball.as next >
Encoding:
Text File  |  2006-03-19  |  22.9 KB  |  692 lines

  1. class Ball
  2. {
  3.    var mc;
  4.    var mcShadow;
  5.    var playField;
  6.    var ballStates;
  7.    var moveShoot;
  8.    var shootInterruption;
  9.    var SHOOTSPEED_LINEAR;
  10.    var SHOOTSPEED_PARABOLIC;
  11.    var SHOOTSPEED_SLOWLYROLL;
  12.    var SHOOTSPEED_SMALLREBOUND;
  13.    var SHOOTPRECISION_LINEAR;
  14.    var SHOOTPRECISION_PARABOLIC;
  15.    var SHOOTSLOWDOWN_LINEAR;
  16.    var slowlyRollTimer;
  17.    var SLOWLYROLL_TIME;
  18.    var MAXSHOOTDIST;
  19.    var fakeParabolAmpl;
  20.    var fakeParabolZoom;
  21.    var trueY_mc;
  22.    var trueX_mcShadow;
  23.    var reboundFactor;
  24.    var reboundTime;
  25.    var frictionTime;
  26.    var initial_scale;
  27.    var isBallInAir;
  28.    var umountStates;
  29.    var umountFramesPerState;
  30.    var shootBallPos;
  31.    var shootMousePos;
  32.    var shootVector;
  33.    function Ball(mc, mcShadow, playField)
  34.    {
  35.       this.mc = mc;
  36.       this.mc.mcBallTrainee._visible = false;
  37.       this.mcShadow = mcShadow;
  38.       this.playField = playField;
  39.       this.ballStates = new Array();
  40.       this.initBallStates(11,2);
  41.       this.defaultState();
  42.       this.moveShoot = "None";
  43.       this.shootInterruption = false;
  44.       this.SHOOTSPEED_LINEAR = 10;
  45.       this.SHOOTSPEED_PARABOLIC = 4;
  46.       this.SHOOTSPEED_SLOWLYROLL = 1.5;
  47.       this.SHOOTSPEED_SMALLREBOUND = 1.5;
  48.       this.SHOOTPRECISION_LINEAR = this.SHOOTSPEED_LINEAR;
  49.       this.SHOOTPRECISION_PARABOLIC = this.SHOOTSPEED_PARABOLIC * 3;
  50.       this.SHOOTSLOWDOWN_LINEAR = 1;
  51.       this.slowlyRollTimer = new TimerSynchronizer();
  52.       this.SLOWLYROLL_TIME = 2000;
  53.       this.MAXSHOOTDIST = this.playField.getMaxX() / 2;
  54.       this.fakeParabolAmpl = this.MAXSHOOTDIST / 4;
  55.       this.fakeParabolZoom = 3;
  56.       this.trueY_mc = this.mc._y;
  57.       this.trueX_mcShadow = this.mcShadow._x;
  58.       this.reboundFactor = 4;
  59.       this.reboundTime = 0;
  60.       this.frictionTime = 0;
  61.       this.initial_scale = 80;
  62.       this.isBallInAir = false;
  63.    }
  64.    function initBallStates(umountStates, umountFramesPerState)
  65.    {
  66.       var _loc2_ = undefined;
  67.       this.ballStates[0] = 1;
  68.       _loc2_ = 1;
  69.       while(_loc2_ <= umountStates)
  70.       {
  71.          this.ballStates[_loc2_] = this.ballStates[_loc2_ - 1] + umountFramesPerState;
  72.          _loc2_ = _loc2_ + 1;
  73.       }
  74.       this.umountStates = umountStates;
  75.       this.umountFramesPerState = umountFramesPerState;
  76.    }
  77.    function getUmountStates()
  78.    {
  79.       return this.umountStates;
  80.    }
  81.    function getUmountFramesPerState()
  82.    {
  83.       return this.umountFramesPerState;
  84.    }
  85.    function defaultState()
  86.    {
  87.       this.mc.mcBall.gotoAndStop(1);
  88.    }
  89.    function setState(state)
  90.    {
  91.       if(state != 1)
  92.       {
  93.          this.mc._xscale = this.initial_scale + 15;
  94.          this.mc._yscale = this.initial_scale + 15;
  95.       }
  96.       this.mc.mcBall.gotoAndStop(state);
  97.    }
  98.    function setRotationDEG(angleDEG)
  99.    {
  100.       this.mc._rotation = angleDEG;
  101.    }
  102.    function setMoveShootLinear()
  103.    {
  104.       this.moveShoot = "Linear";
  105.    }
  106.    function setMoveShootParabolic()
  107.    {
  108.       this.moveShoot = "Parabolic";
  109.    }
  110.    function moveInField(x, y)
  111.    {
  112.       if(x >= this.playField.getMaxX())
  113.       {
  114.          this.interruptMovement();
  115.       }
  116.       if(x <= this.playField.getMinX())
  117.       {
  118.          this.interruptMovement();
  119.       }
  120.       if(y >= this.playField.getMaxY())
  121.       {
  122.          this.interruptMovement();
  123.       }
  124.       if(y <= this.playField.getMinY())
  125.       {
  126.          this.interruptMovement();
  127.       }
  128.       this.mc._x = x;
  129.       this.mc._y = y;
  130.       this.mcShadow._x = x;
  131.       this.mcShadow._y = y;
  132.    }
  133.    function moveInAir(x_mc, y_mc, x_mcShadow, y_mcShadow)
  134.    {
  135.       if(x_mc > this.playField.getMaxX())
  136.       {
  137.          this.interruptMovement();
  138.       }
  139.       if(x_mc < this.playField.getMinX())
  140.       {
  141.          this.interruptMovement();
  142.       }
  143.       if(y_mc > this.playField.getMaxY())
  144.       {
  145.          this.interruptMovement();
  146.       }
  147.       if(y_mc < this.playField.getMinY())
  148.       {
  149.          this.interruptMovement();
  150.       }
  151.       if(x_mcShadow > this.playField.getMaxX())
  152.       {
  153.          this.interruptMovement();
  154.       }
  155.       if(x_mcShadow < this.playField.getMinX())
  156.       {
  157.          this.interruptMovement();
  158.       }
  159.       if(y_mcShadow > this.playField.getMaxY())
  160.       {
  161.          this.interruptMovement();
  162.       }
  163.       if(y_mcShadow < this.playField.getMinY())
  164.       {
  165.          this.interruptMovement();
  166.       }
  167.       this.mc._x = x_mc;
  168.       this.mc._y = y_mc;
  169.       this.mcShadow._x = x_mcShadow;
  170.       this.mcShadow._y = y_mcShadow;
  171.    }
  172.    function getX()
  173.    {
  174.       return this.mc._x;
  175.    }
  176.    function getY()
  177.    {
  178.       return this.mc._y;
  179.    }
  180.    function setShootVector(ballPos, mousePos)
  181.    {
  182.       var _loc2_ = new Vector2D(ballPos,mousePos);
  183.       this.shootBallPos = ballPos;
  184.       this.shootMousePos = mousePos;
  185.       this.shootVector = _loc2_;
  186.    }
  187.    function getShootVector()
  188.    {
  189.       return this.shootVector;
  190.    }
  191.    function getShootMousePos()
  192.    {
  193.       return this.shootMousePos;
  194.    }
  195.    function getShootBallPos()
  196.    {
  197.       return this.shootBallPos;
  198.    }
  199.    function moveLinearShoot()
  200.    {
  201.       if(this.moveShoot != "SlowlyRoll")
  202.       {
  203.          this.moveShoot = "Linear";
  204.       }
  205.       if(this.shootInterruption == true)
  206.       {
  207.          this.moveShoot = "None";
  208.          this.shootInterruption = false;
  209.          return false;
  210.       }
  211.       if(this.mc._x <= this.shootMousePos.getX() + this.SHOOTPRECISION_LINEAR && this.mc._x >= this.shootMousePos.getX() - this.SHOOTPRECISION_LINEAR)
  212.       {
  213.          if(this.mc._y <= this.shootMousePos.getY() + this.SHOOTPRECISION_LINEAR && this.mc._y >= this.shootMousePos.getY() - this.SHOOTPRECISION_LINEAR)
  214.          {
  215.             this.moveShoot = "SlowlyRoll";
  216.             this.slowlyRollTimer.setOldTimer(getTimer());
  217.          }
  218.       }
  219.       if(this.moveShoot == "SlowlyRoll")
  220.       {
  221.          if(this.slowlyRollTimer.getElapsedTimeMs() > this.SLOWLYROLL_TIME)
  222.          {
  223.             this.moveShoot = "None";
  224.             this.trueY_mc = this.mc._y;
  225.             this.trueX_mcShadow = this.mcShadow._x;
  226.             return false;
  227.          }
  228.       }
  229.       var _loc2_ = undefined;
  230.       if(this.moveShoot == "Linear")
  231.       {
  232.          _loc2_ = this.SHOOTSPEED_LINEAR;
  233.       }
  234.       if(this.moveShoot == "SlowlyRoll")
  235.       {
  236.          _loc2_ = this.SHOOTSPEED_SLOWLYROLL;
  237.          this.defaultState();
  238.       }
  239.       if(this.moveShoot == "Linear" || this.moveShoot == "SlowlyRoll")
  240.       {
  241.          var _loc4_ = this.shootVector.getX() / this.shootVector.getNorme() * _loc2_;
  242.          var _loc3_ = this.shootVector.getY() / this.shootVector.getNorme() * _loc2_;
  243.          this.moveInField(this.mc._x + _loc4_,this.mc._y + _loc3_);
  244.          return true;
  245.       }
  246.    }
  247.    function moveLinearShootFriction_Test()
  248.    {
  249.       if(this.moveShoot == "None")
  250.       {
  251.          this.moveShoot = "Linear";
  252.          this.SHOOTSLOWDOWN_LINEAR = 1.1;
  253.       }
  254.       if(this.shootInterruption == true)
  255.       {
  256.          this.moveShoot = "None";
  257.          this.shootInterruption = false;
  258.          return false;
  259.       }
  260.       var _loc2_ = undefined;
  261.       if(this.moveShoot == "Linear")
  262.       {
  263.          _loc2_ = this.SHOOTSPEED_LINEAR;
  264.          this.SHOOTSLOWDOWN_LINEAR -= 0.05;
  265.       }
  266.       if(this.moveShoot == "Linear")
  267.       {
  268.          var _loc4_ = this.shootVector.getX() / this.shootVector.getNorme() * (_loc2_ * this.SHOOTSLOWDOWN_LINEAR);
  269.          var _loc3_ = this.shootVector.getY() / this.shootVector.getNorme() * (_loc2_ * this.SHOOTSLOWDOWN_LINEAR);
  270.          if(_loc4_ < 0.01 && _loc3_ < 0.01)
  271.          {
  272.             this.moveShoot = "None";
  273.             return false;
  274.          }
  275.          this.moveInField(this.mc._x + _loc4_,this.mc._y + _loc3_);
  276.          return true;
  277.       }
  278.    }
  279.    function moveParabolicShoot()
  280.    {
  281.       if(this.moveShoot != "Rebound")
  282.       {
  283.          this.moveShoot = "Parabolic";
  284.          this.reboundTime = 0;
  285.       }
  286.       if(this.shootInterruption == true)
  287.       {
  288.          this.moveShoot = "None";
  289.          this.shootInterruption = false;
  290.          return false;
  291.       }
  292.       if(this.mc._x <= this.shootMousePos.getX() + this.SHOOTPRECISION_PARABOLIC && this.mc._x >= this.shootMousePos.getX() - this.SHOOTPRECISION_PARABOLIC)
  293.       {
  294.          if(this.mc._y <= this.shootMousePos.getY() + this.SHOOTPRECISION_PARABOLIC && this.mc._y >= this.shootMousePos.getY() - this.SHOOTPRECISION_PARABOLIC)
  295.          {
  296.             var _loc14_ = true;
  297.             if(_loc14_ && this.reboundTime != 1)
  298.             {
  299.                this.mc._x = this.shootMousePos.getX();
  300.                this.mc._y = this.shootMousePos.getY();
  301.             }
  302.             this.mcShadow._x = this.mc._x;
  303.             this.mcShadow._y = this.mc._y;
  304.             this.trueY_mc = this.mc._y;
  305.             this.trueX_mcShadow = this.mcShadow._x;
  306.             this.mc._xscale = this.initial_scale;
  307.             this.mc._yscale = this.initial_scale;
  308.             if(this.moveShoot != "Parabolic")
  309.             {
  310.                this.moveShoot = "None";
  311.                return false;
  312.             }
  313.             this.moveShoot = "Rebound";
  314.          }
  315.       }
  316.       if(this.moveShoot == "Rebound" && this.reboundTime == 0)
  317.       {
  318.          var _loc11_ = this.shootVector.getX() / this.reboundFactor;
  319.          var _loc10_ = this.shootVector.getY() / this.reboundFactor;
  320.          this.setShootVector(new Point2D(this.shootMousePos.getX(),this.shootMousePos.getY()),new Point2D(this.shootMousePos.getX() + _loc11_,this.shootMousePos.getY() + _loc10_));
  321.          this.reboundTime = 1;
  322.       }
  323.       var _loc5_ = undefined;
  324.       if(this.moveShoot == "Parabolic")
  325.       {
  326.          _loc5_ = this.SHOOTSPEED_PARABOLIC;
  327.       }
  328.       if(this.moveShoot == "Rebound")
  329.       {
  330.          _loc5_ = this.SHOOTSPEED_SMALLREBOUND;
  331.       }
  332.       if(this.moveShoot == "Parabolic" || this.moveShoot == "Rebound")
  333.       {
  334.          var _loc4_ = this.shootVector.getX() / this.shootVector.getNorme() * _loc5_;
  335.          var _loc8_ = this.shootVector.getY() / this.shootVector.getNorme() * _loc5_;
  336.          var _loc15_ = new Vector2D(new Point2D(this.shootBallPos.getX(),this.shootBallPos.getY()),new Point2D(this.mc._x,this.trueY_mc));
  337.          var _loc12_ = _loc15_.getNorme() / this.shootVector.getNorme();
  338.          var _loc3_ = undefined;
  339.          var _loc6_ = undefined;
  340.          _loc3_ = Math.sin(_loc12_ * 3.141592653589793);
  341.          if(_loc3_ < 0)
  342.          {
  343.             _loc3_ = - _loc3_;
  344.          }
  345.          _loc6_ = _loc3_ * 0.25 * this.shootVector.getNorme();
  346.          this.trueY_mc += _loc8_;
  347.          this.trueX_mcShadow += _loc4_;
  348.          var _loc7_ = undefined;
  349.          var _loc13_ = this.fakeParabolZoom * this.shootVector.getNorme() / this.MAXSHOOTDIST;
  350.          _loc7_ = _loc13_ * _loc3_;
  351.          if(_loc7_ < 1)
  352.          {
  353.             _loc7_ = 1;
  354.          }
  355.          var _loc2_ = this.initial_scale * _loc7_;
  356.          if(_loc2_ <= this.initial_scale)
  357.          {
  358.             _loc2_ = this.initial_scale;
  359.          }
  360.          this.mc._xscale = _loc2_;
  361.          this.mc._yscale = _loc2_;
  362.          this.mcShadow._xscale = _loc2_;
  363.          this.mcShadow._yscale = _loc2_;
  364.          var _loc9_ = "Linear";
  365.          if(_loc9_ == "Linear")
  366.          {
  367.             this.moveInAir(this.mc._x + _loc4_,this.trueY_mc - _loc6_,this.mcShadow._x + _loc4_,this.mcShadow._y + _loc8_);
  368.          }
  369.          if(_loc9_ == "Decal")
  370.          {
  371.             this.moveInAir(this.mc._x + _loc4_,this.trueY_mc - _loc6_,this.trueX_mcShadow + _loc6_,this.mcShadow._y + _loc8_);
  372.          }
  373.          return true;
  374.       }
  375.    }
  376.    function moveTacleFriction()
  377.    {
  378.       if(this.moveShoot != "None")
  379.       {
  380.          this.moveShoot = "";
  381.          this.frictionTime = 0;
  382.       }
  383.       return true;
  384.    }
  385.    function moveLinearShootFriction()
  386.    {
  387.       if(this.moveShoot != "Friction")
  388.       {
  389.          this.moveShoot = "Linear";
  390.          this.frictionTime = 0;
  391.          this.mc.mcBallTrainee._visible = true;
  392.       }
  393.       if(this.shootInterruption == true)
  394.       {
  395.          this.moveShoot = "None";
  396.          this.shootInterruption = false;
  397.          this.mc.mcBallTrainee._visible = false;
  398.          return false;
  399.       }
  400.       if(this.mc._x <= this.shootMousePos.getX() + this.SHOOTPRECISION_LINEAR && this.mc._x >= this.shootMousePos.getX() - this.SHOOTPRECISION_LINEAR)
  401.       {
  402.          if(this.mc._y <= this.shootMousePos.getY() + this.SHOOTPRECISION_LINEAR && this.mc._y >= this.shootMousePos.getY() - this.SHOOTPRECISION_LINEAR)
  403.          {
  404.             var _loc15_ = false;
  405.             if(_loc15_ && this.frictionTime != 1)
  406.             {
  407.                this.mc._x = this.shootMousePos.getX();
  408.                this.mc._y = this.shootMousePos.getY();
  409.             }
  410.             this.mcShadow._x = this.mc._x;
  411.             this.mcShadow._y = this.mc._y;
  412.             this.trueY_mc = this.mc._y;
  413.             this.trueX_mcShadow = this.mcShadow._x;
  414.             this.mc._xscale = this.initial_scale;
  415.             this.mc._yscale = this.initial_scale;
  416.             if(this.moveShoot == "Linear")
  417.             {
  418.                this.moveShoot = "Friction";
  419.             }
  420.          }
  421.       }
  422.       if(this.moveShoot == "Friction" && this.frictionTime == 0)
  423.       {
  424.          var _loc11_ = this.shootVector.getX() / 2;
  425.          var _loc10_ = this.shootVector.getY() / 2;
  426.          this.setShootVector(new Point2D(this.shootMousePos.getX(),this.shootMousePos.getY()),new Point2D(this.shootMousePos.getX() + _loc11_,this.shootMousePos.getY() + _loc10_));
  427.          this.SHOOTSLOWDOWN_LINEAR = 1.1;
  428.          this.frictionTime = 1;
  429.          this.mc.mcBallTrainee._visible = false;
  430.       }
  431.       var _loc5_ = undefined;
  432.       if(this.moveShoot == "Linear")
  433.       {
  434.          _loc5_ = this.SHOOTSPEED_LINEAR;
  435.       }
  436.       if(this.moveShoot == "Friction")
  437.       {
  438.          _loc5_ = this.SHOOTSPEED_SMALLREBOUND;
  439.       }
  440.       if(this.moveShoot == "Friction")
  441.       {
  442.          this.SHOOTSLOWDOWN_LINEAR -= 0.025;
  443.          var _loc4_ = this.shootVector.getX() / this.shootVector.getNorme() * (_loc5_ * this.SHOOTSLOWDOWN_LINEAR);
  444.          var _loc8_ = this.shootVector.getY() / this.shootVector.getNorme() * (_loc5_ * this.SHOOTSLOWDOWN_LINEAR);
  445.          if(_loc4_ < 0.02 && _loc4_ > -0.02 && _loc8_ < 0.02 && _loc8_ > -0.02)
  446.          {
  447.             this.moveShoot = "None";
  448.             trace("Very Slow !!!!! - End Movement.");
  449.             return false;
  450.          }
  451.          this.moveInField(this.mc._x + _loc4_,this.mc._y + _loc8_);
  452.          return true;
  453.       }
  454.       if(this.moveShoot == "Linear")
  455.       {
  456.          var _loc13_ = Math.atan2(this.shootVector.getY(),this.shootVector.getX()) * 180 / 3.141592653589793;
  457.          this.mc.mcBallTrainee._rotation = _loc13_;
  458.          _loc4_ = this.shootVector.getX() / this.shootVector.getNorme() * _loc5_;
  459.          _loc8_ = this.shootVector.getY() / this.shootVector.getNorme() * _loc5_;
  460.          var _loc16_ = new Vector2D(new Point2D(this.shootBallPos.getX(),this.shootBallPos.getY()),new Point2D(this.mc._x,this.trueY_mc));
  461.          var _loc12_ = _loc16_.getNorme() / this.shootVector.getNorme();
  462.          var _loc3_ = undefined;
  463.          var _loc6_ = undefined;
  464.          _loc3_ = Math.sin(_loc12_ * 3.141592653589793);
  465.          if(_loc3_ < 0)
  466.          {
  467.             _loc3_ = - _loc3_;
  468.          }
  469.          _loc6_ = _loc3_ * 0.05 * this.shootVector.getNorme();
  470.          this.trueY_mc += _loc8_;
  471.          this.trueX_mcShadow += _loc4_;
  472.          var _loc7_ = undefined;
  473.          var _loc14_ = 1.3 * this.shootVector.getNorme() / this.MAXSHOOTDIST;
  474.          _loc7_ = _loc14_ * _loc3_;
  475.          if(_loc7_ < 1)
  476.          {
  477.             _loc7_ = 1;
  478.          }
  479.          var _loc2_ = this.initial_scale * _loc7_;
  480.          if(_loc2_ <= this.initial_scale)
  481.          {
  482.             _loc2_ = this.initial_scale;
  483.          }
  484.          this.mc._xscale = _loc2_;
  485.          this.mc._yscale = _loc2_;
  486.          this.mcShadow._xscale = _loc2_;
  487.          this.mcShadow._yscale = _loc2_;
  488.          var _loc9_ = "Decal";
  489.          if(_loc9_ == "Linear")
  490.          {
  491.             this.moveInAir(this.mc._x + _loc4_,this.trueY_mc - _loc6_,this.mcShadow._x + _loc4_,this.mcShadow._y + _loc8_);
  492.          }
  493.          if(_loc9_ == "Decal")
  494.          {
  495.             this.moveInAir(this.mc._x + _loc4_,this.trueY_mc - _loc6_,this.trueX_mcShadow + _loc6_,this.mcShadow._y + _loc8_);
  496.          }
  497.          return true;
  498.       }
  499.    }
  500.    function moveParabolicShootFriction()
  501.    {
  502.       if(this.moveShoot == "None")
  503.       {
  504.          this.moveShoot = "Parabolic";
  505.          this.frictionTime = 0;
  506.          this.reboundTime = 0;
  507.       }
  508.       if(this.shootInterruption == true)
  509.       {
  510.          this.moveShoot = "None";
  511.          this.shootInterruption = false;
  512.          return false;
  513.       }
  514.       if(this.mc._x <= this.shootMousePos.getX() + this.SHOOTPRECISION_PARABOLIC && this.mc._x >= this.shootMousePos.getX() - this.SHOOTPRECISION_PARABOLIC)
  515.       {
  516.          if(this.mc._y <= this.shootMousePos.getY() + this.SHOOTPRECISION_PARABOLIC && this.mc._y >= this.shootMousePos.getY() - this.SHOOTPRECISION_PARABOLIC)
  517.          {
  518.             var _loc14_ = true;
  519.             if(_loc14_ && this.reboundTime != 1)
  520.             {
  521.                this.mc._x = this.shootMousePos.getX();
  522.                this.mc._y = this.shootMousePos.getY();
  523.             }
  524.             this.mcShadow._x = this.mc._x;
  525.             this.mcShadow._y = this.mc._y;
  526.             this.trueY_mc = this.mc._y;
  527.             this.trueX_mcShadow = this.mcShadow._x;
  528.             this.mc._xscale = this.initial_scale;
  529.             this.mc._yscale = this.initial_scale;
  530.             if(this.moveShoot == "Parabolic")
  531.             {
  532.                this.moveShoot = "Rebound";
  533.             }
  534.             else if(this.moveShoot == "Rebound")
  535.             {
  536.                this.moveShoot = "Friction";
  537.                trace("Friction Mode");
  538.             }
  539.          }
  540.       }
  541.       if(this.moveShoot == "Rebound" && this.reboundTime == 0)
  542.       {
  543.          var _loc11_ = this.shootVector.getX() / this.reboundFactor;
  544.          var _loc10_ = this.shootVector.getY() / this.reboundFactor;
  545.          this.setShootVector(new Point2D(this.shootMousePos.getX(),this.shootMousePos.getY()),new Point2D(this.shootMousePos.getX() + _loc11_,this.shootMousePos.getY() + _loc10_));
  546.          this.reboundTime = 1;
  547.       }
  548.       if(this.moveShoot == "Friction" && this.frictionTime == 0)
  549.       {
  550.          _loc11_ = this.shootVector.getX() / 1.5;
  551.          _loc10_ = this.shootVector.getY() / 1.5;
  552.          this.setShootVector(new Point2D(this.shootMousePos.getX(),this.shootMousePos.getY()),new Point2D(this.shootMousePos.getX() + _loc11_,this.shootMousePos.getY() + _loc10_));
  553.          this.SHOOTSLOWDOWN_LINEAR = 1.1;
  554.          this.frictionTime = 1;
  555.          this.shootVector.trace();
  556.          trace("Friction Init Done.");
  557.       }
  558.       var _loc6_ = undefined;
  559.       if(this.moveShoot == "Parabolic")
  560.       {
  561.          _loc6_ = this.SHOOTSPEED_PARABOLIC;
  562.       }
  563.       if(this.moveShoot == "Rebound")
  564.       {
  565.          _loc6_ = this.SHOOTSPEED_SMALLREBOUND;
  566.       }
  567.       if(this.moveShoot == "Friction")
  568.       {
  569.          _loc6_ = this.SHOOTSPEED_SMALLREBOUND;
  570.       }
  571.       if(this.moveShoot == "Friction")
  572.       {
  573.          this.SHOOTSLOWDOWN_LINEAR -= 0.03;
  574.          var _loc5_ = this.shootVector.getX() / this.shootVector.getNorme() * (_loc6_ * this.SHOOTSLOWDOWN_LINEAR);
  575.          var _loc8_ = this.shootVector.getY() / this.shootVector.getNorme() * (_loc6_ * this.SHOOTSLOWDOWN_LINEAR);
  576.          if(_loc5_ < 0.02 && _loc5_ > -0.02 && _loc8_ < 0.02 && _loc8_ > -0.02)
  577.          {
  578.             this.moveShoot = "None";
  579.             trace("Very Slow !!!!! - End Movement.");
  580.             return false;
  581.          }
  582.          this.moveInField(this.mc._x + _loc5_,this.mc._y + _loc8_);
  583.          return true;
  584.       }
  585.       if(this.moveShoot == "Parabolic" || this.moveShoot == "Rebound")
  586.       {
  587.          _loc5_ = this.shootVector.getX() / this.shootVector.getNorme() * _loc6_;
  588.          _loc8_ = this.shootVector.getY() / this.shootVector.getNorme() * _loc6_;
  589.          var _loc15_ = new Vector2D(new Point2D(this.shootBallPos.getX(),this.shootBallPos.getY()),new Point2D(this.mc._x,this.trueY_mc));
  590.          var _loc12_ = _loc15_.getNorme() / this.shootVector.getNorme();
  591.          var _loc3_ = undefined;
  592.          var _loc4_ = undefined;
  593.          _loc3_ = Math.sin(_loc12_ * 3.141592653589793);
  594.          if(_loc3_ < 0)
  595.          {
  596.             _loc3_ = - _loc3_;
  597.          }
  598.          _loc4_ = _loc3_ * 0.2 * this.shootVector.getNorme();
  599.          if(_loc4_ > 15)
  600.          {
  601.             this.isBallInAir = true;
  602.          }
  603.          else
  604.          {
  605.             this.isBallInAir = false;
  606.          }
  607.          this.trueY_mc += _loc8_;
  608.          this.trueX_mcShadow += _loc5_;
  609.          var _loc7_ = undefined;
  610.          var _loc13_ = this.fakeParabolZoom * this.shootVector.getNorme() / this.MAXSHOOTDIST;
  611.          _loc7_ = _loc13_ * _loc3_;
  612.          if(_loc7_ < 1)
  613.          {
  614.             _loc7_ = 1;
  615.          }
  616.          var _loc2_ = this.initial_scale * _loc7_;
  617.          if(_loc2_ <= this.initial_scale)
  618.          {
  619.             _loc2_ = this.initial_scale;
  620.          }
  621.          this.mc._xscale = _loc2_;
  622.          this.mc._yscale = _loc2_;
  623.          this.mcShadow._xscale = _loc2_;
  624.          this.mcShadow._yscale = _loc2_;
  625.          var _loc9_ = "Linear";
  626.          if(_loc9_ == "Linear")
  627.          {
  628.             this.moveInAir(this.mc._x + _loc5_,this.trueY_mc - _loc4_,this.mcShadow._x + _loc5_,this.mcShadow._y + _loc8_);
  629.          }
  630.          if(_loc9_ == "Decal")
  631.          {
  632.             this.moveInAir(this.mc._x + _loc5_,this.trueY_mc - _loc4_,this.trueX_mcShadow + _loc4_,this.mcShadow._y + _loc8_);
  633.          }
  634.          return true;
  635.       }
  636.    }
  637.    function isBallInAirTest()
  638.    {
  639.       return this.isBallInAir;
  640.    }
  641.    function getMovieClip()
  642.    {
  643.       return this.mc;
  644.    }
  645.    function updateTrueValues()
  646.    {
  647.       this.mcShadow._x = this.mc._x;
  648.       this.mcShadow._y = this.mc._y;
  649.       this.trueY_mc = this.mc._y;
  650.       this.trueX_mcShadow = this.mcShadow._x;
  651.    }
  652.    function interruptMovement()
  653.    {
  654.       if(this.shootInterruption == false)
  655.       {
  656.          this.shootInterruption = true;
  657.       }
  658.       this.updateTrueValues();
  659.       this.setInitialScale();
  660.    }
  661.    function setLinearSpeed(val)
  662.    {
  663.       this.SHOOTSPEED_LINEAR += val / 2;
  664.    }
  665.    function setDefaultLinearSpeed()
  666.    {
  667.       this.SHOOTSPEED_LINEAR = 5;
  668.    }
  669.    function getShootState()
  670.    {
  671.       return this.moveShoot;
  672.    }
  673.    function setInitialScale()
  674.    {
  675.       this.mc._xscale = this.initial_scale;
  676.       this.mc._yscale = this.initial_scale;
  677.       this.mcShadow._xscale = this.initial_scale;
  678.       this.mcShadow._yscale = this.initial_scale;
  679.    }
  680.    function trace()
  681.    {
  682.       trace("Ball - moveShoot         : " + this.moveShoot);
  683.       trace("Ball - shootInterruption : " + this.shootInterruption);
  684.       trace("Ball - shootVector       : ");
  685.       this.shootVector.trace();
  686.    }
  687.    function tracePosition()
  688.    {
  689.       trace("Ball(x, y) = (" + this.mc._x + "," + this.mc._y + ")");
  690.    }
  691. }
  692.