hi
im making a game and i want the character to move with the arrow keys but face in the direction of the mouse... kinda like a top-down fps (pple who play cs or other fps should know what i mean)
well anyways
i got the guy to move around (easy part) but i cant get him to face in the direciton of my mouse
this is the code im currently using (i took out the mouse part cuz it was screwing it up)
if any 1 can help me i would greatly appreciate it
onClipEvent (load) {
speed = 2;
}
onClipEvent (enterFrame) {
if (key.isdown(key.RIGHT)) {
play();
_x+= speed;
}
if (key.isdown(key.LEFT)) {
play();
_x-= speed;
}
if (key.isdown(key.UP)) {
play();
_y-= speed;
}
if (key.isdown(key.DOWN)) {
play();
_y+= speed;
}
}
![]()
![]()
![]()
![]()




Reply With Quote