home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / TheTurtleBridge.swf / scripts / frame_24 / DoAction.as
Encoding:
Text File  |  2005-08-04  |  3.2 KB  |  164 lines

  1. function getBag()
  2. {
  3.    if(man.mask._y > 0)
  4.    {
  5.       return true;
  6.    }
  7.    return false;
  8. }
  9. function setBag(vis)
  10. {
  11.    if(vis == true)
  12.    {
  13.       man.mask._y = 12.4;
  14.    }
  15.    else
  16.    {
  17.       man.mask._y = -3500;
  18.    }
  19. }
  20. function landed()
  21. {
  22.    if(base > 0 && base < 6 && this["t" + base]._currentframe <= 12)
  23.    {
  24.       this["t" + base].gotoAndPlay(2);
  25.    }
  26. }
  27. function landedfish()
  28. {
  29.    if(base > 0 && base < 6 && this["t" + base]._currentframe >= 56)
  30.    {
  31.       controlOn = false;
  32.       if(man._xscale < 0)
  33.       {
  34.          man._x = xs[base + 1];
  35.       }
  36.       else if(base == 1)
  37.       {
  38.          man._x = xs[1] - 68.5;
  39.       }
  40.       else
  41.       {
  42.          man._x = xs[base - 1];
  43.       }
  44.       man.gotoAndPlay(51);
  45.       return true;
  46.    }
  47.    return false;
  48. }
  49. function moveMan(dir)
  50. {
  51.    var _loc1_ = dir;
  52.    if(controlOn != false)
  53.    {
  54.       if(_loc1_ == "right")
  55.       {
  56.          if(base == 0)
  57.          {
  58.             nextbase = 1;
  59.             if(man._xscale == -100)
  60.             {
  61.                man._xscale = 100;
  62.             }
  63.             man.gotoAndPlay(2);
  64.          }
  65.          if(base == 5)
  66.          {
  67.             nextbase = 5;
  68.             if(man._xscale == -100)
  69.             {
  70.                man._xscale = 100;
  71.             }
  72.             man._x = xs[base - 1];
  73.             man.gotoAndPlay(41);
  74.          }
  75.       }
  76.       if(_loc1_ == "right")
  77.       {
  78.          if(base == 1 || base == 2 || base == 3 || base == 4)
  79.          {
  80.             nextbase = base + 1;
  81.             if(man._xscale == -100)
  82.             {
  83.                man._xscale = 100;
  84.             }
  85.             man.gotoAndPlay(28);
  86.          }
  87.       }
  88.       if(_loc1_ == "left")
  89.       {
  90.          if(base == 1 && getBag() == false)
  91.          {
  92.             nextbase = 0;
  93.             if(man._xscale == -100)
  94.             {
  95.                man._xscale = 100;
  96.             }
  97.             man.gotoAndPlay(14);
  98.          }
  99.       }
  100.       if(_loc1_ == "left")
  101.       {
  102.          if(base == 2 || base == 3 || base == 4 || base == 5)
  103.          {
  104.             nextbase = base - 1;
  105.             if(man._xscale == 100)
  106.             {
  107.                man._xscale = -100;
  108.             }
  109.             man.gotoAndPlay(28);
  110.          }
  111.       }
  112.    }
  113. }
  114. function restart()
  115. {
  116.    gotoAndStop("titlescreen");
  117. }
  118. function addChance(ol, nes)
  119. {
  120.    var _loc2_ = this;
  121.    if(ol < nextupdateon && nes >= nextupdateon)
  122.    {
  123.       nextupdateon += addchanceafter;
  124.       if(chances < 3)
  125.       {
  126.          chances++;
  127.          c1._visible = false;
  128.          c2._visible = false;
  129.          c3._visible = false;
  130.          var _loc1_ = 1;
  131.          while(_loc1_ <= chances)
  132.          {
  133.             _loc2_["c" + _loc1_]._visible = true;
  134.             _loc1_ = _loc1_ + 1;
  135.          }
  136.       }
  137.    }
  138. }
  139. var gameOn = true;
  140. var controlOn = true;
  141. var base = 0;
  142. var nextbase = 0;
  143. var oldbase = 0;
  144. var turtlesDown = 0;
  145. var xs = new Array();
  146. z;
  147. xs[1] = 98.85;
  148. xs[2] = 167.35;
  149. xs[3] = 235.85;
  150. xs[4] = 298;
  151. xs[5] = 366;
  152. c1._visible = false;
  153. c2._visible = false;
  154. c3._visible = false;
  155. var i = 1;
  156. while(i <= chances)
  157. {
  158.    this["c" + i]._visible = true;
  159.    i++;
  160. }
  161. txtScore.text = score;
  162. gameover._visible = false;
  163. stop();
  164.