Question
movements
Basically im making an animation that allows the user to move
a character, however when one of the four keys are pressed, the
character movement changes, however so do does the animation (for
example if I click the left key the character turns to the left and
if i hold the left key the character moves to the left, as if the
it looks like it is moving. i have the animation for this).
Basically I can't seem to stop the character from walking, they just keep walk until another key is pressed. So can anyone help me make it go back into a stance? This is my code im using:
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
_x--;
gotoAndStop(5);
}
if (Key.isDown(Key.RIGHT)) {
_x++;
gotoAndStop(6);
}
if (Key.isDown(Key.UP)) {
_y--;
gotoAndStop(4);
}
if (Key.isDown(Key.DOWN)) {
_y++;
gotoAndStop(3);
}
}
Basically I can't seem to stop the character from walking, they just keep walk until another key is pressed. So can anyone help me make it go back into a stance? This is my code im using:
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
_x--;
gotoAndStop(5);
}
if (Key.isDown(Key.RIGHT)) {
_x++;
gotoAndStop(6);
}
if (Key.isDown(Key.UP)) {
_y--;
gotoAndStop(4);
}
if (Key.isDown(Key.DOWN)) {
_y++;
gotoAndStop(3);
}
}