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

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