Combined Code
frame 1 {
MenNav = false;
}
frame 2 {
stop();
MC_mask.cacheAsBitmap = true;
Player.cacheAsBitmap = true;
Player.setMask('MC_mask');
}
movieClip 3 {
}
instance of movieClip 3 {
onClipEvent (enterFrame) {
if (_root.moveLeft == true) {
this._x += 5;
}
if (_root.moveUp == true) {
this._y += 5;
}
if (_root.moveDown == true) {
this._y -= 5;
}
if (_root.moveRight == true) {
this._x -= 5;
}
}
}
movieClip 5 {
}
movieClip 7 {
}
instance MC_mask of movieClip 7 {
onClipEvent (enterFrame) {
if (_root.moveLeft == true) {
this._x += 5;
}
if (_root.moveUp == true) {
this._y += 5;
}
if (_root.moveDown == true) {
this._y -= 5;
}
if (_root.moveRight == true) {
this._x -= 5;
}
}
}
movieClip 9 {
}
movieClip 12 {
}
instance of movieClip 12 {
onClipEvent (load) {
bposition = 0;
}
onClipEvent (enterFrame) {
if (_root.moveLeft == true) {
this._x += 5;
}
if (_root.moveUp == true) {
this._y += 5;
}
if (_root.moveDown == true) {
this._y -= 5;
}
if (_root.moveRight == true) {
this._x -= 5;
}
}
onClipEvent (enterFrame) {
if (this._y >= _root.Player._y && bposition == 0) {
bposition = 1;
this.swapDepths(_root.Player);
} else {
if (this._y <= _root.Player._y && bposition == 1) {
bposition = 0;
this.swapDepths(_root.Player);
}
}
}
}
movieClip 13 {
}
instance of movieClip 13 {
onClipEvent (load) {
bposition = 0;
}
onClipEvent (enterFrame) {
if (_root.moveLeft == true) {
this._x += 5;
}
if (_root.moveUp == true) {
this._y += 5;
}
if (_root.moveDown == true) {
this._y -= 5;
}
if (_root.moveRight == true) {
this._x -= 5;
}
}
onClipEvent (enterFrame) {
if (this._y >= _root.Player._y && bposition == 0) {
bposition = 1;
this.swapDepths(_root.Player);
} else {
if (this._y <= _root.Player._y && bposition == 1) {
bposition = 0;
this.swapDepths(_root.Player);
}
}
}
}
movieClip 16 {
}
movieClip 21 {
}
movieClip 23 {
}
movieClip 28 {
}
movieClip 30 {
}
movieClip 37 {
}
movieClip 41 {
}
movieClip 42 {
frame 9 {
play();
}
frame 17 {
_root.MenNav = false;
}
frame 18 {
play();
}
frame 26 {
_root.MenNav = false;
}
}
instance Player of movieClip 42 {
onClipEvent (enterFrame) {
if (Key.isDown(40) && _root.MenNav == false) {
if (_root.BG.hitTest(_x, _y + 5, true)) {
this._y += 5;
} else {
this.gotoAndStop(4);
}
}
if (Key.isDown(38) && _root.MenNav == false) {
if (_root.BG.hitTest(_x, _y - 5, true)) {
this._y -= 5;
} else {
this.gotoAndStop(2);
}
}
if (Key.isDown(37) && _root.MenNav == false) {
if (_root.BG.hitTest(_x - 5, _y, true)) {
this._x -= 5;
} else {
this.gotoAndStop(6);
}
}
if (Key.isDown(39) && _root.MenNav == false) {
if (_root.BG.hitTest(_x + 5, _y, true)) {
this._x += 5;
} else {
this.gotoAndStop(8);
}
}
if (_root.gridUP.hitTest(_x, _y - 20, true) && _root.MenNav == false) {
this._y += 5;
_root.BG._y += 5;
_root.moveUp = true;
} else {
_root.moveUp = false;
}
if (_root.gridDOWN.hitTest(_x, _y + 20, true) && _root.MenNav == false) {
this._y -= 5;
_root.BG._y -= 5;
_root.moveDown = true;
} else {
_root.moveDown = false;
}
if (_root.gridRIGHT.hitTest(_x + 20, _y, true) && _root.MenNav == false) {
this._x -= 5;
_root.BG._x -= 5;
_root.moveRight = true;
} else {
_root.moveRight = false;
}
if (_root.gridLEFT.hitTest(_x - 20, _y, true) && _root.MenNav == false) {
this._x += 5;
_root.BG._x += 5;
_root.moveLeft = true;
} else {
_root.moveLeft = false;
}
}
onClipEvent (enterFrame) {
this._x = _root.hero._x;
this._y = _root.hero._y - 30;
if (Key.isDown(40) && _root.MenNav == false) {
this.gotoAndStop(4);
facing = 2;
} else {
if (Key.isDown(38) && _root.MenNav == false) {
this.gotoAndStop(2);
facing = 1;
} else {
if (Key.isDown(37) && _root.MenNav == false) {
this.gotoAndStop(6);
facing = 3;
} else {
if (Key.isDown(39) && _root.MenNav == false) {
this.gotoAndStop(8);
facing = 4;
} else {
if (facing == 1 && _root.MenNav == false) {
this.gotoAndStop(1);
} else {
if (facing == 2 && _root.MenNav == false) {
this.gotoAndStop(3);
} else {
if (facing == 3 && _root.MenNav == false) {
this.gotoAndStop(5);
} else {
if (facing == 4 && _root.MenNav == false) {
this.gotoAndStop(7);
}
}
}
}
}
}
}
}
}
onClipEvent (enterFrame) {
if (Key.isDown(32) && _root.MenNav == false) {
if (facing == 3 || facing == 1) {
_root.MenNav = true;
this.gotoAndPlay('AttackL');
} else {
if (facing == 4 || facing == 2) {
_root.MenNav = true;
this.gotoAndPlay('AttackR');
} else {}
}
}
}
onClipEvent (load) {
this.stop();
facing = 2;
}
}