....I even made my own thread about this, but maybe one of you can help me here.
Here's the code:
man_walk();
}
function man_walk (Key): void {
switch (Key) {
case "LEFT" :
man._rotation = 270;
man._x -= 4;
man.gotoAndStop(2);
break;
case "RIGHT" :
man._rotation = 90;
man._x += 4;
man.gotoAndStop(2);
break;
case "UP" :
man._y -= 4;
man._rotation = 0;
man.gotoAndStop(2);
break;
case "DOWN" :
man._y += 4;
man._rotation = 180;
man.gotoAndStop(2);
break;
default:
break;
}
}
Im trying to make the code for movement of a character for an rpg game much easier to read by putting it into a switch method, only problem is that I need a keylistener, but I dont know how to put one in my code, and connect it back to the program for this code to work.
Again, all I'm doing is trying to make the code that makes a character move using WASD keys more simpler, but I dont know the Full Code or the exact way how. So, all I need is just some help....
And for God's sake, someone help me, lol! I've been on like 10 different forums, with almost no luck xD....thanks in advance. ~Devicer4321