Okay well im new at this whole flash thingy and ive read the tutorials on how to make Role Playing games. The thing is, now that ive got the character movment done I need a way to make so that when the character presses left the sprite changes to to the left facing sprite. the same with the right and the back facing direction. in other words i need to learn how to make the sprite walk in all directions with the sprites changing depending on the direction.
Like this character i made walks in four directions and is animated with four frames for each direction.
onClipEvent (load) {
walkSpeed = 10;
stop();
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.UP)) {
play();
_y-= walkSpeed;
}
if (Key.isDown(Key.RIGHT)) {
play();
_x+= walkSpeed;
}
if (Key.isDown(Key.LEFT)) {
play();
_x-= walkSpeed;
}
if (Key.isDown(Key.DOWN)) {
play();
_y+= walkSpeed;
}
if (!Key.isDown(key.UP) & !Key.isDown(key.DOWN) & !Key.isDown(key.LEFT) & !Key.isDown(key.RIGHT)) {
stop();
}
}