Maybe next time we should code stuff ourselves instead of copying and pasting?
onClipEvent (load) {
speed = 7;
speed2 = 7;
scale = _xscale;
fight=false
}
onClipEvent (enterFrame) {
if(fight==false){
if (Key.isDown(Key.UP)) {
this._y -= speed2;
this.gotoAndStop(2);
}
if (Key.isDown(Key.DOWN)) {
this._y += speed2;
this.gotoAndStop(2);
}
if (Key.isDown(Key.LEFT)) {
this._x -= speed;
this.gotoAndStop(2);
_xscale = -scale;
}
if (Key.isDown(Key.RIGHT)) {
this._x += speed;
this.gotoAndStop(2);
_xscale = +scale;
}
}
onClipEvent (keyUp) {
this.gotoAndStop(1);
}
}
onClipEvent (enterFrame) {
thisDepth=this.getDepth(), otherDepth=_root.enemy.getDepth();
if (_y>_root.enemy._y && otherDepth>thisDepth) {
this.swapDepths(_root.enemy);
}
if (_root.enemy._y>_y && thisDepth>otherDepth) {
this.swapDepths(_root.enemy);
}
if(Key.isDown(Key.SPACE)){
this.gotoAndStop(3);
fight = true;
}