home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / rocketcar2.swf / scripts / DefineSprite_70_bomb2 / frame_1 / DoAction.as
Encoding:
Text File  |  2008-09-24  |  946 b   |  58 lines

  1. stop();
  2. g = 0.5;
  3. v = -15;
  4. x1 = -10;
  5. y1 = 10;
  6. time = 0;
  7. x = Math.round(Math.random() * (y1 - x1)) + x1;
  8. this.onEnterFrame = function()
  9. {
  10.    if(_root.paused)
  11.    {
  12.       return undefined;
  13.    }
  14.    v -= g;
  15.    if(!_root.bg.hitTest(_X,_Y,true))
  16.    {
  17.       if(time <= 2)
  18.       {
  19.          _Y = _Y - v;
  20.       }
  21.    }
  22.    _X = _X + x;
  23.    x *= 0.99;
  24.    _rotation = _rotation + x * 2;
  25.    if(_root.bg.hitTest(_X,_Y + 10,true))
  26.    {
  27.       v = - v * 0.7;
  28.       time++;
  29.    }
  30.    if(_root.bg.hitTest(_X - _width / 2,_Y,true))
  31.    {
  32.       _X++;
  33.       x = - x;
  34.    }
  35.    if(_root.bg.hitTest(_X + _width / 2,_Y,true))
  36.    {
  37.       _X--;
  38.       x = - x;
  39.    }
  40.    if(this.hitTest(_root.car))
  41.    {
  42.       _root.kill();
  43.    }
  44.    if(time > 2)
  45.    {
  46.       _rotation = 0;
  47.       gotoAndStop(2);
  48.    }
  49.    if(_root.level !== 11)
  50.    {
  51.       this.removeMovieClip();
  52.    }
  53.    if(_root.car.dead)
  54.    {
  55.       this.removeMovieClip();
  56.    }
  57. };
  58.