home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Acao / Titans / cyborg.swf / scripts / DefineSprite_66_bomb4 / frame_1 / DoAction.as
Encoding:
Text File  |  2006-01-05  |  1.3 KB  |  60 lines

  1. _X = 150 + random(300);
  2. _Y = 200;
  3. _xscale = 15;
  4. _yscale = 15;
  5. ys = -5;
  6. dis = r.distance;
  7. dispass = -2;
  8. ro = 5;
  9. onenterframe = function()
  10. {
  11.    _rotation = _rotation + ro;
  12.    _Y = _Y + ys;
  13.    ys += 0.2;
  14.    dis += dispass;
  15.    _xscale = _xscale * 1.03;
  16.    _yscale = _yscale * 1.03;
  17.    if(dis < 0)
  18.    {
  19.       dis = 0;
  20.       if(_Y > 300)
  21.       {
  22.          r.zboom3.start();
  23.          if(math.abs(r.cbx - _X) < 2 * r.bombrange)
  24.          {
  25.             r.hit = 1;
  26.             r.enemies.removevalue(_name);
  27.          }
  28.          _rotation = 0;
  29.          _xscale = _xscale * 3;
  30.          _yscale = _yscale * 2.5;
  31.          gotoAndPlay(2);
  32.       }
  33.    }
  34.    cekhit();
  35.    if(hit)
  36.    {
  37.       px = [_X - 10,_X + 10];
  38.       pxs = [-4,4];
  39.       var i = 0;
  40.       while(i < 2)
  41.       {
  42.          r.attachmovie("bomb4b","e" + r.ed,r.ed);
  43.          r["e" + r.ed].ys = ys;
  44.          r["e" + r.ed].xs = pxs[i];
  45.          r["e" + r.ed]._xscale = 0.5 * _xscale;
  46.          r["e" + r.ed]._yscale = 0.5 * _yscale;
  47.          r["e" + r.ed]._x = px[i];
  48.          r["e" + r.ed]._y = _Y;
  49.          r["e" + r.ed].dis = 0.5 * dis;
  50.          r.enemies.push("e" + r.ed);
  51.          r.ed--;
  52.          i++;
  53.       }
  54.       r.zboom.start();
  55.       r.score += r.point;
  56.       this.gotoAndPlay("exp");
  57.    }
  58. };
  59. stop();
  60.