Ok, I have a scrolling terrain and I put the scrolling code on the player. Heres the code:
onClipEvent (load) {
movespeed = 5;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
_root.terrain._x -= movespeed
play();
_rotation = 90;
_x += movespeed;
}
if (Key.isDown(Key.LEFT)) {
_root.terrain._x += movespeed
play();
_rotation = 270;
_x -= movespeed;
}
if (Key.isDown(Key.UP)) {
_root.terrain._y += movespeed
play();
_rotation = 0;
_y -= movespeed;
}
if (Key.isDown(Key.DOWN)) {
_root.terrain._y -= movespeed
play();
_rotation = 180;
_y += movespeed;
}
if (Key.isDown(Key.RIGHT) && Key.isDown(Key.UP)) {
_rotation = 45;
}
if (Key.isDown(Key.LEFT) && Key.isDown(Key.UP)) {
_rotation = 315;
}
if (Key.isDown(Key.RIGHT) && Key.isDown(Key.DOWN)) {
_rotation = 135;
}
if (Key.isDown(Key.LEFT) && Key.isDown(Key.DOWN)) {
_rotation = 225;
}
}
I know its messy, but I’m a noob in AS and I don’t know how to make it any cleaner. Anyway, it works fine except now I want to set a limit to how far it can scroll before it stops. Heres the part I’m stumped on; I don’t know how to make it stop! Yes, it may be obvious to you guys, but I’m just started doing this AS thing, and still relativaly new to this stuff. Any help would be appreciate.