home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Classicos / RadioactiveSnakesFromMa.swf / scripts / DefineSprite_208 / frame_1 / DoAction.as
Encoding:
Text File  |  2006-06-20  |  7.6 KB  |  209 lines

  1. id = _name.substring(1,2);
  2. if(id <= _parent.map.multi)
  3. {
  4.    if(_Y < 0 and _parent.orb + 1 < _parent.orbs)
  5.    {
  6.       _X = (random(36) + 1) * 16 + 24;
  7.       _Y = (random(24) + 1) * 16 + 56;
  8.       w = 0;
  9.       while(w < _root.wall.length)
  10.       {
  11.          if(_X + 24 > _root.wall[w].x and _X - 24 < _root.wall[w].x + _root.wall[w].w)
  12.          {
  13.             if(_root.wall[w].ym == 2 and _Y + 24 > _root.wall[w].y and _Y - 24 < _root.wall[w].y + _root.wall[w].h)
  14.             {
  15.                _Y = -99;
  16.             }
  17.             else if(_root.wall[w].ym < 0 and _Y - 24 < _root.wall[w].y and _Y + 24 > _root.wall[w].y - _root.wall[w].h)
  18.             {
  19.                xds = _X - _root.wall[w].x;
  20.                xpr = xds / _root.wall[w].w;
  21.                yds = _root.wall[w].y - _root.wall[w].h * xpr;
  22.                if(_Y + 24 > yds and _Y - 24 < yds)
  23.                {
  24.                   _Y = -99;
  25.                }
  26.                else if(_root.wall[w].x < 24 and _root.wall[w].y - _root.wall[w].h < 56 and _Y <= yds)
  27.                {
  28.                   _Y = -99;
  29.                }
  30.                else if(_root.wall[w].x + _root.wall[w].w > 616 and _root.wall[w].y > 456 and _Y >= yds)
  31.                {
  32.                   _Y = -99;
  33.                }
  34.             }
  35.             else if(_root.wall[w].ym > 0 and _Y + 24 > _root.wall[w].y and _Y - 24 < _root.wall[w].y + _root.wall[w].h)
  36.             {
  37.                xds = _X - _root.wall[w].x;
  38.                xpr = xds / _root.wall[w].w;
  39.                yds = _root.wall[w].y + _root.wall[w].h * xpr;
  40.                if(_Y + 24 > yds and _Y - 24 < yds)
  41.                {
  42.                   _Y = -99;
  43.                }
  44.                else if(_root.wall[w].x < 24 and _root.wall[w].y + _root.wall[w].h > 456 and _Y >= yds)
  45.                {
  46.                   _Y = -99;
  47.                }
  48.                else if(_root.wall[w].x + _root.wall[w].w > 616 and _root.wall[w].y - _root.wall[w].h < 56 and _Y <= yds)
  49.                {
  50.                   _Y = -99;
  51.                }
  52.             }
  53.             else if(_Y + 24 > _root.wall[w].y and _Y - 24 < _root.wall[w].y)
  54.             {
  55.                _Y = -99;
  56.             }
  57.          }
  58.          w++;
  59.       }
  60.       if(_Y > 0)
  61.       {
  62.          _parent.orb = _parent.orb + 1;
  63.          food.gotoAndStop(_parent.map.orb[_parent.orb]);
  64.          if(food._currentframe == 2)
  65.          {
  66.             points = 350;
  67.          }
  68.          else if(food._currentframe == 3)
  69.          {
  70.             points = 150;
  71.          }
  72.          else if(food._currentframe == 4)
  73.          {
  74.             points = 500;
  75.          }
  76.          else if(food._currentframe == 5)
  77.          {
  78.             points = 100;
  79.          }
  80.          else
  81.          {
  82.             points = 250;
  83.          }
  84.          gotoAndPlay(3);
  85.       }
  86.    }
  87.    else if(_Y > 0)
  88.    {
  89.       p = 1;
  90.       while(p <= _root.players)
  91.       {
  92.          if(_root.player[p].ball[1].x + 12 > _X and _root.player[p].ball[1].x - 12 < _X)
  93.          {
  94.             if(_root.player[p].ball[1].y + 12 > _Y and _root.player[p].ball[1].y - 12 < _Y)
  95.             {
  96.                if(food._currentframe == 2 and _root.player[p].speed < 10)
  97.                {
  98.                   if(_root.player[p].speed < 8)
  99.                   {
  100.                      _root.player[p].speed = 8;
  101.                   }
  102.                   else if(_root.player[p].speed < 14)
  103.                   {
  104.                      _root.player[p].speed += 2;
  105.                   }
  106.                }
  107.                else if(food._currentframe == 3 and _root.player[p].speed > 2)
  108.                {
  109.                   if(_root.player[p].speed > 4)
  110.                   {
  111.                      _root.player[p].speed = 4;
  112.                   }
  113.                   else if(_root.player[p].speed > 2)
  114.                   {
  115.                      _root.player[p].speed -= 2;
  116.                   }
  117.                }
  118.                else if(food._currentframe == 4)
  119.                {
  120.                   if(_root.players == 1)
  121.                   {
  122.                      _root.player[p].inverted = 1;
  123.                   }
  124.                   else
  125.                   {
  126.                      ipn = 1;
  127.                      while(ipn <= _root.players)
  128.                      {
  129.                         if(ipn != p)
  130.                         {
  131.                            _root.player[ipn].inverted = 1;
  132.                         }
  133.                         ipn++;
  134.                      }
  135.                   }
  136.                }
  137.                else if(food._currentframe == 5)
  138.                {
  139.                   _root.player[p].inverted = 0;
  140.                   _root.player[p].speed = _root.speed;
  141.                }
  142.                pt = 1;
  143.                while(pt <= 2)
  144.                {
  145.                   _root.player[p].ball[_root.player[p].ball.length] = new Object();
  146.                   _root.player[p].ball[_root.player[p].ball.length - 1].step = new Array();
  147.                   _root.player[p].ball[_root.player[p].ball.length - 1].x = _root.player[p].ball[_root.player[p].ball.length - 2].x;
  148.                   _root.player[p].ball[_root.player[p].ball.length - 1].y = _root.player[p].ball[_root.player[p].ball.length - 2].y;
  149.                   _root.player[p].ball[_root.player[p].ball.length - 1].dir = _root.player[p].ball[_root.player[p].ball.length - 2].dir;
  150.                   _root.player[p].ball[_root.player[p].ball.length - 1].speed = _root.player[p].ball[_root.player[p].ball.length - 2].speed;
  151.                   _root.player[p].ball[_root.player[p].ball.length - 1].delay = _root.player[p].ball[_root.player[p].ball.length - 2].delay + 16;
  152.                   _root.player[p].ball[_root.player[p].ball.length - 1].clip = "p" + p + "b" + (_root.player[p].ball.length - 1);
  153.                   _parent["p" + p + "b" + (_root.player[p].ball.length - 1)]._x = _root.player[p].ball[_root.player[p].ball.length - 1].x;
  154.                   _parent["p" + p + "b" + (_root.player[p].ball.length - 1)]._y = _root.player[p].ball[_root.player[p].ball.length - 1].y;
  155.                   _parent.pl = p;
  156.                   tellTarget(_parent)
  157.                   {
  158.                      depth++;
  159.                      duplicateMovieClip("snakeParts","p" + pl + "b" + (_root.player[pl].ball.length - 1),16384 + (100 + depth));
  160.                   }
  161.                   paint = new Color(_parent["p" + p + "b" + (_root.player[p].ball.length - 1)]);
  162.                   paint.setTransform(_root.player[p].fill[_root.player[p].cstep]);
  163.                   _root.player[p].cstep = _root.player[p].cstep + 1;
  164.                   if(_root.player[p].cstep > _root.player[p].colors)
  165.                   {
  166.                      _root.player[p].cstep = 1;
  167.                   }
  168.                   _root.player[p].life += 120;
  169.                   if(_root.player[p].life > 72)
  170.                   {
  171.                      _root.player[p].life = 720;
  172.                   }
  173.                   pt++;
  174.                }
  175.                _parent.onorb = _parent.onorb + 1;
  176.                _Y = -99;
  177.                if(_root.players == 1)
  178.                {
  179.                   _root.player[1].score += points;
  180.                }
  181.                else
  182.                {
  183.                   _root.player[p].vspoints = _root.player[p].vspoints + 1;
  184.                }
  185.                if(_parent.onorb >= _parent.orbs)
  186.                {
  187.                   _parent.stop();
  188.                   _root.clock = 0;
  189.                   _root.readygo.play();
  190.                }
  191.                if(food._currentframe == 4)
  192.                {
  193.                   gotoAndPlay(25);
  194.                }
  195.                else
  196.                {
  197.                   gotoAndPlay(20);
  198.                }
  199.             }
  200.          }
  201.          p++;
  202.       }
  203.    }
  204. }
  205. else
  206. {
  207.    stop();
  208. }
  209.