At 1/14/09 07:10 PM, Deathcon7 wrote:
You've got two options: you can have movement and animation as two separate conditionals, or you could combine it all. I would suggest the former simply because it's easier to read.
So for example you'd use the following:
thanks for the reply! the code is confusing to me though, i don't see why you need the "true" in there, and i don't know how to use any of that bottom half of the code.
this is what i've managed to do myself
onClipEvent (load) {
walkSpeed = 5;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.UP)) {
_y-= walkSpeed;
this.gotoAndStop(9);
}
if (Key.isDown(key.RIGHT)) {
_x+= walkSpeed;
this.gotoAndStop(10);
}
if (Key.isDown(key.LEFT)) {
_x-= walkSpeed;
this.gotoAndStop(11);
}
if (Key.isDown(key.DOWN)) {
_y+= walkSpeed;
this.gotoAndStop(12);
}
if(Key.isDown(Key.UP) && Key.isDown(Key.RIGHT)){
this.gotoAndStop(13);
}
if(Key.isDown(Key.RIGHT) && Key.isDown(Key.DOWN)){
this.gotoAndStop(14);
}
if(Key.isDown(Key.DOWN) && Key.isDown(Key.LEFT)){
this.gotoAndStop(15);
}
if(Key.isDown(Key.UP) && Key.isDown(Key.LEFT)){
this.gotoAndStop(16);
}
}
here's what it gives you http://spamtheweb.com/ul/upload/140109/7 1676_char.php
the diagonal animations arn't working right, and i still don't know how to use the idle animations