home *** CD-ROM | disk | FTP | other *** search
- newy = 30 + random(450);
- newx = 30 + random(540);
- playerx = _root.player._x;
- playery = _root.player._y;
- diffx = Math.abs(playerx - this._x);
- diffx = Math.abs(playery - this._y);
- if(this.hitTest(_root.wall1))
- {
- setProperty(this, _X, this._x + movex);
- setProperty(this, _Y, this._y + movey);
- gotoAndPlay(1);
- }
- else if(this.hitTest(_root.wall2))
- {
- setProperty(this, _X, this._x + movex);
- setProperty(this, _Y, this._y + movey);
- gotoAndPlay(1);
- }
- else if(this.hitTest(_root.wall3))
- {
- setProperty(this, _X, this._x + movex);
- setProperty(this, _Y, this._y + movey);
- gotoAndPlay(1);
- }
- else if(this.hitTest(_root.wall4))
- {
- setProperty(this, _X, this._x + movex);
- setProperty(this, _Y, this._y + movey);
- gotoAndPlay(1);
- }
- else if(this.hitTest(_root.wall5))
- {
- setProperty(this, _X, this._x + movex);
- setProperty(this, _Y, this._y + movey);
- gotoAndPlay(1);
- }
- else if(this.hitTest(_root.wall6))
- {
- setProperty(this, _X, this._x + movex);
- setProperty(this, _Y, this._y + movey);
- gotoAndPlay(1);
- }
- else if(this.hitTest(_root.wall7))
- {
- setProperty(this, _X, this._x + movex);
- setProperty(this, _Y, this._y + movey);
- gotoAndPlay(1);
- }
- else if(this.hitTest(_root.wall8))
- {
- setProperty(this, _X, this._x + movex);
- setProperty(this, _Y, this._y + movey);
- gotoAndPlay(1);
- }
- else if(this.hitTest(_root.door1))
- {
- setProperty(this, _X, this._x + movex);
- setProperty(this, _Y, this._y + movey);
- gotoAndPlay(1);
- }
- else if(this.hitTest(_root.door2))
- {
- setProperty(this, _X, this._x + movex);
- setProperty(this, _Y, this._y + movey);
- gotoAndPlay(1);
- }
- else if(this.hitTest(_root.door3))
- {
- setProperty(this, _X, this._x + movex);
- setProperty(this, _Y, this._y + movey);
- gotoAndPlay(1);
- }
- else if(this.hitTest(_root.door4))
- {
- setProperty(this, _X, this._x + movex);
- setProperty(this, _Y, this._y + movey);
- gotoAndPlay(1);
- }
- else if(this.hitTest(_root.player))
- {
- _root.health -= 10;
- removeMovieClip(this);
- }
- else if(this.hitTest(_root.shot1.shoot))
- {
- _root.score += 10;
- removeMovieClip(_root.shot1);
- removeMovieClip(this);
- }
- else if(100 >= diffx && 100 >= diffy)
- {
- gotoAndPlay(11);
- }
- else
- {
- gotoAndPlay(6);
- }
-