I’ve been trying to get the Zelda stlye movement to work for a while but no luck. I’ve gotten really close but I know I’m overlooking something.
onClipEvent (load) {
facing = "down";
shift = true;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.UP)) {
if (shift == true) {
gotoAndStop(2);
facing = "up";
shift = false;
}
_y -= 4;
}
if (Key.isDown(Key.DOWN)) {
if (shift == true) {
gotoAndStop(1);
facing = "down";
shift = false;
}
_y += 4;
}
if (Key.isDown(Key.LEFT)) {
if (shift == true) {
gotoAndStop(3);
facing = "left";
shift = false;
}
_x -= 4;
}
if (Key.isDown(Key.RIGHT)) {
if (shift == true) {
gotoAndStop(4);
facing = "right";
shift = false;
}
_x += 4;
}
if (!Key.isDown(Key.DOWN) && !Key.isDown(Key.UP) && !Key.isDown(Key.LEFT) && !Key.isDown(Key.RIGHT)) {
shift = true;
if (facing == "down") {
gotoAndStop(5);
}
if (facing == "up") {
gotoAndStop(6);
}
if (facing == "left") {
gotoAndStop(7);
}
if (facing == "right") {
gotoAndStop(8);
}
}
}
Here’s the .fla
Thanks in advance.:thumb: