home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Esportes / abyss01.swf / scripts / __Packages / fish.as < prev    next >
Encoding:
Text File  |  2008-03-12  |  4.0 KB  |  160 lines

  1. class fish extends MovieClip
  2. {
  3.    var clickN;
  4.    var sizeN;
  5.    var firstX = 0;
  6.    var suVis = "no";
  7.    function fish()
  8.    {
  9.       super();
  10.    }
  11.    function come(num)
  12.    {
  13.       this._xscale = 20;
  14.       this._yscale = 20;
  15.       if(num == 2)
  16.       {
  17.          this.firstX = random(100) + 150;
  18.       }
  19.       else
  20.       {
  21.          this.firstX = random(120) + 140;
  22.       }
  23.       if(num == 0)
  24.       {
  25.          this.firstX = 114;
  26.          this._x = 114;
  27.       }
  28.       else
  29.       {
  30.          this._x = this.firstX;
  31.       }
  32.       this._y = 155;
  33.       this.clickN = num;
  34.    }
  35.    function onEnterFrame()
  36.    {
  37.       if(_root.playIng == "no")
  38.       {
  39.          this.removeMovieClip();
  40.       }
  41.       if(_root.speedN > 0)
  42.       {
  43.          if(this._xscale < 100)
  44.          {
  45.             if(this._y < 301)
  46.             {
  47.                this.sizeN = 20 + 0.53 * (this._y - 150);
  48.             }
  49.             else
  50.             {
  51.                this.sizeN = 100;
  52.             }
  53.             this._yscale = this._xscale = this.sizeN;
  54.             if(this.clickN == 0)
  55.             {
  56.                this._x -= _root.speedN / _root.centerN;
  57.                this._y += _root.speedN / _root.centerN;
  58.             }
  59.             else
  60.             {
  61.                if(this.firstX < 190)
  62.                {
  63.                   this._x -= _root.speedN / _root.centerN;
  64.                }
  65.                else if(this.firstX > 210)
  66.                {
  67.                   this._x += _root.speedN / _root.centerN;
  68.                }
  69.                this._y += _root.speedN;
  70.             }
  71.          }
  72.          else if(this.clickN == 0)
  73.          {
  74.             if(this.firstX < 190)
  75.             {
  76.                this._x -= _root.speedN / _root.centerN;
  77.             }
  78.             else if(this.firstX > 210)
  79.             {
  80.                this._x += _root.speedN / _root.centerN;
  81.             }
  82.             this._y += _root.speedN / _root.centerN;
  83.          }
  84.          else
  85.          {
  86.             if(this.firstX < 190)
  87.             {
  88.                this._x -= _root.speedN / _root.centerN;
  89.             }
  90.             else if(this.firstX > 210)
  91.             {
  92.                this._x += _root.speedN / _root.centerN;
  93.             }
  94.             this._y += _root.speedN;
  95.          }
  96.       }
  97.       if(this._y > 270 && this._y < 300)
  98.       {
  99.          if(this._x >= _root.user_mc._x - 25 && this._x <= _root.user_mc._x + 25)
  100.          {
  101.             if(this.clickN == 1)
  102.             {
  103.                trace("∞â¥∞ä▒ Ω▒╕δª╝ = " + this._y);
  104.                this.fishPlusF();
  105.                this.removeMovieClip();
  106.             }
  107.          }
  108.       }
  109.       if(this.clickN == 3)
  110.       {
  111.          if(this._y > 270 && this._y < 310 && this._x >= _root.user_mc._x - 20 && this._x <= _root.user_mc._x + 20)
  112.          {
  113.             if(this.suVis == "no")
  114.             {
  115.                this.suVis = "yes";
  116.                _root.placeVis = "yes";
  117.                _root.user_mc.gotoAndStop("hitF");
  118.                _root.lifeF();
  119.             }
  120.          }
  121.       }
  122.       else if(this.clickN == 2)
  123.       {
  124.          if(this._y > 275 && this._y < 310 && this._x >= _root.user_mc._x - 30 && this._x <= _root.user_mc._x + 30)
  125.          {
  126.             if(this.suVis == "no")
  127.             {
  128.                this.suVis = "yes";
  129.                _root.placeVis = "yes";
  130.                _root.speedN = 0;
  131.                _root.user_mc.gotoAndStop("hitF");
  132.                _root.lifeF();
  133.                _root.moveStopF();
  134.             }
  135.          }
  136.       }
  137.       if(this._y > 320)
  138.       {
  139.          _root.placeVis = "no";
  140.          this.removeMovieClip();
  141.       }
  142.    }
  143.    function fishPlusF()
  144.    {
  145.       _root.user_mc.runi_mc.gotoAndPlay("eatF");
  146.       _root.fishN = _root.fishN + 1;
  147.       _root.gameSocreF(10);
  148.       if(_root.fishN < 10)
  149.       {
  150.          _root.fishN1_mc.gotoAndStop(_root.fishN + "F");
  151.          _root.fishN2_mc.gotoAndStop(1);
  152.       }
  153.       else
  154.       {
  155.          _root.fishN1_mc.gotoAndStop(_root.fishN % 10 + "F");
  156.          _root.fishN2_mc.gotoAndStop(int(_root.fishN / 10) + "F");
  157.       }
  158.    }
  159. }
  160.