写在人物上
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
if (this._x>80) {
this._x -= 10;
}
else {
_root.map._x += 10;
}
}
if (Key.isDown(Key.RIGHT)) {
if (this._x<480) {
this._x += 10;
} else if (this._x<600){
_root.map._x -= 10;
}
}
if (Key.isDown(Key.UP)) {
_root.player._y -= 10;
}
if (Key.isDown(Key.DOWN)) {
_root.player._y += 10;
}
}