home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / rocketcar2.swf / scripts / DefineSprite_79_bomb3 / frame_2 / DoAction.as
Encoding:
Text File  |  2008-09-24  |  769 b   |  55 lines

  1. if(_root.paused)
  2. {
  3.    return undefined;
  4. }
  5. if(_alpha < 0)
  6. {
  7.    this.removeMovieClip();
  8. }
  9. if(type !== "slow")
  10. {
  11.    dis = Math.ceil(this._x - _root.car._x) / (random(100) + 2000);
  12. }
  13. else
  14. {
  15.    dis = Math.ceil(this._x - _root.car._x) / 600;
  16. }
  17. if(type !== "homing")
  18. {
  19.    _Y = _Y - speed;
  20.    _X = _X + xspeed;
  21.    xspeed -= dis;
  22. }
  23. time++;
  24. if(time > 120)
  25. {
  26.    if(_root.boss.dir == "wait")
  27.    {
  28.       _root.boss.changeDir();
  29.    }
  30.    if(_alpha > 0)
  31.    {
  32.       _alpha = _alpha - 8;
  33.    }
  34. }
  35. if(this.hitTest(_root.car))
  36. {
  37.    if(_root.boss.health > 0)
  38.    {
  39.       _root.kill();
  40.    }
  41. }
  42. if(_Y < 0)
  43. {
  44.    this.removeMovieClip();
  45. }
  46. if(_root.car.dead)
  47. {
  48.    time = 125;
  49. }
  50. if(type == "homing")
  51. {
  52.    _Y = _Y - ySpeed;
  53.    _X = _X + xSpeed;
  54. }
  55.