home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Aventura / FlashGauntlet.swf / scripts / DefineSprite_94 / frame_1 / DoAction.as
Encoding:
Text File  |  2001-07-14  |  2.2 KB  |  98 lines

  1. newy = 30 + random(450);
  2. newx = 30 + random(540);
  3. playerx = _root.player._x;
  4. playery = _root.player._y;
  5. diffx = Math.abs(playerx - this._x);
  6. diffx = Math.abs(playery - this._y);
  7. if(this.hitTest(_root.wall1))
  8. {
  9.    setProperty(this, _X, this._x + movex);
  10.    setProperty(this, _Y, this._y + movey);
  11.    gotoAndPlay(1);
  12. }
  13. else if(this.hitTest(_root.wall2))
  14. {
  15.    setProperty(this, _X, this._x + movex);
  16.    setProperty(this, _Y, this._y + movey);
  17.    gotoAndPlay(1);
  18. }
  19. else if(this.hitTest(_root.wall3))
  20. {
  21.    setProperty(this, _X, this._x + movex);
  22.    setProperty(this, _Y, this._y + movey);
  23.    gotoAndPlay(1);
  24. }
  25. else if(this.hitTest(_root.wall4))
  26. {
  27.    setProperty(this, _X, this._x + movex);
  28.    setProperty(this, _Y, this._y + movey);
  29.    gotoAndPlay(1);
  30. }
  31. else if(this.hitTest(_root.wall5))
  32. {
  33.    setProperty(this, _X, this._x + movex);
  34.    setProperty(this, _Y, this._y + movey);
  35.    gotoAndPlay(1);
  36. }
  37. else if(this.hitTest(_root.wall6))
  38. {
  39.    setProperty(this, _X, this._x + movex);
  40.    setProperty(this, _Y, this._y + movey);
  41.    gotoAndPlay(1);
  42. }
  43. else if(this.hitTest(_root.wall7))
  44. {
  45.    setProperty(this, _X, this._x + movex);
  46.    setProperty(this, _Y, this._y + movey);
  47.    gotoAndPlay(1);
  48. }
  49. else if(this.hitTest(_root.wall8))
  50. {
  51.    setProperty(this, _X, this._x + movex);
  52.    setProperty(this, _Y, this._y + movey);
  53.    gotoAndPlay(1);
  54. }
  55. else if(this.hitTest(_root.door1))
  56. {
  57.    setProperty(this, _X, this._x + movex);
  58.    setProperty(this, _Y, this._y + movey);
  59.    gotoAndPlay(1);
  60. }
  61. else if(this.hitTest(_root.door2))
  62. {
  63.    setProperty(this, _X, this._x + movex);
  64.    setProperty(this, _Y, this._y + movey);
  65.    gotoAndPlay(1);
  66. }
  67. else if(this.hitTest(_root.door3))
  68. {
  69.    setProperty(this, _X, this._x + movex);
  70.    setProperty(this, _Y, this._y + movey);
  71.    gotoAndPlay(1);
  72. }
  73. else if(this.hitTest(_root.door4))
  74. {
  75.    setProperty(this, _X, this._x + movex);
  76.    setProperty(this, _Y, this._y + movey);
  77.    gotoAndPlay(1);
  78. }
  79. else if(this.hitTest(_root.player))
  80. {
  81.    _root.health -= 10;
  82.    removeMovieClip(this);
  83. }
  84. else if(this.hitTest(_root.shot1.shoot))
  85. {
  86.    _root.score += 10;
  87.    removeMovieClip(_root.shot1);
  88.    removeMovieClip(this);
  89. }
  90. else if(100 >= diffx && 100 >= diffy)
  91. {
  92.    gotoAndPlay(11);
  93. }
  94. else
  95. {
  96.    gotoAndPlay(6);
  97. }
  98.